зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1619221 - Remove can-debug-sw-updated event r=ladybenko,daisuke,devtools-backward-compat-reviewers
Depends on D81343 All the client side consumers for the event have been removed. Since we don't support forward compatibility, we can simply remove the event. Differential Revision: https://phabricator.services.mozilla.com/D81344
This commit is contained in:
Родитель
84f6f1cbe2
Коммит
17460eb5c7
|
@ -9,10 +9,8 @@ const Services = require("Services");
|
|||
const protocol = require("devtools/shared/protocol");
|
||||
const { LongStringActor } = require("devtools/server/actors/string");
|
||||
const {
|
||||
addDebugServiceWorkersListener,
|
||||
canDebugServiceWorkers,
|
||||
isParentInterceptEnabled,
|
||||
removeDebugServiceWorkersListener,
|
||||
} = require("devtools/shared/service-workers-debug-helper");
|
||||
|
||||
const { DevToolsServer } = require("devtools/server/devtools-server");
|
||||
|
@ -30,11 +28,6 @@ exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, {
|
|||
this._window.addEventListener("pageshow", this._onPageShow, true);
|
||||
}
|
||||
this._acquireWakeLock();
|
||||
|
||||
this._onDebugServiceWorkersUpdated = this._onDebugServiceWorkersUpdated.bind(
|
||||
this
|
||||
);
|
||||
addDebugServiceWorkersListener(this._onDebugServiceWorkersUpdated);
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
|
@ -43,11 +36,6 @@ exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, {
|
|||
if (this._window) {
|
||||
this._window.removeEventListener("pageshow", this._onPageShow, true);
|
||||
}
|
||||
removeDebugServiceWorkersListener(this._onDebugServiceWorkersUpdated);
|
||||
},
|
||||
|
||||
_onDebugServiceWorkersUpdated: function() {
|
||||
this.emit("can-debug-sw-updated", canDebugServiceWorkers());
|
||||
},
|
||||
|
||||
getDescription: function() {
|
||||
|
|
|
@ -19,36 +19,8 @@ XPCOMUtils.defineLazyServiceGetter(
|
|||
* This depends both on the current multiprocess (e10s) configuration and on the
|
||||
* usage of the new service worker implementation
|
||||
* (dom.serviceWorkers.parent_intercept = true).
|
||||
*
|
||||
* Since this can be changed on the fly, there are subscribe/unsubscribe functions
|
||||
* to get notified of this.
|
||||
*/
|
||||
|
||||
const PROCESS_COUNT_PREF = "dom.ipc.processCount";
|
||||
const MULTI_OPTOUT_PREF = "dom.ipc.multiOptOut";
|
||||
|
||||
function addDebugServiceWorkersListener(listener) {
|
||||
// Some notes about these observers:
|
||||
// - nsIPrefBranch.addObserver observes prefixes. In reality, watching
|
||||
// PROCESS_COUNT_PREF watches two separate prefs:
|
||||
// dom.ipc.processCount *and* dom.ipc.processCount.web. Because these
|
||||
// are the two ways that we control the number of content processes,
|
||||
// that works perfectly fine.
|
||||
// - The user might opt in or out of multi by setting the multi opt out
|
||||
// pref. That affects whether we need to show our warning, so we need to
|
||||
// update our state when that pref changes.
|
||||
// - In all cases, we don't have to manually check which pref changed to
|
||||
// what. The platform code in nsIXULRuntime.maxWebProcessCount does all
|
||||
// of that for us.
|
||||
Services.prefs.addObserver(PROCESS_COUNT_PREF, listener);
|
||||
Services.prefs.addObserver(MULTI_OPTOUT_PREF, listener);
|
||||
}
|
||||
|
||||
function removeDebugServiceWorkersListener(listener) {
|
||||
Services.prefs.removeObserver(PROCESS_COUNT_PREF, listener);
|
||||
Services.prefs.removeObserver(MULTI_OPTOUT_PREF, listener);
|
||||
}
|
||||
|
||||
function canDebugServiceWorkers() {
|
||||
const isE10s = Services.appinfo.browserTabsRemoteAutostart;
|
||||
const processCount = Services.appinfo.maxWebProcessCount;
|
||||
|
@ -65,8 +37,6 @@ function isParentInterceptEnabled() {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
addDebugServiceWorkersListener,
|
||||
canDebugServiceWorkers,
|
||||
isParentInterceptEnabled,
|
||||
removeDebugServiceWorkersListener,
|
||||
};
|
||||
|
|
|
@ -3,17 +3,10 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { Arg, RetVal, generateActorSpec } = require("devtools/shared/protocol");
|
||||
const { RetVal, generateActorSpec } = require("devtools/shared/protocol");
|
||||
const deviceSpec = generateActorSpec({
|
||||
typeName: "device",
|
||||
|
||||
events: {
|
||||
"can-debug-sw-updated": {
|
||||
type: "can-debug-sw-updated",
|
||||
canDebugServiceWorkers: Arg(0, "boolean"),
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
getDescription: { request: {}, response: { value: RetVal("json") } },
|
||||
screenshotToDataURL: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче