Backed out changeset a12f0f05779c (bug 1125205) for dt4 failures CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 24 Apr 2015 13:06:46 -0700
changeset 241018 8e7257aeee45ba712a491d43d0073469c04d9cce
parent 241017 6d0fb655e2e6d93e3d07f9d255ebf1d7291d3955
child 241019 1f443ee3a7e9ff61f21222756ac32c55701525db
push id58990
push userkwierso@gmail.com
push dateFri, 24 Apr 2015 20:06:52 +0000
treeherdermozilla-inbound@8e7257aeee45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1125205
milestone40.0a1
backs outa12f0f05779c7d020bc130b844129be72a53110c
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
Backed out changeset a12f0f05779c (bug 1125205) for dt4 failures CLOSED TREE
browser/app/profile/firefox.js
browser/devtools/webconsole/test/browser.ini
browser/devtools/webconsole/test/browser_webconsole_console_logging_workers_api.js
browser/devtools/webconsole/test/test-console-workers.html
browser/devtools/webconsole/webconsole.js
browser/devtools/webconsole/webconsole.xul
browser/locales/en-US/chrome/browser/devtools/webConsole.dtd
dom/base/Console.cpp
dom/workers/test/test_consoleSharedWorkers.html
toolkit/devtools/server/actors/webconsole.js
toolkit/devtools/webconsole/utils.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1525,19 +1525,16 @@ pref("devtools.webconsole.filter.excepti
 pref("devtools.webconsole.filter.jswarn", true);
 pref("devtools.webconsole.filter.jslog", false);
 pref("devtools.webconsole.filter.error", true);
 pref("devtools.webconsole.filter.warn", true);
 pref("devtools.webconsole.filter.info", true);
 pref("devtools.webconsole.filter.log", true);
 pref("devtools.webconsole.filter.secerror", true);
 pref("devtools.webconsole.filter.secwarn", true);
-pref("devtools.webconsole.filter.serviceworkers", false);
-pref("devtools.webconsole.filter.sharedworkers", false);
-pref("devtools.webconsole.filter.windowlessworkers", false);
 
 // Remember the Browser Console filters
 pref("devtools.browserconsole.filter.network", true);
 pref("devtools.browserconsole.filter.networkinfo", false);
 pref("devtools.browserconsole.filter.netwarn", true);
 pref("devtools.browserconsole.filter.netxhr", false);
 pref("devtools.browserconsole.filter.csserror", true);
 pref("devtools.browserconsole.filter.cssparser", false);
@@ -1546,19 +1543,16 @@ pref("devtools.browserconsole.filter.exc
 pref("devtools.browserconsole.filter.jswarn", true);
 pref("devtools.browserconsole.filter.jslog", true);
 pref("devtools.browserconsole.filter.error", true);
 pref("devtools.browserconsole.filter.warn", true);
 pref("devtools.browserconsole.filter.info", true);
 pref("devtools.browserconsole.filter.log", true);
 pref("devtools.browserconsole.filter.secerror", true);
 pref("devtools.browserconsole.filter.secwarn", true);
-pref("devtools.browserconsole.filter.serviceworkers", true);
-pref("devtools.browserconsole.filter.sharedworkers", true);
-pref("devtools.browserconsole.filter.windowlessworkers", true);
 
 // Text size in the Web Console. Use 0 for the system default size.
 pref("devtools.webconsole.fontSize", 0);
 
 // Max number of inputs to store in web console history.
 pref("devtools.webconsole.inputHistoryCount", 50);
 
 // Persistent logging: |true| if you want the Web Console to keep all of the
--- a/browser/devtools/webconsole/test/browser.ini
+++ b/browser/devtools/webconsole/test/browser.ini
@@ -71,17 +71,16 @@ support-files =
   test-closure-optimized-out.html
   test-closures.html
   test-console-assert.html
   test-console-count.html
   test-console-count-external-file.js
   test-console-extras.html
   test-console-replaced-api.html
   test-console.html
-  test-console-workers.html
   test-console-table.html
   test-console-output-02.html
   test-console-output-03.html
   test-console-output-04.html
   test-console-output-dom-elements.html
   test-console-output-events.html
   test-console-output-regexp.html
   test-console-column.html
@@ -313,17 +312,16 @@ skip-if = e10s # Bug 1042253 - webconsol
 [browser_webconsole_chrome.js]
 [browser_webconsole_clickable_urls.js]
 skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug timeout)
 [browser_webconsole_closure_inspection.js]
 skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
 [browser_webconsole_completion.js]
 [browser_webconsole_console_extras.js]
 [browser_webconsole_console_logging_api.js]
-[browser_webconsole_console_logging_workers_api.js]
 [browser_webconsole_count.js]
 [browser_webconsole_dont_navigate_on_doubleclick.js]
 [browser_webconsole_execution_scope.js]
 [browser_webconsole_for_of.js]
 [browser_webconsole_history.js]
 [browser_webconsole_input_field_focus_on_panel_select.js]
 [browser_webconsole_inspect-parsed-documents.js]
 [browser_webconsole_js_input_expansion.js]
deleted file mode 100644
--- a/browser/devtools/webconsole/test/browser_webconsole_console_logging_workers_api.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests that the basic console.log()-style APIs and filtering work for sharedWorkers
-
-"use strict";
-
-const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-workers.html";
-
-function pushPrefEnv()
-{
-  let deferred = promise.defer();
-  let options = {'set': [["dom.workers.sharedWorkers.enabled", true]]};
-  SpecialPowers.pushPrefEnv(options, deferred.resolve);
-  return deferred.promise;
-}
-
-let test = asyncTest(function*() {
-  yield pushPrefEnv();
-  yield loadTab(TEST_URI);
-
-  let hud = yield openConsole();
-  let outputNode = hud.outputNode;
-
-  yield waitForMessages({
-    webconsole: hud,
-    messages: [{
-      text: "foo-bar-shared-worker"
-    }],
-  });
-
-  hud.setFilterState('sharedworkers', false);
-
-  is(outputNode.querySelectorAll(".filtered-by-type").length, 1,
-     "1 message hidden for sharedworkers (logging turned off)")
-
-  hud.setFilterState('sharedworkers', true);
-
-  is(outputNode.querySelectorAll(".filtered-by-type").length, 0,
-     "1 message shown for sharedworkers (logging turned off)")
-});
deleted file mode 100644
--- a/browser/devtools/webconsole/test/test-console-workers.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!-- Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/ -->
-<!DOCTYPE HTML>
-<html dir="ltr" xml:lang="en-US" lang="en-US"><head>
-    <meta charset="utf-8">
-    <title>Console test</title>
-  </head>
-  <body>
-    <script type="text/javascript">
-var sw = new SharedWorker('data:application/javascript,console.log("foo-bar-shared-worker");');
-    </script>
-  </body>
-</html>
--- a/browser/devtools/webconsole/webconsole.js
+++ b/browser/devtools/webconsole/webconsole.js
@@ -3,17 +3,17 @@
 /* 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 {Cc, Ci, Cu} = require("chrome");
 
-const {Utils: WebConsoleUtils, CONSOLE_WORKER_IDS} = require("devtools/toolkit/webconsole/utils");
+let WebConsoleUtils = require("devtools/toolkit/webconsole/utils").Utils;
 
 loader.lazyServiceGetter(this, "clipboardHelper",
                          "@mozilla.org/widget/clipboardhelper;1",
                          "nsIClipboardHelper");
 loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
 loader.lazyImporter(this, "promise", "resource://gre/modules/Promise.jsm", "Promise");
 loader.lazyGetter(this, "EventEmitter", () => require("devtools/toolkit/event-emitter"));
 loader.lazyGetter(this, "AutocompletePopup",
@@ -133,20 +133,16 @@ const LEVELS = {
   group: SEVERITY_LOG,
   groupCollapsed: SEVERITY_LOG,
   groupEnd: SEVERITY_LOG,
   time: SEVERITY_LOG,
   timeEnd: SEVERITY_LOG,
   count: SEVERITY_LOG
 };
 
-// This array contains the prefKey for the workers and it must keep them in the
-// same order as CONSOLE_WORKER_IDS
-const WORKERTYPES_PREFKEYS = [ 'sharedworkers', 'serviceworkers', 'windowlessworkers' ];
-
 // The lowest HTTP response code (inclusive) that is considered an error.
 const MIN_HTTP_ERROR_CODE = 400;
 // The highest HTTP response code (inclusive) that is considered an error.
 const MAX_HTTP_ERROR_CODE = 599;
 
 // Constants used for defining the direction of JSTerm input history navigation.
 const HISTORY_BACK = -1;
 const HISTORY_FORWARD = 1;
@@ -648,18 +644,17 @@ WebConsoleFrame.prototype = {
   /**
    * Initialize the default filter preferences.
    * @private
    */
   _initDefaultFilterPrefs: function WCF__initDefaultFilterPrefs()
   {
     let prefs = ["network", "networkinfo", "csserror", "cssparser", "csslog",
                  "exception", "jswarn", "jslog", "error", "info", "warn", "log",
-                 "secerror", "secwarn", "netwarn", "netxhr", "sharedworkers",
-                 "serviceworkers", "windowlessworkers"];
+                 "secerror", "secwarn", "netwarn", "netxhr"];
     for (let pref of prefs) {
       this.filterPrefs[pref] = Services.prefs
                                .getBoolPref(this._filterPrefsPrefix + pref);
     }
   },
 
   /**
    * Attach / detach reflow listeners depending on the checked status
@@ -1026,21 +1021,18 @@ WebConsoleFrame.prototype = {
   {
     let outputNode = this.outputNode;
     let doc = this.document;
 
     // Look for message nodes (".message") with the given preference key
     // (filter="error", filter="cssparser", etc.) and add or remove the
     // "filtered-by-type" class, which turns on or off the display.
 
-    let attribute = WORKERTYPES_PREFKEYS.indexOf(aPrefKey) == -1
-                      ? 'filter' : 'workerType';
-
     let xpath = ".//*[contains(@class, 'message') and " +
-      "@" + attribute + "='" + aPrefKey + "']";
+      "@filter='" + aPrefKey + "']";
     let result = doc.evaluate(xpath, outputNode, null,
       Ci.nsIDOMXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
     for (let i = 0; i < result.snapshotLength; i++) {
       let node = result.snapshotItem(i);
       if (aState) {
         node.classList.remove("filtered-by-type");
       }
       else {
@@ -1091,22 +1083,16 @@ WebConsoleFrame.prototype = {
     // Filter by the message type.
     let prefKey = MESSAGE_PREFERENCE_KEYS[aNode.category][aNode.severity];
     if (prefKey && !this.getFilterState(prefKey)) {
       // The node is filtered by type.
       aNode.classList.add("filtered-by-type");
       isFiltered = true;
     }
 
-    // Filter by worker type
-    if ("workerType" in aNode && !this.getFilterState(aNode.workerType)) {
-      aNode.classList.add("filtered-by-type");
-      isFiltered = true;
-    }
-
     // Filter on the search string.
     let search = this.filterBox.value;
     let text = aNode.clipboardText;
 
     // if string matches the filter text
     if (!this.stringMatchesFilters(text, search)) {
       aNode.classList.add("filtered-by-string");
       isFiltered = true;
@@ -1374,22 +1360,16 @@ WebConsoleFrame.prototype = {
       node._objectActors = objectActors;
 
       if (!node._messageObject) {
         let repeatNode = node.getElementsByClassName("message-repeats")[0];
         repeatNode._uid += [...objectActors].join("-");
       }
     }
 
-    let workerTypeID = CONSOLE_WORKER_IDS.indexOf(aMessage.workerType);
-    if (workerTypeID != -1) {
-      node.workerType = WORKERTYPES_PREFKEYS[workerTypeID];
-      node.setAttribute('workerType', WORKERTYPES_PREFKEYS[workerTypeID]);
-    }
-
     return node;
   },
 
   /**
    * Handle ConsoleAPICall objects received from the server. This method outputs
    * the window.console API call.
    *
    * @param object aMessage
--- a/browser/devtools/webconsole/webconsole.xul
+++ b/browser/devtools/webconsole/webconsole.xul
@@ -156,23 +156,16 @@ function goUpdateConsoleCommands() {
               <menuitem label="&btnConsoleErrors;" type="checkbox"
                         autocheck="false" prefKey="error"/>
               <menuitem label="&btnConsoleWarnings;" type="checkbox"
                         autocheck="false" prefKey="warn"/>
               <menuitem label="&btnConsoleInfo;" type="checkbox" autocheck="false"
                         prefKey="info"/>
               <menuitem label="&btnConsoleLog;" type="checkbox" autocheck="false"
                         prefKey="log"/>
-              <menuseparator />
-              <menuitem label="&btnConsoleSharedWorkers;" type="checkbox"
-                        autocheck="false" prefKey="sharedworkers"/>
-              <menuitem label="&btnConsoleServiceWorkers;" type="checkbox"
-                        autocheck="false" prefKey="serviceworkers"/>
-              <menuitem label="&btnConsoleWindowlessWorkers;" type="checkbox"
-                        autocheck="false" prefKey="windowlessworkers"/>
             </menupopup>
           </toolbarbutton>
         </hbox>
         <toolbarbutton class="webconsole-clear-console-button devtools-toolbarbutton"
                        label="&btnClear.label;" tooltiptext="&btnClear.tooltip;"
                        accesskey="&btnClear.accesskey;"
                        tabindex="8"/>
 
--- a/browser/locales/en-US/chrome/browser/devtools/webConsole.dtd
+++ b/browser/locales/en-US/chrome/browser/devtools/webConsole.dtd
@@ -71,26 +71,16 @@
 <!ENTITY btnPageLogging.accesskey3 "L">
 <!ENTITY btnConsoleErrors       "Errors">
 <!ENTITY btnConsoleInfo         "Info">
 <!ENTITY btnConsoleWarnings     "Warnings">
 <!ENTITY btnConsoleLog          "Log">
 <!ENTITY btnConsoleXhr          "XHR">
 <!ENTITY btnConsoleReflows      "Reflows">
 
-<!-- LOCALIZATION NODE (btnConsoleSharedWorkers) the term "Shared Workers"
-  -  should not be translated. -->
-<!ENTITY btnConsoleSharedWorkers "Shared Workers">
-<!-- LOCALIZATION NODE (btnConsoleServiceWorkers) the term "Service Workers"
-  -  should not be translated. -->
-<!ENTITY btnConsoleServiceWorkers "Service Workers">
-<!-- LOCALIZATION NODE (btnConsoleWindowlessWorkers) the term "Workers"
-  -  should not be translated. -->
-<!ENTITY btnConsoleWindowlessWorkers "Add-on or Chrome Workers">
-
 <!ENTITY filterOutput.placeholder "Filter output">
 <!ENTITY btnClear.label        "Clear">
 <!ENTITY btnClear.tooltip      "Clear the Web Console output">
 <!ENTITY btnClear.accesskey    "r">
 
 <!ENTITY fullZoomEnlargeCmd.commandkey  "+">
 <!ENTITY fullZoomEnlargeCmd.commandkey2 "="> <!-- + is above this key on many keyboards -->
 <!ENTITY fullZoomEnlargeCmd.commandkey3 "">
--- a/dom/base/Console.cpp
+++ b/dom/base/Console.cpp
@@ -521,17 +521,17 @@ private:
       if (mWorkerPrivate->IsSharedWorker()) {
         id = NS_LITERAL_STRING("SharedWorker");
       } else if (mWorkerPrivate->IsServiceWorker()) {
         id = NS_LITERAL_STRING("ServiceWorker");
       } else {
         id = NS_LITERAL_STRING("Worker");
       }
 
-      mCallData->SetIDs(frame.mFilename, id);
+      mCallData->SetIDs(id, frame.mFilename);
     }
 
     // Now we could have the correct window (if we are not window-less).
     mData.mParent = aInnerWindow;
 
     ProcessCallData(aCx);
     mCallData->CleanupJSObjects();
 
--- a/dom/workers/test/test_consoleSharedWorkers.html
+++ b/dom/workers/test/test_consoleSharedWorkers.html
@@ -30,18 +30,17 @@
 
         SpecialPowers.removeObserver(this, "console-api-profiler");
         return;
       }
 
       if (aTopic == "console-api-log-event") {
         var obj = aSubject.wrappedJSObject;
         is (obj.arguments[0], "Hello world from a SharedWorker!", "A message from a SharedWorker \\o/");
-        is (obj.ID, "http://mochi.test:8888/tests/dom/workers/test/sharedWorker_console.js", "The ID is SharedWorker");
-        is (obj.innerID, "SharedWorker", "The ID is SharedWorker");
+        is (aData, "SharedWorker", "The ID is SharedWorker");
         is (order++, 1, "Then a log message.");
 
         SpecialPowers.removeObserver(this, "console-api-log-event");
         SimpleTest.finish();
         return;
       }
     }
   }
--- a/toolkit/devtools/server/actors/webconsole.js
+++ b/toolkit/devtools/server/actors/webconsole.js
@@ -28,17 +28,17 @@ XPCOMUtils.defineLazyGetter(this, "Conso
          .ConsoleProgressListener;
 });
 XPCOMUtils.defineLazyGetter(this, "events", () => {
   return require("sdk/event/core");
 });
 
 for (let name of ["WebConsoleUtils", "ConsoleServiceListener",
     "ConsoleAPIListener", "addWebConsoleCommands", "JSPropertyProvider",
-    "ConsoleReflowListener", "CONSOLE_WORKER_IDS"]) {
+    "ConsoleReflowListener"]) {
   Object.defineProperty(this, name, {
     get: function(prop) {
       if (prop == "WebConsoleUtils") {
         prop = "Utils";
       }
       return require("devtools/toolkit/webconsole/utils")[prop];
     }.bind(null, name),
     configurable: true,
@@ -1427,20 +1427,16 @@ WebConsoleActor.prototype =
    *        The original message received from console-api-log-event.
    * @return object
    *         The object that can be sent to the remote client.
    */
   prepareConsoleMessageForRemote:
   function WCA_prepareConsoleMessageForRemote(aMessage)
   {
     let result = WebConsoleUtils.cloneObject(aMessage);
-
-    result.workerType = CONSOLE_WORKER_IDS.indexOf(result.innerID) == -1
-                          ? 'none' : result.innerID;
-
     delete result.wrappedJSObject;
     delete result.ID;
     delete result.innerID;
     delete result.consoleID;
 
     result.arguments = Array.map(aMessage.arguments || [], (aObj) => {
       let dbgObj = this.makeDebuggeeValue(aObj, true);
       return this.createValueGrip(dbgObj);
--- a/toolkit/devtools/webconsole/utils.js
+++ b/toolkit/devtools/webconsole/utils.js
@@ -34,18 +34,16 @@ const REGEX_MATCH_FUNCTION_ARGS = /^\(?f
 // Number of terminal entries for the self-xss prevention to go away
 const CONSOLE_ENTRY_THRESHOLD = 5;
 
 // Provide an easy way to bail out of even attempting an autocompletion
 // if an object has way too many properties. Protects against large objects
 // with numeric values that wouldn't be tallied towards MAX_AUTOCOMPLETIONS.
 const MAX_AUTOCOMPLETE_ATTEMPTS = exports.MAX_AUTOCOMPLETE_ATTEMPTS = 100000;
 
-const CONSOLE_WORKER_IDS = exports.CONSOLE_WORKER_IDS = [ 'SharedWorker', 'ServiceWorker', 'Worker' ];
-
 // Prevent iterating over too many properties during autocomplete suggestions.
 const MAX_AUTOCOMPLETIONS = exports.MAX_AUTOCOMPLETIONS = 1500;
 
 let WebConsoleUtils = {
   /**
    * Convenience function to unwrap a wrapped object.
    *
    * @param aObject the object to unwrap.
@@ -1443,17 +1441,17 @@ ConsoleAPIListener.prototype =
    */
   observe: function CAL_observe(aMessage, aTopic)
   {
     if (!this.owner) {
       return;
     }
 
     let apiMessage = aMessage.wrappedJSObject;
-    if (this.window && CONSOLE_WORKER_IDS.indexOf(apiMessage.innerID) == -1) {
+    if (this.window) {
       let msgWindow = Services.wm.getCurrentInnerWindowWithId(apiMessage.innerID);
       if (!msgWindow || !this.layoutHelpers.isIncludedInTopLevelWindow(msgWindow)) {
         // Not the same window!
         return;
       }
     }
     if (this.consoleID && apiMessage.consoleID != this.consoleID) {
       return;
@@ -1483,31 +1481,20 @@ ConsoleAPIListener.prototype =
       messages = ConsoleAPIStorage.getEvents();
     } else {
       let ids = WebConsoleUtils.getInnerWindowIDsForFrames(this.window);
       ids.forEach((id) => {
         messages = messages.concat(ConsoleAPIStorage.getEvents(id));
       });
     }
 
-    CONSOLE_WORKER_IDS.forEach((id) => {
-      messages = messages.concat(ConsoleAPIStorage.getEvents(id));
-    });
-
     if (this.consoleID) {
       messages = messages.filter((m) => m.consoleID == this.consoleID);
     }
 
-    // ConsoleAPIStorage gives up messages sorted, but we ask for different
-    // blocks of events and we must sort them again in order to show them in the
-    // proper order.
-    messages = messages.sort(function(a, b) {
-      return a.timeStamp - b.timeStamp;
-    });
-
     if (aIncludePrivate) {
       return messages;
     }
 
     return messages.filter((m) => !m.private);
   },
 
   /**