From 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:47:29 +0200 Subject: Adding upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- .../server/actors/resources/storage-extension.js | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 devtools/server/actors/resources/storage-extension.js (limited to 'devtools/server/actors/resources/storage-extension.js') diff --git a/devtools/server/actors/resources/storage-extension.js b/devtools/server/actors/resources/storage-extension.js new file mode 100644 index 0000000000..daacd40778 --- /dev/null +++ b/devtools/server/actors/resources/storage-extension.js @@ -0,0 +1,30 @@ +/* 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/. */ + +"use strict"; + +const { + TYPES: { EXTENSION_STORAGE }, +} = require("resource://devtools/server/actors/resources/index.js"); + +const ParentProcessStorage = require("resource://devtools/server/actors/resources/utils/parent-process-storage.js"); +const { + ExtensionStorageActor, +} = require("resource://devtools/server/actors/resources/storage/extension-storage.js"); + +class ExtensionStorageWatcher extends ParentProcessStorage { + constructor() { + super(ExtensionStorageActor, "extensionStorage", EXTENSION_STORAGE); + } + async watch(watcherActor, { onAvailable }) { + if (watcherActor.sessionContext.type != "webextension") { + throw new Error( + "EXTENSION_STORAGE should only be listened when debugging a webextension" + ); + } + return super.watch(watcherActor, { onAvailable }); + } +} + +module.exports = ExtensionStorageWatcher; -- cgit v1.2.3