Bug 1786501 - Expose StorageManager::Shutdown to chrome; r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D155792
This commit is contained in:
Jan Varga 2022-08-31 09:34:51 +00:00
parent 23d5acfc60
commit 34b9324920
3 changed files with 15 additions and 4 deletions

View File

@ -731,8 +731,6 @@ StorageManager::StorageManager(nsIGlobalObject* aGlobal) : mOwner(aGlobal) {
StorageManager::~StorageManager() = default;
void StorageManager::Shutdown() {}
already_AddRefed<Promise> StorageManager::Persisted(ErrorResult& aRv) {
MOZ_ASSERT(mOwner);
@ -767,6 +765,8 @@ already_AddRefed<Promise> StorageManager::GetDirectory(ErrorResult& aRv) {
return mFileSystemManager->GetDirectory(aRv);
}
void StorageManager::Shutdown() {}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(StorageManager, mOwner,
mFileSystemManager)

View File

@ -36,8 +36,6 @@ class StorageManager final : public nsISupports, public nsWrapperCache {
nsIGlobalObject* GetParentObject() const { return mOwner; }
void Shutdown();
// WebIDL
already_AddRefed<Promise> Persisted(ErrorResult& aRv);
@ -47,6 +45,8 @@ class StorageManager final : public nsISupports, public nsWrapperCache {
already_AddRefed<Promise> GetDirectory(ErrorResult& aRv);
void Shutdown();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StorageManager)

View File

@ -32,3 +32,14 @@ partial interface StorageManager {
[Pref="dom.fs.enabled", NewObject]
Promise<FileSystemDirectoryHandle> getDirectory();
};
/**
* Testing methods that exist only for the benefit of automated glass-box
* testing. Will never be exposed to content at large and unlikely to be useful
* in a WebDriver context.
*/
[SecureContext]
partial interface StorageManager {
[ChromeOnly]
void shutdown();
};