/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim:set ts=2 sw=2 sts=2 et cindent: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Step 1. Let steps be the following steps, given chunk // Note: See ByteLengthQueuingStrategySize instead.
// Step 2. Let F be !CreateBuiltinFunction(steps, 1, "size", « », // globalObject’s relevant Realm).
JS::Rooted<JSFunction*> sizeFunction(
cx, JS_NewFunction(cx, ByteLengthQueuingStrategySize, 1, 0, "size")); if (!sizeFunction) {
aRv.StealExceptionFromJSContext(cx); return nullptr;
}
// Step 3. Set globalObject’s byte length queuing strategy size function to // a Function that represents a reference to F, // with callback context equal to globalObject’s relevant settings object.
JS::Rooted<JSObject*> funObj(cx, JS_GetFunctionObject(sizeFunction));
JS::Rooted<JSObject*> global(cx, mGlobal->GetGlobalJSObject());
RefPtr<Function> function = new Function(cx, funObj, global, mGlobal);
mGlobal->SetByteLengthQueuingStrategySizeFunction(function);
return function.forget();
}
} // namespace mozilla::dom
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.