/* -*- 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 LocalStorageManager; class PBackgroundStorageParent; class PSessionStorageObserverParent; class SessionStorageCache; class SessionStorageCacheParent; class SessionStorageManager; class SessionStorageManagerParent; class BackgroundSessionStorageManager; class SessionStorageObserver;
class LocalStorageCacheChild final : public PBackgroundLocalStorageCacheChild { friendclass mozilla::ipc::BackgroundChildImpl; friendclass LocalStorageCache; friendclass LocalStorageManager;
// LocalStorageCache effectively owns this instance, although IPC handles its // allocation/deallocation. When the LocalStorageCache destructor runs, it // will invoke SendDeleteMeInternal() which will trigger both instances to // drop their mutual references and cause IPC to destroy the actor after the // DeleteMe round-trip.
LocalStorageCache* MOZ_NON_OWNING_REF mCache;
// Child side of the IPC protocol, exposes as DB interface but // is responsible to send all requests to the parent process // and expects asynchronous answers. Those are then transparently // forwarded back to consumers on the child process. class StorageDBChild final : public PBackgroundStorageChild { class ShutdownObserver;
// Held to get caches to forward answers to.
RefPtr<LocalStorageManager> mManager;
// Origins having data hash, for optimization purposes only
UniquePtr<nsTHashSet<nsCString>> mOriginsHavingData;
// List of caches waiting for preload. This ensures the contract that // AsyncPreload call references the cache for time of the preload.
nsTHashSet<RefPtr<LocalStorageCacheBridge>> mLoadingCaches;
// Expected to be only 0 or 1. const uint32_t mPrivateBrowsingId;
// Status of the remote database
nsresult mStatus;
bool mIPCOpen;
};
class SessionStorageObserverChild final : public PSessionStorageObserverChild { friendclass SessionStorageManager; friendclass SessionStorageObserver;
// SessionStorageObserver effectively owns this instance, although IPC handles // its allocation/deallocation. When the SessionStorageObserver destructor // runs, it will invoke SendDeleteMeInternal() which will trigger both // instances to drop their mutual references and cause IPC to destroy the // actor after the DeleteMe round-trip.
SessionStorageObserver* MOZ_NON_OWNING_REF mObserver;
class SessionStorageCacheChild final
: public PBackgroundSessionStorageCacheChild { friendclass PBackgroundSessionStorageCacheChild; friendclass SessionStorageCache; friendclass SessionStorageManager; friendclass mozilla::ipc::BackgroundChildImpl;
// SessionStorageManagerChild effectively owns this instance, although IPC // handles its allocation/deallocation. When the SessionStorageManager // destructor runs, it will invoke SendDeleteMeInternal() which will trigger // both instances to drop their mutual references and cause IPC to destroy the // actor after the DeleteMe round-trip.
SessionStorageCache* MOZ_NON_OWNING_REF mCache;
private: // Only created by SessionStorageManager. explicit SessionStorageCacheChild(SessionStorageCache* aCache);
// Only destroyed by mozilla::ipc::BackgroundChildImpl.
~SessionStorageCacheChild();
// Only called by SessionStorageCache. void SendDeleteMeInternal();
// IPDL methods are only called by IPDL. void ActorDestroy(ActorDestroyReason aWhy) override;
};
class SessionStorageManagerChild final
: public PBackgroundSessionStorageManagerChild { friendclass PBackgroundSessionStorageManagerChild; friendclass SessionStorage; friendclass SessionStorageManager; friendclass mozilla::ipc::BackgroundChildImpl;
// SessionStorageManager effectively owns this instance, although IPC handles // its allocation/deallocation. When the SessionStorageManager destructor // runs, it will invoke SendDeleteMeInternal() which will trigger both // instances to drop their mutual references and cause IPC to destroy the // actor after the DeleteMe round-trip.
SessionStorageManager* MOZ_NON_OWNING_REF mSSManager;
// Receives async requests from child processes and is responsible // to send back responses from the DB thread. Exposes as a fake // LocalStorageCache consumer. // Also responsible for forwardning all chrome operation notifications // such as cookie cleaning etc to the child process. class StorageDBParent final : public PBackgroundStorageParent { class ObserverSink;
public: // Fake cache class receiving async callbacks from DB thread, sending // them back to appropriate cache object on the child process. class CacheParentBridge : public LocalStorageCacheBridge { public:
CacheParentBridge(StorageDBParent* aParentDB, const nsACString& aOriginSuffix, const nsACString& aOriginNoSuffix)
: mOwningEventTarget(GetCurrentSerialEventTarget()),
mParent(aParentDB),
mOriginSuffix(aOriginSuffix),
mOriginNoSuffix(aOriginNoSuffix),
mLoaded(false),
mLoadedCount(0) {} virtual ~CacheParentBridge() = default;
// A hack to deal with deadlock between the parent process main thread and // background thread when invoking StorageDBThread::GetOrCreate because it // cannot safely perform a synchronous dispatch back to the main thread // (because we are already synchronously doing things on the stack). // Populated for the same process actors, empty for other process actors.
nsString mProfilePath;
// Expected to be only 0 or 1. const uint32_t mPrivateBrowsingId;
class SessionStorageCacheParent final
: public PBackgroundSessionStorageCacheParent { friendclass PBackgroundSessionStorageCacheParent; const PrincipalInfo mPrincipalInfo; const nsCString mOriginKey;
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.