Bug 1317423 - Remove unused declarations after move;r=jlast draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 16 Nov 2016 10:28:26 -0800
changeset 440039 b719577b14fe03f3ef83d9fce251a0a466af35b5
parent 440038 f33bd114d29f96d28f57e2a225c7fe238a15ed15
child 537299 4cfff05d2a8cb219bdd0155e4d39c6f904b97f32
push id36146
push userbgrinstead@mozilla.com
push dateWed, 16 Nov 2016 23:33:09 +0000
reviewersjlast
bugs1317423
milestone53.0a1
Bug 1317423 - Remove unused declarations after move;r=jlast MozReview-Commit-ID: AVVjRpMEENm
devtools/client/webconsole/webconsole-connection-proxy.js
devtools/client/webconsole/webconsole.js
--- a/devtools/client/webconsole/webconsole-connection-proxy.js
+++ b/devtools/client/webconsole/webconsole-connection-proxy.js
@@ -3,199 +3,28 @@
 /* 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} =
+const {Utils: WebConsoleUtils} =
   require("devtools/client/webconsole/utils");
-const { getSourceNames } = require("devtools/client/shared/source-utils");
 const BrowserLoaderModule = {};
 Cu.import("resource://devtools/client/shared/browser-loader.js", BrowserLoaderModule);
 
 const promise = require("promise");
 const Services = require("Services");
-const ErrorDocs = require("devtools/server/actors/errordocs");
-const Telemetry = require("devtools/client/shared/telemetry");
 
-loader.lazyServiceGetter(this, "clipboardHelper",
-                         "@mozilla.org/widget/clipboardhelper;1",
-                         "nsIClipboardHelper");
-loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
-loader.lazyRequireGetter(this, "AutocompletePopup", "devtools/client/shared/autocomplete-popup", true);
-loader.lazyRequireGetter(this, "ToolSidebar", "devtools/client/framework/sidebar", true);
-loader.lazyRequireGetter(this, "ConsoleOutput", "devtools/client/webconsole/console-output", true);
-loader.lazyRequireGetter(this, "Messages", "devtools/client/webconsole/console-output", true);
-loader.lazyRequireGetter(this, "EnvironmentClient", "devtools/shared/client/main", true);
-loader.lazyRequireGetter(this, "ObjectClient", "devtools/shared/client/main", true);
-loader.lazyRequireGetter(this, "system", "devtools/shared/system");
-loader.lazyRequireGetter(this, "JSTerm", "devtools/client/webconsole/jsterm", true);
-loader.lazyRequireGetter(this, "gSequenceId", "devtools/client/webconsole/jsterm", true);
-loader.lazyImporter(this, "VariablesView", "resource://devtools/client/shared/widgets/VariablesView.jsm");
-loader.lazyImporter(this, "VariablesViewController", "resource://devtools/client/shared/widgets/VariablesViewController.jsm");
-loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
-loader.lazyRequireGetter(this, "KeyShortcuts", "devtools/client/shared/key-shortcuts", true);
-loader.lazyRequireGetter(this, "ZoomKeys", "devtools/client/shared/zoom-keys");
-
-const {PluralForm} = require("devtools/shared/plural-form");
 const STRINGS_URI = "devtools/client/locales/webconsole.properties";
 var l10n = new WebConsoleUtils.L10n(STRINGS_URI);
 
-const XHTML_NS = "http://www.w3.org/1999/xhtml";
-
-const MIXED_CONTENT_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Mixed_content";
-
-const IGNORED_SOURCE_URLS = ["debugger eval code"];
-
-// The amount of time in milliseconds that we wait before performing a live
-// search.
-const SEARCH_DELAY = 200;
-
-// The number of lines that are displayed in the console output by default, for
-// each category. The user can change this number by adjusting the hidden
-// "devtools.hud.loglimit.{network,cssparser,exception,console}" preferences.
-const DEFAULT_LOG_LIMIT = 1000;
-
-// The various categories of messages. We start numbering at zero so we can
-// use these as indexes into the MESSAGE_PREFERENCE_KEYS matrix below.
-const CATEGORY_NETWORK = 0;
-const CATEGORY_CSS = 1;
-const CATEGORY_JS = 2;
-const CATEGORY_WEBDEV = 3;
-// always on
-const CATEGORY_INPUT = 4;
-// always on
-const CATEGORY_OUTPUT = 5;
-const CATEGORY_SECURITY = 6;
-const CATEGORY_SERVER = 7;
-
-// The possible message severities. As before, we start at zero so we can use
-// these as indexes into MESSAGE_PREFERENCE_KEYS.
-const SEVERITY_ERROR = 0;
-const SEVERITY_WARNING = 1;
-const SEVERITY_INFO = 2;
-const SEVERITY_LOG = 3;
-
-// The fragment of a CSS class name that identifies each category.
-const CATEGORY_CLASS_FRAGMENTS = [
-  "network",
-  "cssparser",
-  "exception",
-  "console",
-  "input",
-  "output",
-  "security",
-  "server",
-];
-
-// The fragment of a CSS class name that identifies each severity.
-const SEVERITY_CLASS_FRAGMENTS = [
-  "error",
-  "warn",
-  "info",
-  "log",
-];
-
-// The preference keys to use for each category/severity combination, indexed
-// first by category (rows) and then by severity (columns) in the following
-// order:
-//
-// [ Error, Warning, Info, Log ]
-//
-// Most of these rather idiosyncratic names are historical and predate the
-// division of message type into "category" and "severity".
-const MESSAGE_PREFERENCE_KEYS = [
-  // Network
-  [ "network", "netwarn", "netxhr", "networkinfo", ],
-  // CSS
-  [ "csserror", "cssparser", null, "csslog", ],
-  // JS
-  [ "exception", "jswarn", null, "jslog", ],
-  // Web Developer
-  [ "error", "warn", "info", "log", ],
-  // Input
-  [ null, null, null, null, ],
-  // Output
-  [ null, null, null, null, ],
-  // Security
-  [ "secerror", "secwarn", null, null, ],
-  // Server Logging
-  [ "servererror", "serverwarn", "serverinfo", "serverlog", ],
-];
-
-// A mapping from the console API log event levels to the Web Console
-// severities.
-const LEVELS = {
-  error: SEVERITY_ERROR,
-  exception: SEVERITY_ERROR,
-  assert: SEVERITY_ERROR,
-  warn: SEVERITY_WARNING,
-  info: SEVERITY_INFO,
-  log: SEVERITY_LOG,
-  clear: SEVERITY_LOG,
-  trace: SEVERITY_LOG,
-  table: SEVERITY_LOG,
-  debug: SEVERITY_LOG,
-  dir: SEVERITY_LOG,
-  dirxml: SEVERITY_LOG,
-  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;
-
-// The indent of a console group in pixels.
-const GROUP_INDENT = 12;
-
-// The number of messages to display in a single display update. If we display
-// too many messages at once we slow down the Firefox UI too much.
-const MESSAGES_IN_INTERVAL = DEFAULT_LOG_LIMIT;
-
-// The delay (in milliseconds) between display updates - tells how often we
-// should *try* to push new messages to screen. This value is optimistic,
-// updates won't always happen. Keep this low so the Web Console output feels
-// live.
-const OUTPUT_INTERVAL = 20;
-
-// The maximum amount of time (in milliseconds) that can be spent doing cleanup
-// inside of the flush output callback.  If things don't get cleaned up in this
-// time, then it will start again the next time it is called.
-const MAX_CLEANUP_TIME = 10;
-
-// When the output queue has more than MESSAGES_IN_INTERVAL items we throttle
-// output updates to this number of milliseconds. So during a lot of output we
-// update every N milliseconds given here.
-const THROTTLE_UPDATES = 1000;
-
-// The preference prefix for all of the Web Console filters.
-const FILTER_PREFS_PREFIX = "devtools.webconsole.filter.";
-
-// The minimum font size.
-const MIN_FONT_SIZE = 10;
-
 const PREF_CONNECTION_TIMEOUT = "devtools.debugger.remote-timeout";
-const PREF_PERSISTLOG = "devtools.webconsole.persistlog";
-const PREF_MESSAGE_TIMESTAMP = "devtools.webconsole.timestampMessages";
-const PREF_NEW_FRONTEND_ENABLED = "devtools.webconsole.new-frontend-enabled";
-
 // Web Console connection proxy
 
 /**
  * The WebConsoleConnectionProxy handles the connection between the Web Console
  * and the application we connect to through the remote debug protocol.
  *
  * @constructor
  * @param object webConsoleFrame
--- a/devtools/client/webconsole/webconsole.js
+++ b/devtools/client/webconsole/webconsole.js
@@ -11,25 +11,22 @@ const {Cc, Ci, Cu} = require("chrome");
 const {Utils: WebConsoleUtils, CONSOLE_WORKER_IDS} =
   require("devtools/client/webconsole/utils");
 const { getSourceNames } = require("devtools/client/shared/source-utils");
 const BrowserLoaderModule = {};
 Cu.import("resource://devtools/client/shared/browser-loader.js", BrowserLoaderModule);
 
 const promise = require("promise");
 const Services = require("Services");
-const ErrorDocs = require("devtools/server/actors/errordocs");
 const Telemetry = require("devtools/client/shared/telemetry");
 
 loader.lazyServiceGetter(this, "clipboardHelper",
                          "@mozilla.org/widget/clipboardhelper;1",
                          "nsIClipboardHelper");
 loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
-loader.lazyRequireGetter(this, "AutocompletePopup", "devtools/client/shared/autocomplete-popup", true);
-loader.lazyRequireGetter(this, "ToolSidebar", "devtools/client/framework/sidebar", true);
 loader.lazyRequireGetter(this, "ConsoleOutput", "devtools/client/webconsole/console-output", true);
 loader.lazyRequireGetter(this, "Messages", "devtools/client/webconsole/console-output", true);
 loader.lazyRequireGetter(this, "EnvironmentClient", "devtools/shared/client/main", true);
 loader.lazyRequireGetter(this, "ObjectClient", "devtools/shared/client/main", true);
 loader.lazyRequireGetter(this, "system", "devtools/shared/system");
 loader.lazyRequireGetter(this, "JSTerm", "devtools/client/webconsole/jsterm", true);
 loader.lazyRequireGetter(this, "gSequenceId", "devtools/client/webconsole/jsterm", true);
 loader.lazyImporter(this, "VariablesView", "resource://devtools/client/shared/widgets/VariablesView.jsm");
@@ -179,20 +176,16 @@ const MAX_CLEANUP_TIME = 10;
 // When the output queue has more than MESSAGES_IN_INTERVAL items we throttle
 // output updates to this number of milliseconds. So during a lot of output we
 // update every N milliseconds given here.
 const THROTTLE_UPDATES = 1000;
 
 // The preference prefix for all of the Web Console filters.
 const FILTER_PREFS_PREFIX = "devtools.webconsole.filter.";
 
-// The minimum font size.
-const MIN_FONT_SIZE = 10;
-
-const PREF_CONNECTION_TIMEOUT = "devtools.debugger.remote-timeout";
 const PREF_PERSISTLOG = "devtools.webconsole.persistlog";
 const PREF_MESSAGE_TIMESTAMP = "devtools.webconsole.timestampMessages";
 const PREF_NEW_FRONTEND_ENABLED = "devtools.webconsole.new-frontend-enabled";
 
 /**
  * A WebConsoleFrame instance is an interactive console initialized *per target*
  * that displays console log data as well as provides an interactive terminal to
  * manipulate the target's document content.