mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1791867 - Add GetStorageManager to nsIGlobalObject; r=smaug,dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D157902
This commit is contained in:
parent
cc0e44a847
commit
e95f3b4eec
@ -1678,6 +1678,10 @@ nsGlobalWindowInner::GetStorageKey() {
|
||||
return std::move(principalInfo);
|
||||
}
|
||||
|
||||
mozilla::dom::StorageManager* nsGlobalWindowInner::GetStorageManager() {
|
||||
return Navigator()->Storage();
|
||||
}
|
||||
|
||||
nsresult nsGlobalWindowInner::EnsureScriptEnvironment() {
|
||||
// NOTE: We can't use FORWARD_TO_OUTER here because we don't want to fail if
|
||||
// we're called on an inactive inner window.
|
||||
|
@ -266,6 +266,8 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
|
||||
mozilla::Result<mozilla::ipc::PrincipalInfo, nsresult> GetStorageKey()
|
||||
override;
|
||||
|
||||
mozilla::dom::StorageManager* GetStorageManager() override;
|
||||
|
||||
void TraceGlobalJSObject(JSTracer* aTrc);
|
||||
|
||||
virtual nsresult EnsureScriptEnvironment() override;
|
||||
|
@ -49,6 +49,7 @@ class ReportingObserver;
|
||||
class ServiceWorker;
|
||||
class ServiceWorkerRegistration;
|
||||
class ServiceWorkerRegistrationDescriptor;
|
||||
class StorageManager;
|
||||
} // namespace dom
|
||||
namespace ipc {
|
||||
class PrincipalInfo;
|
||||
@ -278,6 +279,8 @@ class nsIGlobalObject : public nsISupports,
|
||||
mozilla::Result<bool, nsresult> HasEqualStorageKey(
|
||||
const mozilla::ipc::PrincipalInfo& aStorageKey);
|
||||
|
||||
virtual mozilla::dom::StorageManager* GetStorageManager() { return nullptr; }
|
||||
|
||||
protected:
|
||||
virtual ~nsIGlobalObject();
|
||||
|
||||
|
@ -842,6 +842,10 @@ WorkerGlobalScope::GetOrCreateServiceWorkerRegistration(
|
||||
return ref;
|
||||
}
|
||||
|
||||
mozilla::dom::StorageManager* WorkerGlobalScope::GetStorageManager() {
|
||||
return RefPtr(Navigator())->Storage();
|
||||
}
|
||||
|
||||
void WorkerGlobalScope::StorageAccessPermissionGranted() {
|
||||
// Reset the IndexedDB factory.
|
||||
mIndexedDB = nullptr;
|
||||
|
@ -234,6 +234,8 @@ class WorkerGlobalScope : public WorkerGlobalScopeBase {
|
||||
Maybe<EventCallbackDebuggerNotificationType> GetDebuggerNotificationType()
|
||||
const final;
|
||||
|
||||
mozilla::dom::StorageManager* GetStorageManager() final;
|
||||
|
||||
// WorkerGlobalScope WebIDL implementation
|
||||
WorkerGlobalScope* Self() { return this; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user