Backed out changeset 75d0e51772db (bug 1211665) because it wasn't supposed to land
authorWes Kocher <wkocher@mozilla.com>
Fri, 01 Apr 2016 10:53:07 -0700
changeset 291291 b6ea6a3bb8a6fc355b46403919d8c70e798c7007
parent 291290 d3ba5b5019c6cd9348787e42ad0596c4d535cd14
child 291402 c40c0b2f3b4c778af4307e090b4063b63c806cda
child 291403 d0704310fc2fc7cc7f0754df7b2468f9af15b91f
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1211665
milestone48.0a1
backs out75d0e51772db9f842eb5e1dee98230e774c69b33
Backed out changeset 75d0e51772db (bug 1211665) because it wasn't supposed to land MozReview-Commit-ID: AJlDqbYWN2b
devtools/server/actors/addon.js
devtools/shared/tests/unit/test_consoleID.js
devtools/shared/webconsole/utils.js
--- a/devtools/server/actors/addon.js
+++ b/devtools/server/actors/addon.js
@@ -311,17 +311,17 @@ update(AddonConsoleActor.prototype, {
     let startedListeners = [];
 
     while (aRequest.listeners.length > 0) {
       let listener = aRequest.listeners.shift();
       switch (listener) {
         case "ConsoleAPI":
           if (!this.consoleAPIListener) {
             this.consoleAPIListener =
-              new ConsoleAPIListener(null, this, { addonId: this.addon.id });
+              new ConsoleAPIListener(null, this, "addon/" + this.addon.id);
             this.consoleAPIListener.init();
           }
           startedListeners.push(listener);
           break;
       }
     }
     return {
       startedListeners: startedListeners,
--- a/devtools/shared/tests/unit/test_consoleID.js
+++ b/devtools/shared/tests/unit/test_consoleID.js
@@ -62,17 +62,17 @@ function run_test() {
   console.log("Hello from default console");
   console1.warn("Warning from foo");
   console2.error("Error from bar");
   do_check_eq(seenMessages, 3);
   do_check_eq(seenTypes, 7);
 
   listener.destroy();
 
-  listener = new ConsoleAPIListener(null, callback, {consoleID: "foo"});
+  listener = new ConsoleAPIListener(null, callback, "foo");
   listener.init();
   messages = listener.getCachedMessages();
 
   seenTypes = 0;
   seenMessages = 0;
   messages.forEach(callback.onConsoleAPICall);
   do_check_eq(seenMessages, 2);
   do_check_eq(seenTypes, 1);
--- a/devtools/shared/webconsole/utils.js
+++ b/devtools/shared/webconsole/utils.js
@@ -789,24 +789,22 @@ ConsoleServiceListener.prototype =
  * @param nsIDOMWindow window
  *        Optional - the window object for which we are created. This is used
  *        for filtering out messages that belong to other windows.
  * @param object owner
  *        The owner object must have the following methods:
  *        - onConsoleAPICall(). This method is invoked with one argument, the
  *        Console API message that comes from the observer service, whenever
  *        a relevant console API call is received.
- * @param object filteringOptions
- *        Options - The filteringOptions that this listener should listen to
-          (e.g. { addonId: "..." } or { consoleID: "..." }).
+ * @param string consoleID
+ *        Options - The consoleID that this listener should listen to
  */
-function ConsoleAPIListener(window, owner, {addonId, consoleID} = {}) {
+function ConsoleAPIListener(window, owner, consoleID) {
   this.window = window;
   this.owner = owner;
-  this.addonId = addonId;
   this.consoleID = consoleID;
 }
 exports.ConsoleAPIListener = ConsoleAPIListener;
 
 ConsoleAPIListener.prototype =
 {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 
@@ -822,20 +820,20 @@ ConsoleAPIListener.prototype =
    * console API call object that comes from the observer service.
    *
    * @type object
    * @see WebConsoleActor
    */
   owner: null,
 
   /**
-   * The addonId that we listen for. If not null then only messages from this
+   * The consoleID that we listen for. If not null then only messages from this
    * console will be returned.
    */
-  addonId: null,
+  consoleID: null,
 
   /**
    * Initialize the window.console API observer.
    */
   init: function() {
     // Note that the observer is process-wide. We will filter the messages as
     // needed, see CAL_observe().
     Services.obs.addObserver(this, "console-api-log-event", false);
@@ -893,41 +891,18 @@ ConsoleAPIListener.prototype =
     if (this.window && !workerType) {
       let msgWindow = Services.wm.getCurrentInnerWindowWithId(message.innerID);
       if (!msgWindow || !isWindowIncluded(this.window, msgWindow)) {
         // Not the same window!
         return false;
       }
     }
 
-    if (this.consoleID) {
-      // Filtering based on the old-style consoleID property used by
-      // the legacy Console JSM module.
-      if (message.consoleID !== this.consoleID) {
-        return false;
-      }
-    }
-
-    if (this.addonId) {
-      if (!message.consoleID && !message.originAttributes) {
-        return false;
-      }
-
-      // Filtering based on the old-style consoleID property used by
-      // the legacy Console JSM module.
-      if (message.consoleID && message.consoleID !== `addon/${this.addonId}`) {
-        return false;
-      }
-
-      // Filtering based on the originAttributes used by
-      // the Console API object.
-      if (message.originAttributes &&
-          message.originAttributes.addonId !== this.addonId) {
-        return false;
-      }
+    if (this.consoleID && message.consoleID !== this.consoleID) {
+      return false;
     }
 
     return true;
   },
 
   /**
    * Get the cached messages for the current inner window and its (i)frames.
    *