/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=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 http://mozilla.org/MPL/2.0/. */
class UniqueMessagePortId; class RemoteWorkerData; class SharedWorkerManager; class SharedWorkerService;
// Main-thread only object that keeps a manager and the service alive. // When the last SharedWorkerManagerHolder is released, the corresponding // manager unregisters itself from the service and terminates the worker. class SharedWorkerManagerHolder final
: public SupportsCheckedUnsafePtr<CheckIf<DiagnosticAssertEnabled>> { public:
NS_INLINE_DECL_REFCOUNTING(SharedWorkerManagerHolder);
// Thread-safe wrapper for SharedWorkerManagerHolder. class SharedWorkerManagerWrapper final { public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SharedWorkerManagerWrapper);
/** * PBackground instance that corresponds to a single logical Shared Worker that * exists somewhere in the process tree. Referenced/owned by multiple * SharedWorkerParent instances on the PBackground thread. Holds/owns a single * RemoteWorkerController to interact with the actual shared worker thread, * wherever it is located. Creates the RemoteWorkerController via * RemoteWorkerController::Create which uses RemoteWorkerManager::Launch under * the hood.
*/ class SharedWorkerManager final : public RemoteWorkerObserver { public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SharedWorkerManager, override);
// Returns a holder if this manager matches. The holder blocks the shutdown of // the manager.
already_AddRefed<SharedWorkerManagerHolder> MatchOnMainThread(
SharedWorkerService* aService, const RemoteWorkerData& aData,
nsIURI* aScriptURL, nsIPrincipal* aLoadingPrincipal, const OriginAttributes& aEffectiveStoragePrincipalAttrs, bool* aMatchNameButNotOptions);
// Main-thread only. Raw Pointers because holders keep the manager alive and // they unregister themselves in their DTOR.
nsTArray<CheckedUnsafePtr<SharedWorkerManagerHolder>> mHolders;
};
} // namespace mozilla::dom
#endif// mozilla_dom_SharedWorkerManager_h
¤ Dauer der Verarbeitung: 0.13 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.