Bug 1701862 - [devtools] Enable Stylesheet resources for all targets. r=bomsy.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Thu, 19 May 2022 05:24:54 +0000
changeset 618195 aae4df69e66b79c0be40de234872386f5267b35f
parent 618194 ea32c4c1d987ddef9f831edbb1c4cb187930dc16
child 618196 09fe65a1355444a3789af9e994f76e2c7a0a4f0c
push id39719
push usersmolnar@mozilla.com
push dateThu, 19 May 2022 16:03:14 +0000
treeherdermozilla-central@cc776278c4ea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbomsy
bugs1701862
milestone102.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1701862 - [devtools] Enable Stylesheet resources for all targets. r=bomsy. This revealed a leak in the stylesheet manager (visible in devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_fission_inspector_webextension.js), so we cleanup some references in StyleSheetManager#destroy. Differential Revision: https://phabricator.services.mozilla.com/D146194
devtools/server/actors/utils/stylesheets-manager.js
devtools/server/actors/watcher/session-context.js
--- a/devtools/server/actors/utils/stylesheets-manager.js
+++ b/devtools/server/actors/utils/stylesheets-manager.js
@@ -865,16 +865,22 @@ class StyleSheetsManager extends EventEm
     } catch (e) {
       console.error(
         "Error when destroying StyleSheet manager for",
         this._targetActor,
         ": ",
         e
       );
     }
+
+    this._styleSheetMap.clear();
+    this._styleSheetMap = null;
+    this._targetActor = null;
+    this._styleSheetCreationData = null;
+    this._mqlList = null;
   }
 }
 
 function hasStyleSheetWatcherSupportForTarget(targetActor) {
   return (
     targetActor.sessionContext.supportedResources?.[TYPES.STYLESHEET] || false
   );
 }
--- a/devtools/server/actors/watcher/session-context.js
+++ b/devtools/server/actors/watcher/session-context.js
@@ -206,17 +206,17 @@ function getWatcherSupportedResources(ty
     [Resources.TYPES.ERROR_MESSAGE]: true,
     [Resources.TYPES.INDEXED_DB]: isTabOrWebExtensionToolbox,
     [Resources.TYPES.LOCAL_STORAGE]: isTabOrWebExtensionToolbox,
     [Resources.TYPES.SESSION_STORAGE]: isTabOrWebExtensionToolbox,
     [Resources.TYPES.PLATFORM_MESSAGE]: true,
     [Resources.TYPES.NETWORK_EVENT]: true,
     [Resources.TYPES.NETWORK_EVENT_STACKTRACE]: true,
     [Resources.TYPES.REFLOW]: true,
-    [Resources.TYPES.STYLESHEET]: isTabOrWebExtensionToolbox,
+    [Resources.TYPES.STYLESHEET]: true,
     [Resources.TYPES.SOURCE]: isTabOrWebExtensionToolbox,
     [Resources.TYPES.THREAD_STATE]: isTabOrWebExtensionToolbox,
     [Resources.TYPES.SERVER_SENT_EVENT]: isTabOrWebExtensionToolbox,
     [Resources.TYPES.WEBSOCKET]: isTabOrWebExtensionToolbox,
   };
 }
 
 module.exports = {