Bug 1717724 - [devtools] Remove web console actor traits. r=nchevobbe,devtools-backward-compat-reviewers
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 19 Oct 2021 12:27:59 +0000
changeset 596339 23fb782c56f1fabc6caf95c65d42c61fe8eb6563
parent 596338 4d5a1c14ff7ff0abe7bcb364a89dfba3458d26e6
child 596340 3a7d451c60989435a7b71f5c304d65ea92c408fa
push id38896
push userabutkovits@mozilla.com
push dateTue, 19 Oct 2021 21:51:00 +0000
treeherdermozilla-central@e9071741b84c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe, devtools-backward-compat-reviewers
bugs1717724
milestone95.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 1717724 - [devtools] Remove web console actor traits. r=nchevobbe,devtools-backward-compat-reviewers This depends on calling startListening, which forces target to be attached asynchronously. Also, we would like to stop calling startListening as it has been replaced by watchResources APIs. If we ever need a trait, we should rather use RootActor one, as it is easy to read by any code. Or we should come up with something more robut and more generic that this startListening setup. Depends on D118584 Differential Revision: https://phabricator.services.mozilla.com/D118585
devtools/client/fronts/webconsole.js
devtools/server/actors/webconsole.js
devtools/shared/specs/webconsole.js
--- a/devtools/client/fronts/webconsole.js
+++ b/devtools/client/fronts/webconsole.js
@@ -19,17 +19,16 @@ const {
  *
  * @param object client
  *        The DevToolsClient instance we live for.
  */
 class WebConsoleFront extends FrontClassWithSpec(webconsoleSpec) {
   constructor(client, targetFront, parentFront) {
     super(client, targetFront, parentFront);
     this._client = client;
-    this.traits = {};
     this.events = [];
 
     // Attribute name from which to retrieve the actorID out of the target actor's form
     this.formAttributeName = "consoleActor";
 
     this._onNetworkEventUpdate = this._onNetworkEventUpdate.bind(this);
 
     this.before("consoleAPICall", this.beforeConsoleAPICall);
@@ -301,17 +300,16 @@ class WebConsoleFront extends FrontClass
    *        Array of listeners you want to start. See this.LISTENERS for
    *        known listeners.
    * @return request
    *         Request object that implements both Promise and EventEmitter interfaces
    */
   async startListeners(listeners) {
     const response = await super.startListeners(listeners);
     this.hasNativeConsoleAPI = response.nativeConsoleAPI;
-    this.traits = response.traits;
     return response;
   }
 
   /**
    * Close the WebConsoleFront.
    *
    */
   destroy() {
--- a/devtools/server/actors/webconsole.js
+++ b/devtools/server/actors/webconsole.js
@@ -193,18 +193,16 @@ const WebConsoleActor = ActorClassWithSp
     );
     this._onObserverNotification = this._onObserverNotification.bind(this);
     if (this.parentActor.isRootActor) {
       Services.obs.addObserver(
         this._onObserverNotification,
         "last-pb-context-exited"
       );
     }
-
-    this.traits = {};
   },
   /**
    * Debugger instance.
    *
    * @see jsdebugger.jsm
    */
   dbg: null,
 
@@ -232,22 +230,16 @@ const WebConsoleActor = ActorClassWithSp
 
   /**
    * The devtools server connection instance.
    * @type object
    */
   conn: null,
 
   /**
-   * List of supported features by the console actor.
-   * @type object
-   */
-  traits: null,
-
-  /**
    * The global we work with (this can be a Window, a Worker global or even a Sandbox
    * for processes and addons).
    *
    * @type nsIDOMWindow, WorkerGlobalScope or Sandbox
    */
   get global() {
     if (this.parentActor.isRootActor) {
       return this._getWindowForBrowserConsole();
@@ -786,17 +778,16 @@ const WebConsoleActor = ActorClassWithSp
     }
 
     // Update the live list of running listeners
     startedListeners.forEach(this._listeners.add, this._listeners);
 
     return {
       startedListeners: startedListeners,
       nativeConsoleAPI: this.hasNativeConsoleAPI(this.global),
-      traits: this.traits,
     };
   },
 
   /**
    * Handler for the "stopListeners" request.
    *
    * @param array listeners
    *        An array of events to stop sent by the Web Console client.
--- a/devtools/shared/specs/webconsole.js
+++ b/devtools/shared/specs/webconsole.js
@@ -7,22 +7,19 @@
 const {
   types,
   generateActorSpec,
   RetVal,
   Option,
   Arg,
 } = require("devtools/shared/protocol");
 
-types.addDictType("console.traits", {});
-
 types.addDictType("console.startlisteners", {
   startedListeners: "array:string",
   nativeConsoleAPI: "nullable:boolean",
-  traits: "console.traits",
 });
 
 types.addDictType("console.stoplisteners", {
   stoppedListeners: "array:string",
 });
 
 types.addDictType("console.autocomplete", {
   matches: "array:string",