Quellcode-Bibliothek EventWithOptionsRunnable.cpp
Sprache: C
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* 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 https://mozilla.org/MPL/2.0/. */
// For some workers without window, parent is null and we try to find it // from the JS Context. if (!parent) {
JS::Rooted<JSObject*> globalObject(aCx, JS::CurrentGlobalOrNull(aCx)); if (NS_WARN_IF(!globalObject)) {
rv.ThrowDataCloneError("failed to get global object");
OptionsDeserializeFailed(rv); returnfalse;
}
parent = xpc::NativeGlobal(globalObject); if (NS_WARN_IF(!parent)) {
rv.ThrowDataCloneError("failed to get parent");
OptionsDeserializeFailed(rv); returnfalse;
}
}
if (aWorkerPrivate->IsSharedMemoryAllowed()) {
cloneDataPolicy.allowSharedMemoryObjects();
}
Read(parent, aCx, &options, cloneDataPolicy, rv);
if (NS_WARN_IF(rv.Failed())) {
OptionsDeserializeFailed(rv); returnfalse;
}
Sequence<OwningNonNull<MessagePort>> ports; if (NS_WARN_IF(!TakeTransferredPortsAsSequence(ports))) { // TODO: Is this an appropriate type? What does this actually do?
rv.ThrowDataCloneError("TakeTransferredPortsAsSequence failed");
OptionsDeserializeFailed(rv); returnfalse;
}
// If the worker start shutting down, don't dispatch the event. if (NS_FAILED(
aWorkerPrivate->GlobalScope()->CheckCurrentGlobalCorrectness())) { returntrue;
}
¤ 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.0.13Bemerkung:
(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.