Bug 1255799 - make devtools/client/webconsole eslint-clean; r=odvarko
authorTom Tromey <tom@tromey.com>
Wed, 16 Mar 2016 08:16:00 +0100
changeset 289138 fa585cc009027eca4483d18dfe7826627cc169fe
parent 289137 77258bd00fa310a72fc0de17c9b51cf9a2f96fd2
child 289139 932af0390914a9f373fd42c299dc2f558f6ced4c
push id30098
push usercbook@mozilla.com
push dateFri, 18 Mar 2016 14:32:34 +0000
treeherderautoland@3d37c7e5b8dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersodvarko
bugs1255799
milestone48.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 1255799 - make devtools/client/webconsole eslint-clean; r=odvarko MozReview-Commit-ID: AnaXFFHlNLM
.eslintignore
devtools/shared/webconsole/client.js
devtools/shared/webconsole/js-property-provider.js
devtools/shared/webconsole/network-helper.js
devtools/shared/webconsole/network-monitor.js
devtools/shared/webconsole/server-logger-monitor.js
devtools/shared/webconsole/server-logger.js
devtools/shared/webconsole/utils.js
devtools/shared/webconsole/worker-utils.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -87,30 +87,49 @@ devtools/client/framework/**
 # included in the ignore list.
 devtools/client/inspector/computed/**
 devtools/client/inspector/fonts/**
 devtools/client/inspector/shared/test/**
 devtools/client/inspector/test/**
 devtools/client/inspector/*.js
 devtools/client/jsonview/**
 devtools/client/memory/**
-devtools/client/netmonitor/**
+devtools/client/netmonitor/test/**
+devtools/client/netmonitor/har/test/**
 devtools/client/performance/**
 devtools/client/projecteditor/**
 devtools/client/promisedebugger/**
 devtools/client/responsivedesign/**
 devtools/client/scratchpad/**
 devtools/client/shadereditor/**
 devtools/client/shared/**
 devtools/client/sourceeditor/**
 devtools/client/webaudioeditor/**
 devtools/client/webconsole/**
 devtools/client/webide/**
 devtools/server/**
-devtools/shared/**
+devtools/shared/*.js
+devtools/shared/*.jsm
+devtools/shared/apps/**
+devtools/shared/client/**
+devtools/shared/discovery/**
+devtools/shared/gcli/**
+devtools/shared/heapsnapshot/**
+devtools/shared/inspector/**
+devtools/shared/layout/**
+devtools/shared/locales/**
+devtools/shared/performance/**
+devtools/shared/qrcode/**
+devtools/shared/security/**
+devtools/shared/shims/**
+devtools/shared/tests/**
+devtools/shared/touch/**
+devtools/shared/transport/**
+devtools/shared/webconsole/test/**
+devtools/shared/worker/**
 
 # Ignore devtools pre-processed files
 devtools/client/framework/toolbox-process-window.js
 devtools/client/performance/system.js
 devtools/client/webide/webide-prefs.js
 devtools/client/preferences/**
 
 # Ignore devtools third-party libs
--- a/devtools/shared/webconsole/client.js
+++ b/devtools/shared/webconsole/client.js
@@ -1,38 +1,36 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* 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 DevToolsUtils = require("devtools/shared/DevToolsUtils");
 const EventEmitter = require("devtools/shared/event-emitter");
 const promise = require("promise");
 const {LongStringClient} = require("devtools/shared/client/main");
 
 /**
  * A WebConsoleClient is used as a front end for the WebConsoleActor that is
  * created on the server, hiding implementation details.
  *
- * @param object aDebuggerClient
+ * @param object debuggerClient
  *        The DebuggerClient instance we live for.
- * @param object aResponse
+ * @param object response
  *        The response packet received from the "startListeners" request sent to
  *        the WebConsoleActor.
  */
-function WebConsoleClient(aDebuggerClient, aResponse)
-{
-  this._actor = aResponse.from;
-  this._client = aDebuggerClient;
+function WebConsoleClient(debuggerClient, response) {
+  this._actor = response.from;
+  this._client = debuggerClient;
   this._longStrings = {};
-  this.traits = aResponse.traits || {};
+  this.traits = response.traits || {};
   this.events = [];
   this._networkRequests = new Map();
 
   this.pendingEvaluationResults = new Map();
   this.onEvaluationResult = this.onEvaluationResult.bind(this);
   this.onNetworkEvent = this._onNetworkEvent.bind(this);
   this.onNetworkEventUpdate = this._onNetworkEventUpdate.bind(this);
 
@@ -67,30 +65,31 @@ WebConsoleClient.prototype = {
   removeNetworkRequest(actorId) {
     this._networkRequests.delete(actorId);
   },
 
   getNetworkEvents() {
     return this._networkRequests.values();
   },
 
-  get actor() { return this._actor; },
+  get actor() {
+    return this._actor;
+  },
 
   /**
    * The "networkEvent" message type handler. We redirect any message to
    * the UI for displaying.
    *
    * @private
    * @param string type
    *        Message type.
    * @param object packet
    *        The message received from the server.
    */
-  _onNetworkEvent: function (type, packet)
-  {
+  _onNetworkEvent: function(type, packet) {
     if (packet.from == this._actor) {
       let actor = packet.eventActor;
       let networkInfo = {
         _type: "NetworkEvent",
         timeStamp: actor.timeStamp,
         node: null,
         actor: actor.actor,
         discardRequestBody: true,
@@ -98,17 +97,18 @@ WebConsoleClient.prototype = {
         startedDateTime: actor.startedDateTime,
         request: {
           url: actor.url,
           method: actor.method,
         },
         isXHR: actor.isXHR,
         response: {},
         timings: {},
-        updates: [], // track the list of network event updates
+        // track the list of network event updates
+        updates: [],
         private: actor.private,
         fromCache: actor.fromCache,
         fromServiceWorker: actor.fromServiceWorker
       };
       this._networkRequests.set(actor.actor, networkInfo);
 
       this.emit("networkEvent", networkInfo);
     }
@@ -119,18 +119,17 @@ WebConsoleClient.prototype = {
    * the UI for displaying.
    *
    * @private
    * @param string type
    *        Message type.
    * @param object packet
    *        The message received from the server.
    */
-  _onNetworkEventUpdate: function (type, packet)
-  {
+  _onNetworkEventUpdate: function(type, packet) {
     let networkInfo = this.getNetworkRequest(packet.from);
     if (!networkInfo) {
       return;
     }
 
     networkInfo.updates.push(packet.updateType);
 
     switch (packet.updateType) {
@@ -174,55 +173,52 @@ WebConsoleClient.prototype = {
 
   /**
    * Retrieve the cached messages from the server.
    *
    * @see this.CACHED_MESSAGES
    * @param array types
    *        The array of message types you want from the server. See
    *        this.CACHED_MESSAGES for known types.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  getCachedMessages: function WCC_getCachedMessages(types, aOnResponse)
-  {
+  getCachedMessages: function(types, onResponse) {
     let packet = {
       to: this._actor,
       type: "getCachedMessages",
       messageTypes: types,
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Inspect the properties of an object.
    *
-   * @param string aActor
+   * @param string actor
    *        The WebConsoleObjectActor ID to send the request to.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  inspectObjectProperties:
-  function WCC_inspectObjectProperties(aActor, aOnResponse)
-  {
+  inspectObjectProperties: function(actor, onResponse) {
     let packet = {
-      to: aActor,
+      to: actor,
       type: "inspectProperties",
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Evaluate a JavaScript expression.
    *
-   * @param string aString
+   * @param string string
    *        The code you want to evaluate.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
-   * @param object [aOptions={}]
+   * @param object [options={}]
    *        Options for evaluation:
    *
    *        - bindObjectActor: an ObjectActor ID. The OA holds a reference to
    *        a Debugger.Object that wraps a content object. This option allows
    *        you to bind |_self| to the D.O of the given OA, during string
    *        evaluation.
    *
    *        See: Debugger.Object.executeInGlobalWithBindings() for information
@@ -236,398 +232,383 @@ WebConsoleClient.prototype = {
    *
    *        - frameActor: a FrameActor ID. The FA holds a reference to
    *        a Debugger.Frame. This option allows you to evaluate the string in
    *        the frame of the given FA.
    *
    *        - url: the url to evaluate the script as. Defaults to
    *        "debugger eval code".
    *
-   *        - selectedNodeActor: the NodeActor ID of the current selection in the
-   *        Inspector, if such a selection exists. This is used by helper functions
-   *        that can reference the currently selected node in the Inspector, like
-   *        $0.
+   *        - selectedNodeActor: the NodeActor ID of the current
+   *        selection in the Inspector, if such a selection
+   *        exists. This is used by helper functions that can
+   *        reference the currently selected node in the Inspector,
+   *        like $0.
    */
-  evaluateJS: function WCC_evaluateJS(aString, aOnResponse, aOptions = {})
-  {
+  evaluateJS: function(string, onResponse, options = {}) {
     let packet = {
       to: this._actor,
       type: "evaluateJS",
-      text: aString,
-      bindObjectActor: aOptions.bindObjectActor,
-      frameActor: aOptions.frameActor,
-      url: aOptions.url,
-      selectedNodeActor: aOptions.selectedNodeActor,
-      selectedObjectActor: aOptions.selectedObjectActor,
+      text: string,
+      bindObjectActor: options.bindObjectActor,
+      frameActor: options.frameActor,
+      url: options.url,
+      selectedNodeActor: options.selectedNodeActor,
+      selectedObjectActor: options.selectedObjectActor,
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Evaluate a JavaScript expression asynchronously.
    * See evaluateJS for parameter and response information.
    */
-  evaluateJSAsync: function(aString, aOnResponse, aOptions = {})
-  {
+  evaluateJSAsync: function(string, onResponse, options = {}) {
     // Pre-37 servers don't support async evaluation.
     if (!this.traits.evaluateJSAsync) {
-      this.evaluateJS(aString, aOnResponse, aOptions);
+      this.evaluateJS(string, onResponse, options);
       return;
     }
 
     let packet = {
       to: this._actor,
       type: "evaluateJSAsync",
-      text: aString,
-      bindObjectActor: aOptions.bindObjectActor,
-      frameActor: aOptions.frameActor,
-      url: aOptions.url,
-      selectedNodeActor: aOptions.selectedNodeActor,
-      selectedObjectActor: aOptions.selectedObjectActor,
+      text: string,
+      bindObjectActor: options.bindObjectActor,
+      frameActor: options.frameActor,
+      url: options.url,
+      selectedNodeActor: options.selectedNodeActor,
+      selectedObjectActor: options.selectedObjectActor,
     };
 
     this._client.request(packet, response => {
       // Null check this in case the client has been detached while waiting
       // for a response.
       if (this.pendingEvaluationResults) {
-        this.pendingEvaluationResults.set(response.resultID, aOnResponse);
+        this.pendingEvaluationResults.set(response.resultID, onResponse);
       }
     });
   },
 
   /**
    * Handler for the actors's unsolicited evaluationResult packet.
    */
-  onEvaluationResult: function(aNotification, aPacket) {
+  onEvaluationResult: function(notification, packet) {
     // The client on the main thread can receive notification packets from
     // multiple webconsole actors: the one on the main thread and the ones
     // on worker threads.  So make sure we should be handling this request.
-    if (aPacket.from !== this._actor) {
+    if (packet.from !== this._actor) {
       return;
     }
 
     // Find the associated callback based on this ID, and fire it.
     // In a sync evaluation, this would have already been called in
     // direct response to the client.request function.
-    let onResponse = this.pendingEvaluationResults.get(aPacket.resultID);
+    let onResponse = this.pendingEvaluationResults.get(packet.resultID);
     if (onResponse) {
-      onResponse(aPacket);
-      this.pendingEvaluationResults.delete(aPacket.resultID);
+      onResponse(packet);
+      this.pendingEvaluationResults.delete(packet.resultID);
     } else {
       DevToolsUtils.reportException("onEvaluationResult",
-        "No response handler for an evaluateJSAsync result (resultID: " + aPacket.resultID + ")");
+        "No response handler for an evaluateJSAsync result (resultID: " +
+                                    packet.resultID + ")");
     }
   },
 
   /**
    * Autocomplete a JavaScript expression.
    *
-   * @param string aString
+   * @param string string
    *        The code you want to autocomplete.
-   * @param number aCursor
+   * @param number cursor
    *        Cursor location inside the string. Index starts from 0.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
-   * @param string aFrameActor
+   * @param string frameActor
    *        The id of the frame actor that made the call.
    */
-  autocomplete: function WCC_autocomplete(aString, aCursor, aOnResponse, aFrameActor)
-  {
+  autocomplete: function(string, cursor, onResponse, frameActor) {
     let packet = {
       to: this._actor,
       type: "autocomplete",
-      text: aString,
-      cursor: aCursor,
-      frameActor: aFrameActor,
+      text: string,
+      cursor: cursor,
+      frameActor: frameActor,
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Clear the cache of messages (page errors and console API calls).
    */
-  clearMessagesCache: function WCC_clearMessagesCache()
-  {
+  clearMessagesCache: function() {
     let packet = {
       to: this._actor,
       type: "clearMessagesCache",
     };
     this._client.request(packet);
   },
 
   /**
    * Get Web Console-related preferences on the server.
    *
-   * @param array aPreferences
+   * @param array preferences
    *        An array with the preferences you want to retrieve.
-   * @param function [aOnResponse]
+   * @param function [onResponse]
    *        Optional function to invoke when the response is received.
    */
-  getPreferences: function WCC_getPreferences(aPreferences, aOnResponse)
-  {
+  getPreferences: function(preferences, onResponse) {
     let packet = {
       to: this._actor,
       type: "getPreferences",
-      preferences: aPreferences,
+      preferences: preferences,
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Set Web Console-related preferences on the server.
    *
-   * @param object aPreferences
+   * @param object preferences
    *        An object with the preferences you want to change.
-   * @param function [aOnResponse]
+   * @param function [onResponse]
    *        Optional function to invoke when the response is received.
    */
-  setPreferences: function WCC_setPreferences(aPreferences, aOnResponse)
-  {
+  setPreferences: function(preferences, onResponse) {
     let packet = {
       to: this._actor,
       type: "setPreferences",
-      preferences: aPreferences,
+      preferences: preferences,
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Retrieve the request headers from the given NetworkEventActor.
    *
-   * @param string aActor
+   * @param string actor
    *        The NetworkEventActor ID.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  getRequestHeaders: function WCC_getRequestHeaders(aActor, aOnResponse)
-  {
+  getRequestHeaders: function(actor, onResponse) {
     let packet = {
-      to: aActor,
+      to: actor,
       type: "getRequestHeaders",
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Retrieve the request cookies from the given NetworkEventActor.
    *
-   * @param string aActor
+   * @param string actor
    *        The NetworkEventActor ID.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  getRequestCookies: function WCC_getRequestCookies(aActor, aOnResponse)
-  {
+  getRequestCookies: function(actor, onResponse) {
     let packet = {
-      to: aActor,
+      to: actor,
       type: "getRequestCookies",
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Retrieve the request post data from the given NetworkEventActor.
    *
-   * @param string aActor
+   * @param string actor
    *        The NetworkEventActor ID.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  getRequestPostData: function WCC_getRequestPostData(aActor, aOnResponse)
-  {
+  getRequestPostData: function(actor, onResponse) {
     let packet = {
-      to: aActor,
+      to: actor,
       type: "getRequestPostData",
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Retrieve the response headers from the given NetworkEventActor.
    *
-   * @param string aActor
+   * @param string actor
    *        The NetworkEventActor ID.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  getResponseHeaders: function WCC_getResponseHeaders(aActor, aOnResponse)
-  {
+  getResponseHeaders: function(actor, onResponse) {
     let packet = {
-      to: aActor,
+      to: actor,
       type: "getResponseHeaders",
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Retrieve the response cookies from the given NetworkEventActor.
    *
-   * @param string aActor
+   * @param string actor
    *        The NetworkEventActor ID.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  getResponseCookies: function WCC_getResponseCookies(aActor, aOnResponse)
-  {
+  getResponseCookies: function(actor, onResponse) {
     let packet = {
-      to: aActor,
+      to: actor,
       type: "getResponseCookies",
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Retrieve the response content from the given NetworkEventActor.
    *
-   * @param string aActor
+   * @param string actor
    *        The NetworkEventActor ID.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  getResponseContent: function WCC_getResponseContent(aActor, aOnResponse)
-  {
+  getResponseContent: function(actor, onResponse) {
     let packet = {
-      to: aActor,
+      to: actor,
       type: "getResponseContent",
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Retrieve the timing information for the given NetworkEventActor.
    *
-   * @param string aActor
+   * @param string actor
    *        The NetworkEventActor ID.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  getEventTimings: function WCC_getEventTimings(aActor, aOnResponse)
-  {
+  getEventTimings: function(actor, onResponse) {
     let packet = {
-      to: aActor,
+      to: actor,
       type: "getEventTimings",
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Retrieve the security information for the given NetworkEventActor.
    *
-   * @param string aActor
+   * @param string actor
    *        The NetworkEventActor ID.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  getSecurityInfo: function WCC_getSecurityInfo(aActor, aOnResponse)
-  {
+  getSecurityInfo: function(actor, onResponse) {
     let packet = {
-      to: aActor,
+      to: actor,
       type: "getSecurityInfo",
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Send a HTTP request with the given data.
    *
-   * @param string aData
+   * @param string data
    *        The details of the HTTP request.
-   * @param function aOnResponse
+   * @param function onResponse
    *        The function invoked when the response is received.
    */
-  sendHTTPRequest: function WCC_sendHTTPRequest(aData, aOnResponse) {
+  sendHTTPRequest: function(data, onResponse) {
     let packet = {
       to: this._actor,
       type: "sendHTTPRequest",
-      request: aData
+      request: data
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Start the given Web Console listeners.
    *
    * @see this.LISTENERS
-   * @param array aListeners
+   * @param array listeners
    *        Array of listeners you want to start. See this.LISTENERS for
    *        known listeners.
-   * @param function aOnResponse
+   * @param function onResponse
    *        Function to invoke when the server response is received.
    */
-  startListeners: function WCC_startListeners(aListeners, aOnResponse)
-  {
+  startListeners: function(listeners, onResponse) {
     let packet = {
       to: this._actor,
       type: "startListeners",
-      listeners: aListeners,
+      listeners: listeners,
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Stop the given Web Console listeners.
    *
    * @see this.LISTENERS
-   * @param array aListeners
+   * @param array listeners
    *        Array of listeners you want to stop. See this.LISTENERS for
    *        known listeners.
-   * @param function aOnResponse
+   * @param function onResponse
    *        Function to invoke when the server response is received.
    */
-  stopListeners: function WCC_stopListeners(aListeners, aOnResponse)
-  {
+  stopListeners: function(listeners, onResponse) {
     let packet = {
       to: this._actor,
       type: "stopListeners",
-      listeners: aListeners,
+      listeners: listeners,
     };
-    this._client.request(packet, aOnResponse);
+    this._client.request(packet, onResponse);
   },
 
   /**
    * Return an instance of LongStringClient for the given long string grip.
    *
-   * @param object aGrip
+   * @param object grip
    *        The long string grip returned by the protocol.
    * @return object
    *         The LongStringClient for the given long string grip.
    */
-  longString: function WCC_longString(aGrip)
-  {
-    if (aGrip.actor in this._longStrings) {
-      return this._longStrings[aGrip.actor];
+  longString: function(grip) {
+    if (grip.actor in this._longStrings) {
+      return this._longStrings[grip.actor];
     }
 
-    let client = new LongStringClient(this._client, aGrip);
-    this._longStrings[aGrip.actor] = client;
+    let client = new LongStringClient(this._client, grip);
+    this._longStrings[grip.actor] = client;
     return client;
   },
 
   /**
    * Close the WebConsoleClient. This stops all the listeners on the server and
    * detaches from the console actor.
    *
-   * @param function aOnResponse
+   * @param function onResponse
    *        Function to invoke when the server response is received.
    */
-  detach: function WCC_detach(aOnResponse)
-  {
+  detach: function(onResponse) {
     this._client.removeListener("evaluationResult", this.onEvaluationResult);
     this._client.removeListener("networkEvent", this.onNetworkEvent);
-    this._client.removeListener("networkEventUpdate", this.onNetworkEventUpdate);
-    this.stopListeners(null, aOnResponse);
+    this._client.removeListener("networkEventUpdate",
+                                this.onNetworkEventUpdate);
+    this.stopListeners(null, onResponse);
     this._longStrings = null;
     this._client = null;
     this.pendingEvaluationResults.clear();
     this.pendingEvaluationResults = null;
     this.clearNetworkRequests();
     this._networkRequests = null;
   },
 
-  clearNetworkRequests: function () {
+  clearNetworkRequests: function() {
     this._networkRequests.clear();
   },
 
   /**
    * Fetches the full text of a LongString.
    *
    * @param object | string stringGrip
    *        The long string grip containing the corresponding actor.
@@ -635,34 +616,35 @@ WebConsoleClient.prototype = {
    *        then a promise of the same string is simply returned.
    * @return object Promise
    *         A promise that is resolved when the full string contents
    *         are available, or rejected if something goes wrong.
    */
   getString: function(stringGrip) {
     // Make sure this is a long string.
     if (typeof stringGrip != "object" || stringGrip.type != "longString") {
-      return promise.resolve(stringGrip); // Go home string, you're drunk.
+      // Go home string, you're drunk.
+      return promise.resolve(stringGrip);
     }
 
     // Fetch the long string only once.
     if (stringGrip._fullText) {
       return stringGrip._fullText.promise;
     }
 
     let deferred = stringGrip._fullText = promise.defer();
-    let { actor, initial, length } = stringGrip;
+    let { initial, length } = stringGrip;
     let longStringClient = this.longString(stringGrip);
 
-    longStringClient.substring(initial.length, length, aResponse => {
-      if (aResponse.error) {
+    longStringClient.substring(initial.length, length, response => {
+      if (response.error) {
         DevToolsUtils.reportException("getString",
-            aResponse.error + ": " + aResponse.message);
+            response.error + ": " + response.message);
 
-        deferred.reject(aResponse);
+        deferred.reject(response);
         return;
       }
-      deferred.resolve(initial + aResponse.substring);
+      deferred.resolve(initial + response.substring);
     });
 
     return deferred.promise;
   }
 };
--- a/devtools/shared/webconsole/js-property-provider.js
+++ b/devtools/shared/webconsole/js-property-provider.js
@@ -1,17 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft= javascript ts=2 et sw=2 tw=80: */
 /* 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, components} = require("chrome");
 const DevToolsUtils = require("devtools/shared/DevToolsUtils");
 
 if (!isWorker) {
   loader.lazyImporter(this, "Parser", "resource://devtools/shared/Parser.jsm");
 }
 
 // Provide an easy way to bail out of even attempting an autocompletion
 // if an object has way too many properties. Protects against large objects
@@ -35,149 +34,139 @@ const OPEN_CLOSE_BODY = {
 function hasArrayIndex(str) {
   return /\[\d+\]$/.test(str);
 }
 
 /**
  * Analyses a given string to find the last statement that is interesting for
  * later completion.
  *
- * @param   string aStr
+ * @param   string str
  *          A string to analyse.
  *
  * @returns object
  *          If there was an error in the string detected, then a object like
  *
  *            { err: "ErrorMesssage" }
  *
  *          is returned, otherwise a object like
  *
  *            {
  *              state: STATE_NORMAL|STATE_QUOTE|STATE_DQUOTE,
  *              startPos: index of where the last statement begins
  *            }
  */
-function findCompletionBeginning(aStr)
-{
+function findCompletionBeginning(str) {
   let bodyStack = [];
 
   let state = STATE_NORMAL;
   let start = 0;
   let c;
-  for (let i = 0; i < aStr.length; i++) {
-    c = aStr[i];
+  for (let i = 0; i < str.length; i++) {
+    c = str[i];
 
     switch (state) {
       // Normal JS state.
       case STATE_NORMAL:
         if (c == '"') {
           state = STATE_DQUOTE;
-        }
-        else if (c == "'") {
+        } else if (c == "'") {
           state = STATE_QUOTE;
-        }
-        else if (c == ";") {
+        } else if (c == ";") {
           start = i + 1;
-        }
-        else if (c == " ") {
+        } else if (c == " ") {
           start = i + 1;
-        }
-        else if (OPEN_BODY.indexOf(c) != -1) {
+        } else if (OPEN_BODY.indexOf(c) != -1) {
           bodyStack.push({
             token: c,
             start: start
           });
           start = i + 1;
-        }
-        else if (CLOSE_BODY.indexOf(c) != -1) {
-          var last = bodyStack.pop();
+        } else if (CLOSE_BODY.indexOf(c) != -1) {
+          let last = bodyStack.pop();
           if (!last || OPEN_CLOSE_BODY[last.token] != c) {
             return {
               err: "syntax error"
             };
           }
           if (c == "}") {
             start = i + 1;
-          }
-          else {
+          } else {
             start = last.start;
           }
         }
         break;
 
       // Double quote state > " <
       case STATE_DQUOTE:
         if (c == "\\") {
           i++;
-        }
-        else if (c == "\n") {
+        } else if (c == "\n") {
           return {
             err: "unterminated string literal"
           };
-        }
-        else if (c == '"') {
+        } else if (c == '"') {
           state = STATE_NORMAL;
         }
         break;
 
       // Single quote state > ' <
       case STATE_QUOTE:
         if (c == "\\") {
           i++;
-        }
-        else if (c == "\n") {
+        } else if (c == "\n") {
           return {
             err: "unterminated string literal"
           };
-        }
-        else if (c == "'") {
+        } else if (c == "'") {
           state = STATE_NORMAL;
         }
         break;
     }
   }
 
   return {
     state: state,
     startPos: start
   };
 }
 
 /**
  * Provides a list of properties, that are possible matches based on the passed
  * Debugger.Environment/Debugger.Object and inputValue.
  *
- * @param object aDbgObject
- *        When the debugger is not paused this Debugger.Object wraps the scope for autocompletion.
+ * @param object dbgObject
+ *        When the debugger is not paused this Debugger.Object wraps
+ *        the scope for autocompletion.
  *        It is null if the debugger is paused.
  * @param object anEnvironment
- *        When the debugger is paused this Debugger.Environment is the scope for autocompletion.
+ *        When the debugger is paused this Debugger.Environment is the
+ *        scope for autocompletion.
  *        It is null if the debugger is not paused.
- * @param string aInputValue
+ * @param string inputValue
  *        Value that should be completed.
- * @param number [aCursor=aInputValue.length]
+ * @param number [cursor=inputValue.length]
  *        Optional offset in the input where the cursor is located. If this is
  *        omitted then the cursor is assumed to be at the end of the input
  *        value.
  * @returns null or object
  *          If no completion valued could be computed, null is returned,
  *          otherwise a object with the following form is returned:
  *            {
  *              matches: [ string, string, string ],
  *              matchProp: Last part of the inputValue that was used to find
  *                         the matches-strings.
  *            }
  */
-function JSPropertyProvider(aDbgObject, anEnvironment, aInputValue, aCursor)
-{
-  if (aCursor === undefined) {
-    aCursor = aInputValue.length;
+function JSPropertyProvider(dbgObject, anEnvironment, inputValue, cursor) {
+  if (cursor === undefined) {
+    cursor = inputValue.length;
   }
 
-  let inputValue = aInputValue.substring(0, aCursor);
+  inputValue = inputValue.substring(0, cursor);
 
   // Analyse the inputValue and find the beginning of the last part that
   // should be completed.
   let beginning = findCompletionBeginning(inputValue);
 
   // There was an error analysing the string.
   if (beginning.err) {
     return null;
@@ -220,58 +209,58 @@ function JSPropertyProvider(aDbgObject, 
         return getMatchedProps(String.prototype, matchProp);
       }
     }
   }
 
   // We are completing a variable / a property lookup.
   let properties = completionPart.split(".");
   let matchProp = properties.pop().trimLeft();
-  let obj = aDbgObject;
+  let obj = dbgObject;
 
   // The first property must be found in the environment of the paused debugger
   // or of the global lexical scope.
   let env = anEnvironment || obj.asEnvironment();
 
   if (properties.length === 0) {
     return getMatchedPropsInEnvironment(env, matchProp);
   }
 
   let firstProp = properties.shift().trim();
   if (firstProp === "this") {
     // Special case for 'this' - try to get the Object from the Environment.
     // No problem if it throws, we will just not autocomplete.
     try {
       obj = env.object;
-    } catch(e) { }
-  }
-  else if (hasArrayIndex(firstProp)) {
+    } catch (e) {
+      // Ignore.
+    }
+  } else if (hasArrayIndex(firstProp)) {
     obj = getArrayMemberProperty(null, env, firstProp);
   } else {
     obj = getVariableInEnvironment(env, firstProp);
   }
 
   if (!isObjectUsable(obj)) {
     return null;
   }
 
-  // We get the rest of the properties recursively starting from the Debugger.Object
-  // that wraps the first property
+  // We get the rest of the properties recursively starting from the
+  // Debugger.Object that wraps the first property
   for (let i = 0; i < properties.length; i++) {
     let prop = properties[i].trim();
     if (!prop) {
       return null;
     }
 
     if (hasArrayIndex(prop)) {
       // The property to autocomplete is a member of array. For example
       // list[i][j]..[n]. Traverse the array to get the actual element.
       obj = getArrayMemberProperty(obj, null, prop);
-    }
-    else {
+    } else {
       obj = DevToolsUtils.getProperty(obj, prop);
     }
 
     if (!isObjectUsable(obj)) {
       return null;
     }
   }
 
@@ -279,52 +268,50 @@ function JSPropertyProvider(aDbgObject, 
   if (typeof obj != "object") {
     return getMatchedProps(obj, matchProp);
   }
 
   return getMatchedPropsInDbgObject(obj, matchProp);
 }
 
 /**
- * Get the array member of aObj for the given aProp. For example, given
- * aProp='list[0][1]' the element at [0][1] of aObj.list is returned.
+ * Get the array member of obj for the given prop. For example, given
+ * prop='list[0][1]' the element at [0][1] of obj.list is returned.
  *
- * @param object aObj
- *        The object to operate on. Should be null if aEnv is passed.
- * @param object aEnv
- *        The Environment to operate in. Should be null if aObj is passed.
- * @param string aProp
+ * @param object obj
+ *        The object to operate on. Should be null if env is passed.
+ * @param object env
+ *        The Environment to operate in. Should be null if obj is passed.
+ * @param string prop
  *        The property to return.
  * @return null or Object
  *         Returns null if the property couldn't be located. Otherwise the array
- *         member identified by aProp.
+ *         member identified by prop.
  */
-function getArrayMemberProperty(aObj, aEnv, aProp)
-{
+function getArrayMemberProperty(obj, env, prop) {
   // First get the array.
-  let obj = aObj;
-  let propWithoutIndices = aProp.substr(0, aProp.indexOf("["));
+  let propWithoutIndices = prop.substr(0, prop.indexOf("["));
 
-  if (aEnv) {
-    obj = getVariableInEnvironment(aEnv, propWithoutIndices);
+  if (env) {
+    obj = getVariableInEnvironment(env, propWithoutIndices);
   } else {
     obj = DevToolsUtils.getProperty(obj, propWithoutIndices);
   }
 
   if (!isObjectUsable(obj)) {
     return null;
   }
 
   // Then traverse the list of indices to get the actual element.
   let result;
   let arrayIndicesRegex = /\[[^\]]*\]/g;
-  while ((result = arrayIndicesRegex.exec(aProp)) !== null) {
+  while ((result = arrayIndicesRegex.exec(prop)) !== null) {
     let indexWithBrackets = result[0];
     let indexAsText = indexWithBrackets.substr(1, indexWithBrackets.length - 2);
-    let index = parseInt(indexAsText);
+    let index = parseInt(indexAsText, 10);
 
     if (isNaN(index)) {
       return null;
     }
 
     obj = DevToolsUtils.getProperty(obj, index);
 
     if (!isObjectUsable(obj)) {
@@ -333,234 +320,219 @@ function getArrayMemberProperty(aObj, aE
   }
 
   return obj;
 }
 
 /**
  * Check if the given Debugger.Object can be used for autocomplete.
  *
- * @param Debugger.Object aObject
+ * @param Debugger.Object object
  *        The Debugger.Object to check.
  * @return boolean
  *         True if further inspection into the object is possible, or false
  *         otherwise.
  */
-function isObjectUsable(aObject)
-{
-  if (aObject == null) {
+function isObjectUsable(object) {
+  if (object == null) {
     return false;
   }
 
-  if (typeof aObject == "object" && aObject.class == "DeadObject") {
+  if (typeof object == "object" && object.class == "DeadObject") {
     return false;
   }
 
   return true;
 }
 
 /**
- * @see getExactMatch_impl()
+ * @see getExactMatchImpl()
  */
-function getVariableInEnvironment(anEnvironment, aName)
-{
-  return getExactMatch_impl(anEnvironment, aName, DebuggerEnvironmentSupport);
+function getVariableInEnvironment(anEnvironment, name) {
+  return getExactMatchImpl(anEnvironment, name, DebuggerEnvironmentSupport);
 }
 
 /**
- * @see getMatchedProps_impl()
+ * @see getMatchedPropsImpl()
  */
-function getMatchedPropsInEnvironment(anEnvironment, aMatch)
-{
-  return getMatchedProps_impl(anEnvironment, aMatch, DebuggerEnvironmentSupport);
+function getMatchedPropsInEnvironment(anEnvironment, match) {
+  return getMatchedPropsImpl(anEnvironment, match, DebuggerEnvironmentSupport);
 }
 
 /**
- * @see getMatchedProps_impl()
+ * @see getMatchedPropsImpl()
  */
-function getMatchedPropsInDbgObject(aDbgObject, aMatch)
-{
-  return getMatchedProps_impl(aDbgObject, aMatch, DebuggerObjectSupport);
+function getMatchedPropsInDbgObject(dbgObject, match) {
+  return getMatchedPropsImpl(dbgObject, match, DebuggerObjectSupport);
 }
 
 /**
- * @see getMatchedProps_impl()
+ * @see getMatchedPropsImpl()
  */
-function getMatchedProps(aObj, aMatch)
-{
-  if (typeof aObj != "object") {
-    aObj = aObj.constructor.prototype;
+function getMatchedProps(obj, match) {
+  if (typeof obj != "object") {
+    obj = obj.constructor.prototype;
   }
-  return getMatchedProps_impl(aObj, aMatch, JSObjectSupport);
+  return getMatchedPropsImpl(obj, match, JSObjectSupport);
 }
 
 /**
  * Get all properties in the given object (and its parent prototype chain) that
  * match a given prefix.
  *
- * @param mixed aObj
+ * @param mixed obj
  *        Object whose properties we want to filter.
- * @param string aMatch
+ * @param string match
  *        Filter for properties that match this string.
  * @return object
  *         Object that contains the matchProp and the list of names.
  */
-function getMatchedProps_impl(aObj, aMatch, {chainIterator, getProperties})
-{
+function getMatchedPropsImpl(obj, match, {chainIterator, getProperties}) {
   let matches = new Set();
   let numProps = 0;
 
   // We need to go up the prototype chain.
-  let iter = chainIterator(aObj);
-  for (let obj of iter) {
+  let iter = chainIterator(obj);
+  for (obj of iter) {
     let props = getProperties(obj);
     numProps += props.length;
 
     // If there are too many properties to event attempt autocompletion,
     // or if we have already added the max number, then stop looping
     // and return the partial set that has already been discovered.
     if (numProps >= MAX_AUTOCOMPLETE_ATTEMPTS ||
         matches.size >= MAX_AUTOCOMPLETIONS) {
       break;
     }
 
     for (let i = 0; i < props.length; i++) {
       let prop = props[i];
-      if (prop.indexOf(aMatch) != 0) {
+      if (prop.indexOf(match) != 0) {
         continue;
       }
-      if (prop.indexOf('-') > -1) {
+      if (prop.indexOf("-") > -1) {
         continue;
       }
       // If it is an array index, we can't take it.
       // This uses a trick: converting a string to a number yields NaN if
       // the operation failed, and NaN is not equal to itself.
       if (+prop != +prop) {
         matches.add(prop);
       }
 
       if (matches.size >= MAX_AUTOCOMPLETIONS) {
         break;
       }
     }
   }
 
   return {
-    matchProp: aMatch,
+    matchProp: match,
     matches: [...matches],
   };
 }
 
 /**
  * Returns a property value based on its name from the given object, by
  * recursively checking the object's prototype.
  *
- * @param object aObj
+ * @param object obj
  *        An object to look the property into.
- * @param string aName
+ * @param string name
  *        The property that is looked up.
  * @returns object|undefined
  *        A Debugger.Object if the property exists in the object's prototype
  *        chain, undefined otherwise.
  */
-function getExactMatch_impl(aObj, aName, {chainIterator, getProperty})
-{
+function getExactMatchImpl(obj, name, {chainIterator, getProperty}) {
   // We need to go up the prototype chain.
-  let iter = chainIterator(aObj);
-  for (let obj of iter) {
-    let prop = getProperty(obj, aName, aObj);
+  let iter = chainIterator(obj);
+  for (obj of iter) {
+    let prop = getProperty(obj, name, obj);
     if (prop) {
       return prop.value;
     }
   }
   return undefined;
 }
 
-
 var JSObjectSupport = {
-  chainIterator: function*(aObj)
-  {
-    while (aObj) {
-      yield aObj;
-      aObj = Object.getPrototypeOf(aObj);
+  chainIterator: function*(obj) {
+    while (obj) {
+      yield obj;
+      obj = Object.getPrototypeOf(obj);
     }
   },
 
-  getProperties: function(aObj)
-  {
-    return Object.getOwnPropertyNames(aObj);
+  getProperties: function(obj) {
+    return Object.getOwnPropertyNames(obj);
   },
 
-  getProperty: function()
-  {
+  getProperty: function() {
     // getProperty is unsafe with raw JS objects.
-    throw "Unimplemented!";
+    throw new Error("Unimplemented!");
   },
 };
 
 var DebuggerObjectSupport = {
-  chainIterator: function*(aObj)
-  {
-    while (aObj) {
-      yield aObj;
-      aObj = aObj.proto;
+  chainIterator: function*(obj) {
+    while (obj) {
+      yield obj;
+      obj = obj.proto;
     }
   },
 
-  getProperties: function(aObj)
-  {
-    return aObj.getOwnPropertyNames();
+  getProperties: function(obj) {
+    return obj.getOwnPropertyNames();
   },
 
-  getProperty: function(aObj, aName, aRootObj)
-  {
+  getProperty: function(obj, name, rootObj) {
     // This is left unimplemented in favor to DevToolsUtils.getProperty().
-    throw "Unimplemented!";
+    throw new Error("Unimplemented!");
   },
 };
 
 var DebuggerEnvironmentSupport = {
-  chainIterator: function*(aObj)
-  {
-    while (aObj) {
-      yield aObj;
-      aObj = aObj.parent;
+  chainIterator: function*(obj) {
+    while (obj) {
+      yield obj;
+      obj = obj.parent;
     }
   },
 
-  getProperties: function(aObj)
-  {
-    let names = aObj.names();
+  getProperties: function(obj) {
+    let names = obj.names();
 
     // Include 'this' in results (in sorted order)
     for (let i = 0; i < names.length; i++) {
-      if (i === names.length - 1 || names[i+1] > "this") {
-        names.splice(i+1, 0, "this");
+      if (i === names.length - 1 || names[i + 1] > "this") {
+        names.splice(i + 1, 0, "this");
         break;
       }
     }
 
     return names;
   },
 
-  getProperty: function(aObj, aName)
-  {
+  getProperty: function(obj, name) {
     let result;
-    // Try/catch since aName can be anything, and getVariable throws if
+    // Try/catch since name can be anything, and getVariable throws if
     // it's not a valid ECMAScript identifier name
     try {
       // TODO: we should use getVariableDescriptor() here - bug 725815.
-      result = aObj.getVariable(aName);
-    } catch(e) { }
+      result = obj.getVariable(name);
+    } catch (e) {
+      // Ignore.
+    }
 
     // FIXME: Need actual UI, bug 941287.
-    if (result === undefined || result.optimizedOut || result.missingArguments) {
+    if (result === undefined || result.optimizedOut ||
+        result.missingArguments) {
       return null;
     }
     return { value: result };
   },
 };
 
-
 exports.JSPropertyProvider = DevToolsUtils.makeInfallible(JSPropertyProvider);
 
 // Export a version that will throw (for tests)
 exports.FallibleJSPropertyProvider = JSPropertyProvider;
--- a/devtools/shared/webconsole/network-helper.js
+++ b/devtools/shared/webconsole/network-helper.js
@@ -1,40 +1,45 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /*
  * Software License Agreement (BSD License)
  *
  * Copyright (c) 2007, Parakey Inc.
  * All rights reserved.
  *
- * Redistribution and use of this software in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
+ * Redistribution and use of this software in source and binary forms,
+ * with or without modification, are permitted provided that the
+ * following conditions are met:
  *
  * * Redistributions of source code must retain the above
  *   copyright notice, this list of conditions and the
  *   following disclaimer.
  *
  * * Redistributions in binary form must reproduce the above
  *   copyright notice, this list of conditions and the
  *   following disclaimer in the documentation and/or other
  *   materials provided with the distribution.
  *
  * * Neither the name of Parakey Inc. nor the names of its
  *   contributors may be used to endorse or promote products
  *   derived from this software without specific prior
  *   written permission of Parakey Inc.
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
- * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 /*
  * Creator:
  *  Joe Hewitt
  * Contributors
  *  John J. Barton (IBM Almaden)
  *  Jan Odvarko (Mozilla Corp.)
@@ -49,352 +54,340 @@
  *  Austin Andrews
  *  Christoph Dorn
  *  Steven Roussey (AppCenter Inc, Network54)
  *  Mihai Sucan (Mozilla Corp.)
  */
 
 "use strict";
 
-const {components, Cc, Ci, Cu} = require("chrome");
+const {components, Cc, Ci} = require("chrome");
 loader.lazyImporter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
 const DevToolsUtils = require("devtools/shared/DevToolsUtils");
 const Services = require("Services");
 
 // The cache used in the `nsIURL` function.
 const gNSURLStore = new Map();
 
 /**
  * Helper object for networking stuff.
  *
  * Most of the following functions have been taken from the Firebug source. They
  * have been modified to match the Firefox coding rules.
  */
 var NetworkHelper = {
   /**
-   * Converts aText with a given aCharset to unicode.
+   * Converts text with a given charset to unicode.
    *
-   * @param string aText
+   * @param string text
    *        Text to convert.
-   * @param string aCharset
+   * @param string charset
    *        Charset to convert the text to.
    * @returns string
    *          Converted text.
    */
-  convertToUnicode: function NH_convertToUnicode(aText, aCharset)
-  {
-    let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
-               createInstance(Ci.nsIScriptableUnicodeConverter);
+  convertToUnicode: function(text, charset) {
+    let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
+        .createInstance(Ci.nsIScriptableUnicodeConverter);
     try {
-      conv.charset = aCharset || "UTF-8";
-      return conv.ConvertToUnicode(aText);
-    }
-    catch (ex) {
-      return aText;
+      conv.charset = charset || "UTF-8";
+      return conv.ConvertToUnicode(text);
+    } catch (ex) {
+      return text;
     }
   },
 
   /**
-   * Reads all available bytes from aStream and converts them to aCharset.
+   * Reads all available bytes from stream and converts them to charset.
    *
-   * @param nsIInputStream aStream
-   * @param string aCharset
+   * @param nsIInputStream stream
+   * @param string charset
    * @returns string
-   *          UTF-16 encoded string based on the content of aStream and aCharset.
+   *          UTF-16 encoded string based on the content of stream and charset.
    */
-  readAndConvertFromStream: function NH_readAndConvertFromStream(aStream, aCharset)
-  {
+  readAndConvertFromStream: function(stream, charset) {
     let text = null;
     try {
-      text = NetUtil.readInputStreamToString(aStream, aStream.available())
-      return this.convertToUnicode(text, aCharset);
-    }
-    catch (err) {
+      text = NetUtil.readInputStreamToString(stream, stream.available());
+      return this.convertToUnicode(text, charset);
+    } catch (err) {
       return text;
     }
   },
 
    /**
-   * Reads the posted text from aRequest.
+   * Reads the posted text from request.
    *
-   * @param nsIHttpChannel aRequest
-   * @param string aCharset
+   * @param nsIHttpChannel request
+   * @param string charset
    *        The content document charset, used when reading the POSTed data.
    * @returns string or null
-   *          Returns the posted string if it was possible to read from aRequest
+   *          Returns the posted string if it was possible to read from request
    *          otherwise null.
    */
-  readPostTextFromRequest: function NH_readPostTextFromRequest(aRequest, aCharset)
-  {
-    if (aRequest instanceof Ci.nsIUploadChannel) {
-      let iStream = aRequest.uploadStream;
+  readPostTextFromRequest: function(request, charset) {
+    if (request instanceof Ci.nsIUploadChannel) {
+      let iStream = request.uploadStream;
 
       let isSeekableStream = false;
       if (iStream instanceof Ci.nsISeekableStream) {
         isSeekableStream = true;
       }
 
       let prevOffset;
       if (isSeekableStream) {
         prevOffset = iStream.tell();
         iStream.seek(Ci.nsISeekableStream.NS_SEEK_SET, 0);
       }
 
       // Read data from the stream.
-      let text = this.readAndConvertFromStream(iStream, aCharset);
+      let text = this.readAndConvertFromStream(iStream, charset);
 
       // Seek locks the file, so seek to the beginning only if necko hasn't
       // read it yet, since necko doesn't seek to 0 before reading (at lest
       // not till 459384 is fixed).
       if (isSeekableStream && prevOffset == 0) {
         iStream.seek(Ci.nsISeekableStream.NS_SEEK_SET, 0);
       }
       return text;
     }
     return null;
   },
 
   /**
    * Reads the posted text from the page's cache.
    *
-   * @param nsIDocShell aDocShell
-   * @param string aCharset
+   * @param nsIDocShell docShell
+   * @param string charset
    * @returns string or null
    *          Returns the posted string if it was possible to read from
-   *          aDocShell otherwise null.
+   *          docShell otherwise null.
    */
-  readPostTextFromPage: function NH_readPostTextFromPage(aDocShell, aCharset)
-  {
-    let webNav = aDocShell.QueryInterface(Ci.nsIWebNavigation);
-    return this.readPostTextFromPageViaWebNav(webNav, aCharset);
+  readPostTextFromPage: function(docShell, charset) {
+    let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
+    return this.readPostTextFromPageViaWebNav(webNav, charset);
   },
 
   /**
    * Reads the posted text from the page's cache, given an nsIWebNavigation
    * object.
    *
-   * @param nsIWebNavigation aWebNav
-   * @param string aCharset
+   * @param nsIWebNavigation webNav
+   * @param string charset
    * @returns string or null
    *          Returns the posted string if it was possible to read from
-   *          aWebNav, otherwise null.
+   *          webNav, otherwise null.
    */
-  readPostTextFromPageViaWebNav:
-  function NH_readPostTextFromPageViaWebNav(aWebNav, aCharset)
-  {
-    if (aWebNav instanceof Ci.nsIWebPageDescriptor) {
-      let descriptor = aWebNav.currentDescriptor;
+  readPostTextFromPageViaWebNav: function(webNav, charset) {
+    if (webNav instanceof Ci.nsIWebPageDescriptor) {
+      let descriptor = webNav.currentDescriptor;
 
       if (descriptor instanceof Ci.nsISHEntry && descriptor.postData &&
           descriptor instanceof Ci.nsISeekableStream) {
-        descriptor.seek(NS_SEEK_SET, 0);
+        descriptor.seek(Ci.nsISeekableStream.NS_SEEK_SET, 0);
 
-        return this.readAndConvertFromStream(descriptor, aCharset);
+        return this.readAndConvertFromStream(descriptor, charset);
       }
     }
     return null;
   },
 
   /**
-   * Gets the web appId that is associated with aRequest.
+   * Gets the web appId that is associated with request.
    *
-   * @param nsIHttpChannel aRequest
+   * @param nsIHttpChannel request
    * @returns number|null
    *          The appId for the given request, if available.
    */
-  getAppIdForRequest: function NH_getAppIdForRequest(aRequest)
-  {
+  getAppIdForRequest: function(request) {
     try {
-      return this.getRequestLoadContext(aRequest).appId;
+      return this.getRequestLoadContext(request).appId;
     } catch (ex) {
       // request loadContent is not always available.
     }
     return null;
   },
 
   /**
-   * Gets the topFrameElement that is associated with aRequest. This
+   * Gets the topFrameElement that is associated with request. This
    * works in single-process and multiprocess contexts. It may cross
    * the content/chrome boundary.
    *
-   * @param nsIHttpChannel aRequest
+   * @param nsIHttpChannel request
    * @returns nsIDOMElement|null
    *          The top frame element for the given request.
    */
-  getTopFrameForRequest: function NH_getTopFrameForRequest(aRequest)
-  {
+  getTopFrameForRequest: function(request) {
     try {
-      return this.getRequestLoadContext(aRequest).topFrameElement;
+      return this.getRequestLoadContext(request).topFrameElement;
     } catch (ex) {
       // request loadContent is not always available.
     }
     return null;
   },
 
   /**
-   * Gets the nsIDOMWindow that is associated with aRequest.
+   * Gets the nsIDOMWindow that is associated with request.
    *
-   * @param nsIHttpChannel aRequest
+   * @param nsIHttpChannel request
    * @returns nsIDOMWindow or null
    */
-  getWindowForRequest: function NH_getWindowForRequest(aRequest)
-  {
+  getWindowForRequest: function(request) {
     try {
-      return this.getRequestLoadContext(aRequest).associatedWindow;
+      return this.getRequestLoadContext(request).associatedWindow;
     } catch (ex) {
       // TODO: bug 802246 - getWindowForRequest() throws on b2g: there is no
       // associatedWindow property.
     }
     return null;
   },
 
   /**
-   * Gets the nsILoadContext that is associated with aRequest.
+   * Gets the nsILoadContext that is associated with request.
    *
-   * @param nsIHttpChannel aRequest
+   * @param nsIHttpChannel request
    * @returns nsILoadContext or null
    */
-  getRequestLoadContext: function NH_getRequestLoadContext(aRequest)
-  {
+  getRequestLoadContext: function(request) {
     try {
-      return aRequest.notificationCallbacks.getInterface(Ci.nsILoadContext);
-    } catch (ex) { }
+      return request.notificationCallbacks.getInterface(Ci.nsILoadContext);
+    } catch (ex) {
+      // Ignore.
+    }
 
     try {
-      return aRequest.loadGroup.notificationCallbacks.getInterface(Ci.nsILoadContext);
-    } catch (ex) { }
+      return request.loadGroup.notificationCallbacks
+        .getInterface(Ci.nsILoadContext);
+    } catch (ex) {
+      // Ignore.
+    }
 
     return null;
   },
 
   /**
    * Determines whether the request has been made for the top level document.
    *
-   * @param nsIHttpChannel aRequest
+   * @param nsIHttpChannel request
    * @returns Boolean True if the request represents the top level document.
    */
-  isTopLevelLoad: function(aRequest)
-  {
-    if (aRequest instanceof Ci.nsIChannel) {
-      let loadInfo = aRequest.loadInfo;
+  isTopLevelLoad: function(request) {
+    if (request instanceof Ci.nsIChannel) {
+      let loadInfo = request.loadInfo;
       if (loadInfo && loadInfo.parentOuterWindowID == loadInfo.outerWindowID) {
-        return (aRequest.loadFlags & Ci.nsIChannel.LOAD_DOCUMENT_URI);
+        return (request.loadFlags & Ci.nsIChannel.LOAD_DOCUMENT_URI);
       }
     }
 
     return false;
   },
 
   /**
-   * Loads the content of aUrl from the cache.
+   * Loads the content of url from the cache.
    *
-   * @param string aUrl
+   * @param string url
    *        URL to load the cached content for.
-   * @param string aCharset
+   * @param string charset
    *        Assumed charset of the cached content. Used if there is no charset
    *        on the channel directly.
-   * @param function aCallback
+   * @param function callback
    *        Callback that is called with the loaded cached content if available
    *        or null if something failed while getting the cached content.
    */
-  loadFromCache: function NH_loadFromCache(aUrl, aCharset, aCallback)
-  {
-    let channel = NetUtil.newChannel({uri: aUrl, loadUsingSystemPrincipal: true});
+  loadFromCache: function(url, charset, callback) {
+    let channel = NetUtil.newChannel({uri: url,
+                                      loadUsingSystemPrincipal: true});
 
     // Ensure that we only read from the cache and not the server.
     channel.loadFlags = Ci.nsIRequest.LOAD_FROM_CACHE |
       Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE |
       Ci.nsICachingChannel.LOAD_BYPASS_LOCAL_CACHE_IF_BUSY;
 
     NetUtil.asyncFetch(
       channel,
-      (aInputStream, aStatusCode, aRequest) => {
-        if (!components.isSuccessCode(aStatusCode)) {
-          aCallback(null);
+      (inputStream, statusCode, request) => {
+        if (!components.isSuccessCode(statusCode)) {
+          callback(null);
           return;
         }
 
         // Try to get the encoding from the channel. If there is none, then use
-        // the passed assumed aCharset.
-        let aChannel = aRequest.QueryInterface(Ci.nsIChannel);
-        let contentCharset = aChannel.contentCharset || aCharset;
+        // the passed assumed charset.
+        let requestChannel = request.QueryInterface(Ci.nsIChannel);
+        let contentCharset = requestChannel.contentCharset || charset;
 
         // Read the content of the stream using contentCharset as encoding.
-        aCallback(this.readAndConvertFromStream(aInputStream, contentCharset));
+        callback(this.readAndConvertFromStream(inputStream, contentCharset));
       });
   },
 
   /**
    * Parse a raw Cookie header value.
    *
-   * @param string aHeader
+   * @param string header
    *        The raw Cookie header value.
    * @return array
    *         Array holding an object for each cookie. Each object holds the
    *         following properties: name and value.
    */
-  parseCookieHeader: function NH_parseCookieHeader(aHeader)
-  {
-    let cookies = aHeader.split(";");
+  parseCookieHeader: function(header) {
+    let cookies = header.split(";");
     let result = [];
 
-    cookies.forEach(function(aCookie) {
-      let equal = aCookie.indexOf("=");
-      let name = aCookie.substr(0, equal);
-      let value = aCookie.substr(equal + 1);
+    cookies.forEach(function(cookie) {
+      let equal = cookie.indexOf("=");
+      let name = cookie.substr(0, equal);
+      let value = cookie.substr(equal + 1);
       result.push({name: unescape(name.trim()),
                    value: unescape(value.trim())});
     });
 
     return result;
   },
 
   /**
    * Parse a raw Set-Cookie header value.
    *
-   * @param string aHeader
+   * @param string header
    *        The raw Set-Cookie header value.
    * @return array
    *         Array holding an object for each cookie. Each object holds the
    *         following properties: name, value, secure (boolean), httpOnly
    *         (boolean), path, domain and expires (ISO date string).
    */
-  parseSetCookieHeader: function NH_parseSetCookieHeader(aHeader)
-  {
-    let rawCookies = aHeader.split(/\r\n|\n|\r/);
+  parseSetCookieHeader: function(header) {
+    let rawCookies = header.split(/\r\n|\n|\r/);
     let cookies = [];
 
-    rawCookies.forEach(function(aCookie) {
-      let equal = aCookie.indexOf("=");
-      let name = unescape(aCookie.substr(0, equal).trim());
-      let parts = aCookie.substr(equal + 1).split(";");
+    rawCookies.forEach(function(cookie) {
+      let equal = cookie.indexOf("=");
+      let name = unescape(cookie.substr(0, equal).trim());
+      let parts = cookie.substr(equal + 1).split(";");
       let value = unescape(parts.shift().trim());
 
-      let cookie = {name: name, value: value};
+      cookie = {name: name, value: value};
 
-      parts.forEach(function(aPart) {
-        let part = aPart.trim();
+      parts.forEach(function(part) {
+        part = part.trim();
         if (part.toLowerCase() == "secure") {
           cookie.secure = true;
-        }
-        else if (part.toLowerCase() == "httponly") {
+        } else if (part.toLowerCase() == "httponly") {
           cookie.httpOnly = true;
-        }
-        else if (part.indexOf("=") > -1) {
+        } else if (part.indexOf("=") > -1) {
           let pair = part.split("=");
           pair[0] = pair[0].toLowerCase();
           if (pair[0] == "path" || pair[0] == "domain") {
             cookie[pair[0]] = pair[1];
-          }
-          else if (pair[0] == "expires") {
+          } else if (pair[0] == "expires") {
             try {
-              pair[1] = pair[1].replace(/-/g, ' ');
+              pair[1] = pair[1].replace(/-/g, " ");
               cookie.expires = new Date(pair[1]).toISOString();
+            } catch (ex) {
+              // Ignore.
             }
-            catch (ex) { }
           }
         }
       });
 
       cookies.push(cookie);
     });
 
     return cookies;
@@ -473,34 +466,33 @@ var NetworkHelper = {
     "application/json-rpc": "json",
     "application/x-web-app-manifest+json": "json",
     "application/manifest+json": "json"
   },
 
   /**
    * Check if the given MIME type is a text-only MIME type.
    *
-   * @param string aMimeType
+   * @param string mimeType
    * @return boolean
    */
-  isTextMimeType: function NH_isTextMimeType(aMimeType)
-  {
-    if (aMimeType.indexOf("text/") == 0) {
+  isTextMimeType: function(mimeType) {
+    if (mimeType.indexOf("text/") == 0) {
       return true;
     }
 
     // XML and JSON often come with custom MIME types, so in addition to the
     // standard "application/xml" and "application/json", we also look for
     // variants like "application/x-bigcorp+xml". For JSON we allow "+json" and
     // "-json" as suffixes.
-    if (/^application\/\w+(?:[\.-]\w+)*(?:\+xml|[-+]json)$/.test(aMimeType)) {
+    if (/^application\/\w+(?:[\.-]\w+)*(?:\+xml|[-+]json)$/.test(mimeType)) {
       return true;
     }
 
-    let category = this.mimeCategoryMap[aMimeType] || null;
+    let category = this.mimeCategoryMap[mimeType] || null;
     switch (category) {
       case "txt":
       case "js":
       case "json":
       case "css":
       case "html":
       case "svg":
       case "xml":
@@ -526,29 +518,31 @@ var NetworkHelper = {
    *         Returns an object containing following members:
    *          - state: The security of the connection used to fetch this
    *                   request. Has one of following string values:
    *                    * "insecure": the connection was not secure (only http)
    *                    * "weak": the connection has minor security issues
    *                    * "broken": secure connection failed (e.g. expired cert)
    *                    * "secure": the connection was properly secured.
    *          If state == broken:
-   *            - errorMessage: full error message from nsITransportSecurityInfo.
+   *            - errorMessage: full error message from
+   *                            nsITransportSecurityInfo.
    *          If state == secure:
    *            - protocolVersion: one of TLSv1, TLSv1.1, TLSv1.2.
    *            - cipherSuite: the cipher suite used in this connection.
    *            - cert: information about certificate used in this connection.
    *                    See parseCertificateInfo for the contents.
-   *            - hsts: true if host uses Strict Transport Security, false otherwise
+   *            - hsts: true if host uses Strict Transport Security,
+   *                    false otherwise
    *            - hpkp: true if host uses Public Key Pinning, false otherwise
    *          If state == weak: Same as state == secure and
    *            - weaknessReasons: list of reasons that cause the request to be
    *                               considered weak. See getReasonsForWeakness.
    */
-  parseSecurityInfo: function NH_parseSecurityInfo(securityInfo, httpActivity) {
+  parseSecurityInfo: function(securityInfo, httpActivity) {
     const info = {
       state: "insecure",
     };
 
     // The request did not contain any security info.
     if (!securityInfo) {
       return info;
     }
@@ -584,30 +578,31 @@ var NetworkHelper = {
      *   => .errorMessage is not available
      *      => state === "weak"
      */
 
     securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
     securityInfo.QueryInterface(Ci.nsISSLStatusProvider);
 
     const wpl = Ci.nsIWebProgressListener;
-    const NSSErrorsService = Cc['@mozilla.org/nss_errors_service;1']
+    const NSSErrorsService = Cc["@mozilla.org/nss_errors_service;1"]
                                .getService(Ci.nsINSSErrorsService);
     const SSLStatus = securityInfo.SSLStatus;
     if (!NSSErrorsService.isNSSErrorCode(securityInfo.errorCode)) {
       const state = securityInfo.securityState;
 
       let uri = null;
       if (httpActivity.channel && httpActivity.channel.URI) {
         uri = httpActivity.channel.URI;
       }
       if (uri && !uri.schemeIs("https") && !uri.schemeIs("wss")) {
-        // it is not enough to look at the transport security info - schemes other than
-        // https and wss are subject to downgrade/etc at the scheme level and should
-        // always be considered insecure
+        // it is not enough to look at the transport security info -
+        // schemes other than https and wss are subject to
+        // downgrade/etc at the scheme level and should always be
+        // considered insecure
         info.state = "insecure";
       } else if (state & wpl.STATE_IS_SECURE) {
         // The connection is secure if the scheme is sufficient
         info.state = "secure";
       } else if (state & wpl.STATE_IS_BROKEN) {
         // The connection is not secure, there was no error but there's some
         // minor security issues.
         info.state = "weak";
@@ -621,44 +616,43 @@ var NetworkHelper = {
           "Security state " + state + " has no known STATE_IS_* flags.");
         return info;
       }
 
       // Cipher suite.
       info.cipherSuite = SSLStatus.cipherName;
 
       // Protocol version.
-      info.protocolVersion = this.formatSecurityProtocol(SSLStatus.protocolVersion);
+      info.protocolVersion =
+        this.formatSecurityProtocol(SSLStatus.protocolVersion);
 
       // Certificate.
       info.cert = this.parseCertificateInfo(SSLStatus.serverCert);
 
       // HSTS and HPKP if available.
       if (httpActivity.hostname) {
         const sss = Cc["@mozilla.org/ssservice;1"]
                       .getService(Ci.nsISiteSecurityService);
 
-
         // SiteSecurityService uses different storage if the channel is
         // private. Thus we must give isSecureHost correct flags or we
         // might get incorrect results.
         let flags = (httpActivity.private) ?
                       Ci.nsISocketProvider.NO_PERMANENT_STORAGE : 0;
 
         let host = httpActivity.hostname;
 
         info.hsts = sss.isSecureHost(sss.HEADER_HSTS, host, flags);
         info.hpkp = sss.isSecureHost(sss.HEADER_HPKP, host, flags);
       } else {
         DevToolsUtils.reportException("NetworkHelper.parseSecurityInfo",
           "Could not get HSTS/HPKP status as hostname is not available.");
         info.hsts = false;
         info.hpkp = false;
       }
-
     } else {
       // The connection failed.
       info.state = "broken";
       info.errorMessage = securityInfo.errorMessage;
     }
 
     return info;
   },
@@ -672,17 +666,17 @@ var NetworkHelper = {
    *         An object with following format:
    *           {
    *             subject: { commonName, organization, organizationalUnit },
    *             issuer: { commonName, organization, organizationUnit },
    *             validity: { start, end },
    *             fingerprint: { sha1, sha256 }
    *           }
    */
-  parseCertificateInfo: function NH_parseCertifificateInfo(cert) {
+  parseCertificateInfo: function(cert) {
     let info = {};
     if (cert) {
       info.subject = {
         commonName: cert.commonName,
         organization: cert.organization,
         organizationalUnit: cert.organizationalUnit,
       };
 
@@ -714,17 +708,17 @@ var NetworkHelper = {
    * description.
    *
    * @param Number version
    *        One of nsISSLStatus version constants.
    * @return string
    *         One of TLSv1, TLSv1.1, TLSv1.2 if @param version is valid,
    *         Unknown otherwise.
    */
-  formatSecurityProtocol: function NH_formatSecurityProtocol(version) {
+  formatSecurityProtocol: function(version) {
     switch (version) {
       case Ci.nsISSLStatus.TLS_VERSION_1:
         return "TLSv1";
       case Ci.nsISSLStatus.TLS_VERSION_1_1:
         return "TLSv1.1";
       case Ci.nsISSLStatus.TLS_VERSION_1_2:
         return "TLSv1.2";
       default:
@@ -740,17 +734,17 @@ var NetworkHelper = {
    *
    * @param Number state
    *        nsITransportSecurityInfo.securityState.
    *
    * @return Array[String]
    *         List of weakness reasons. A subset of { cipher } where
    *         * cipher: The cipher suite is consireded to be weak (RC4).
    */
-  getReasonsForWeakness: function NH_getReasonsForWeakness(state) {
+  getReasonsForWeakness: function(state) {
     const wpl = Ci.nsIWebProgressListener;
 
     // If there's non-fatal security issues the request has STATE_IS_BROKEN
     // flag set. See http://hg.mozilla.org/mozilla-central/file/44344099d119
     // /security/manager/ssl/nsNSSCallbacks.cpp#l1233
     let reasons = [];
 
     if (state & wpl.STATE_IS_BROKEN) {
@@ -767,49 +761,52 @@ var NetworkHelper = {
     }
 
     return reasons;
   },
 
   /**
    * Parse a url's query string into its components
    *
-   * @param string aQueryString
+   * @param string queryString
    *        The query part of a url
    * @return array
    *         Array of query params {name, value}
    */
-  parseQueryString: function(aQueryString) {
+  parseQueryString: function(queryString) {
     // Make sure there's at least one param available.
     // Be careful here, params don't necessarily need to have values, so
     // no need to verify the existence of a "=".
-    if (!aQueryString) {
-      return;
+    if (!queryString) {
+      return null;
     }
 
     // Turn the params string into an array containing { name: value } tuples.
-    let paramsArray = aQueryString.replace(/^[?&]/, "").split("&").map(e => {
+    let paramsArray = queryString.replace(/^[?&]/, "").split("&").map(e => {
       let param = e.split("=");
       return {
-        name: param[0] ? NetworkHelper.convertToUnicode(unescape(param[0])) : "",
-        value: param[1] ? NetworkHelper.convertToUnicode(unescape(param[1])) : ""
-      }});
+        name: param[0] ?
+          NetworkHelper.convertToUnicode(unescape(param[0])) : "",
+        value: param[1] ?
+          NetworkHelper.convertToUnicode(unescape(param[1])) : ""
+      };
+    });
 
     return paramsArray;
   },
 
   /**
    * Helper for getting an nsIURL instance out of a string.
    */
-  nsIURL: function(aUrl, aStore = gNSURLStore) {
-    if (aStore.has(aUrl)) {
-      return aStore.get(aUrl);
+  nsIURL: function(url, store = gNSURLStore) {
+    if (store.has(url)) {
+      return store.get(url);
     }
 
-    let uri = Services.io.newURI(aUrl, null, null).QueryInterface(Ci.nsIURL);
-    aStore.set(aUrl, uri);
+    let uri = Services.io.newURI(url, null, null).QueryInterface(Ci.nsIURL);
+    store.set(url, uri);
     return uri;
   }
 };
 
 for (let prop of Object.getOwnPropertyNames(NetworkHelper)) {
   exports[prop] = NetworkHelper[prop];
 }
--- a/devtools/shared/webconsole/network-monitor.js
+++ b/devtools/shared/webconsole/network-monitor.js
@@ -15,55 +15,54 @@ loader.lazyRequireGetter(this, "NetworkH
                          "devtools/shared/webconsole/network-helper");
 loader.lazyRequireGetter(this, "DevToolsUtils",
                          "devtools/shared/DevToolsUtils");
 loader.lazyImporter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
 loader.lazyServiceGetter(this, "gActivityDistributor",
                          "@mozilla.org/network/http-activity-distributor;1",
                          "nsIHttpActivityDistributor");
 
-///////////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////////
 // Network logging
-///////////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////////
 
 // The maximum uint32 value.
 const PR_UINT32_MAX = 4294967295;
 
 // HTTP status codes.
 const HTTP_MOVED_PERMANENTLY = 301;
 const HTTP_FOUND = 302;
 const HTTP_SEE_OTHER = 303;
 const HTTP_TEMPORARY_REDIRECT = 307;
 
-// The maximum number of bytes a NetworkResponseListener can hold.
-const RESPONSE_BODY_LIMIT = 1048576; // 1 MB
+// The maximum number of bytes a NetworkResponseListener can hold: 1 MB
+const RESPONSE_BODY_LIMIT = 1048576;
 
 /**
  * The network response listener implements the nsIStreamListener and
  * nsIRequestObserver interfaces. This is used within the NetworkMonitor feature
  * to get the response body of the request.
  *
  * The code is mostly based on code listings from:
  *
  *   http://www.softwareishard.com/blog/firebug/
  *      nsitraceablechannel-intercept-http-traffic/
  *
  * @constructor
- * @param object aOwner
+ * @param object owner
  *        The response listener owner. This object needs to hold the
  *        |openResponses| object.
- * @param object aHttpActivity
+ * @param object httpActivity
  *        HttpActivity object associated with this request. See NetworkMonitor
  *        for more information.
  */
-function NetworkResponseListener(aOwner, aHttpActivity)
-{
-  this.owner = aOwner;
+function NetworkResponseListener(owner, httpActivity) {
+  this.owner = owner;
   this.receivedData = "";
-  this.httpActivity = aHttpActivity;
+  this.httpActivity = httpActivity;
   this.bodySize = 0;
   let channel = this.httpActivity.channel;
   this._wrappedNotificationCallbacks = channel.notificationCallbacks;
   channel.notificationCallbacks = this;
 }
 exports.NetworkResponseListener = NetworkResponseListener;
 
 NetworkResponseListener.prototype = {
@@ -154,132 +153,131 @@ NetworkResponseListener.prototype = {
    * The nsIRequest we are started for.
    */
   request: null,
 
   /**
    * Set the async listener for the given nsIAsyncInputStream. This allows us to
    * wait asynchronously for any data coming from the stream.
    *
-   * @param nsIAsyncInputStream aStream
+   * @param nsIAsyncInputStream stream
    *        The input stream from where we are waiting for data to come in.
-   * @param nsIInputStreamCallback aListener
+   * @param nsIInputStreamCallback listener
    *        The input stream callback you want. This is an object that must have
    *        the onInputStreamReady() method. If the argument is null, then the
    *        current callback is removed.
    * @return void
    */
-  setAsyncListener: function NRL_setAsyncListener(aStream, aListener)
-  {
+  setAsyncListener: function(stream, listener) {
     // Asynchronously wait for the stream to be readable or closed.
-    aStream.asyncWait(aListener, 0, 0, Services.tm.mainThread);
+    stream.asyncWait(listener, 0, 0, Services.tm.mainThread);
   },
 
   /**
    * Stores the received data, if request/response body logging is enabled. It
    * also does limit the number of stored bytes, based on the
    * RESPONSE_BODY_LIMIT constant.
    *
    * Learn more about nsIStreamListener at:
    * https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIStreamListener
    *
-   * @param nsIRequest aRequest
-   * @param nsISupports aContext
-   * @param nsIInputStream aInputStream
-   * @param unsigned long aOffset
-   * @param unsigned long aCount
+   * @param nsIRequest request
+   * @param nsISupports context
+   * @param nsIInputStream inputStream
+   * @param unsigned long offset
+   * @param unsigned long count
    */
-  onDataAvailable:
-  function NRL_onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount)
-  {
+  onDataAvailable: function(request, context, inputStream, offset, count) {
     this._findOpenResponse();
-    let data = NetUtil.readInputStreamToString(aInputStream, aCount);
+    let data = NetUtil.readInputStreamToString(inputStream, count);
 
-    this.bodySize += aCount;
+    this.bodySize += count;
 
     if (!this.httpActivity.discardResponseBody &&
         this.receivedData.length < RESPONSE_BODY_LIMIT) {
-      this.receivedData += NetworkHelper.
-                           convertToUnicode(data, aRequest.contentCharset);
+      this.receivedData +=
+        NetworkHelper.convertToUnicode(data, request.contentCharset);
     }
   },
 
   /**
    * See documentation at
    * https://developer.mozilla.org/En/NsIRequestObserver
    *
-   * @param nsIRequest aRequest
-   * @param nsISupports aContext
+   * @param nsIRequest request
+   * @param nsISupports context
    */
-  onStartRequest: function NRL_onStartRequest(aRequest)
-  {
+  onStartRequest: function(request) {
     // Converter will call this again, we should just ignore that.
-    if (this.request)
+    if (this.request) {
       return;
+    }
 
-    this.request = aRequest;
+    this.request = request;
     this._getSecurityInfo();
     this._findOpenResponse();
-    // We need to track the offset for the onDataAvailable calls where we pass the data
-    // from our pipe to the coverter.
+    // We need to track the offset for the onDataAvailable calls where
+    // we pass the data from our pipe to the coverter.
     this.offset = 0;
 
-    // In the multi-process mode, the conversion happens on the child side while we can
-    // only monitor the channel on the parent side. If the content is gzipped, we have
-    // to unzip it ourself. For that we use the stream converter services.
-    // Do not do that for Service workers as they are run in the child process.
+    // In the multi-process mode, the conversion happens on the child
+    // side while we can only monitor the channel on the parent
+    // side. If the content is gzipped, we have to unzip it
+    // ourself. For that we use the stream converter services.  Do not
+    // do that for Service workers as they are run in the child
+    // process.
     let channel = this.request;
     if (!this.httpActivity.fromServiceWorker &&
         channel instanceof Ci.nsIEncodedChannel &&
         channel.contentEncodings &&
         !channel.applyConversion) {
       let encodingHeader = channel.getResponseHeader("Content-Encoding");
-      let scs = Cc["@mozilla.org/streamConverters;1"].
-        getService(Ci.nsIStreamConverterService);
+      let scs = Cc["@mozilla.org/streamConverters;1"]
+        .getService(Ci.nsIStreamConverterService);
       let encodings = encodingHeader.split(/\s*\t*,\s*\t*/);
       let nextListener = this;
       let acceptedEncodings = ["gzip", "deflate", "x-gzip", "x-deflate"];
       for (let i in encodings) {
         // There can be multiple conversions applied
         let enc = encodings[i].toLowerCase();
         if (acceptedEncodings.indexOf(enc) > -1) {
-          this.converter = scs.asyncConvertData(enc, "uncompressed", nextListener, null);
+          this.converter = scs.asyncConvertData(enc, "uncompressed",
+                                                nextListener, null);
           nextListener = this.converter;
         }
       }
       if (this.converter) {
         this.converter.onStartRequest(this.request, null);
       }
     }
     // Asynchronously wait for the data coming from the request.
     this.setAsyncListener(this.sink.inputStream, this);
   },
 
   /**
    * Parse security state of this request and report it to the client.
    */
-  _getSecurityInfo: DevToolsUtils.makeInfallible(function NRL_getSecurityInfo() {
+  _getSecurityInfo: DevToolsUtils.makeInfallible(function() {
     // Take the security information from the original nsIHTTPChannel instead of
     // the nsIRequest received in onStartRequest. If response to this request
     // was a redirect from http to https, the request object seems to contain
     // security info for the https request after redirect.
     let secinfo = this.httpActivity.channel.securityInfo;
     let info = NetworkHelper.parseSecurityInfo(secinfo, this.httpActivity);
 
     this.httpActivity.owner.addSecurityInfo(info);
   }),
 
   /**
    * Handle the onStopRequest by closing the sink output stream.
    *
    * For more documentation about nsIRequestObserver go to:
    * https://developer.mozilla.org/En/NsIRequestObserver
    */
-  onStopRequest: function NRL_onStopRequest()
-  {
+  onStopRequest: function() {
     this._findOpenResponse();
     this.sink.outputStream.close();
   },
 
   // nsIProgressEventSink implementation
 
   /**
    * Handle progress event as data is transferred.  This is used to record the
@@ -287,31 +285,30 @@ NetworkResponseListener.prototype = {
    */
   onProgress: function(request, context, progress, progressMax) {
     this.transferredSize = progress;
     // Need to forward as well to keep things like Download Manager's progress
     // bar working properly.
     this._forwardNotification(Ci.nsIProgressEventSink, "onProgress", arguments);
   },
 
-  onStatus: function () {
+  onStatus: function() {
     this._forwardNotification(Ci.nsIProgressEventSink, "onStatus", arguments);
   },
 
   /**
    * Find the open response object associated to the current request. The
    * NetworkMonitor._httpResponseExaminer() method saves the response headers in
    * NetworkMonitor.openResponses. This method takes the data from the open
    * response object and puts it into the HTTP activity object, then sends it to
    * the remote Web Console instance.
    *
    * @private
    */
-  _findOpenResponse: function NRL__findOpenResponse()
-  {
+  _findOpenResponse: function() {
     if (!this.owner || this._foundOpenResponse) {
       return;
     }
 
     let openResponse = null;
 
     for (let id in this.owner.openResponses) {
       let item = this.owner.openResponses[id];
@@ -333,69 +330,69 @@ NetworkResponseListener.prototype = {
   },
 
   /**
    * Clean up the response listener once the response input stream is closed.
    * This is called from onStopRequest() or from onInputStreamReady() when the
    * stream is closed.
    * @return void
    */
-  onStreamClose: function NRL_onStreamClose()
-  {
+  onStreamClose: function() {
     if (!this.httpActivity) {
       return;
     }
     // Remove our listener from the request input stream.
     this.setAsyncListener(this.sink.inputStream, null);
 
     this._findOpenResponse();
 
     if (!this.httpActivity.discardResponseBody && this.receivedData.length) {
       this._onComplete(this.receivedData);
-    }
-    else if (!this.httpActivity.discardResponseBody &&
-             this.httpActivity.responseStatus == 304) {
+    } else if (!this.httpActivity.discardResponseBody &&
+               this.httpActivity.responseStatus == 304) {
       // Response is cached, so we load it from cache.
       let charset = this.request.contentCharset || this.httpActivity.charset;
       NetworkHelper.loadFromCache(this.httpActivity.url, charset,
                                   this._onComplete.bind(this));
-    }
-    else {
+    } else {
       this._onComplete();
     }
   },
 
   /**
    * Handler for when the response completes. This function cleans up the
    * response listener.
    *
-   * @param string [aData]
+   * @param string [data]
    *        Optional, the received data coming from the response listener or
    *        from the cache.
    */
-  _onComplete: function NRL__onComplete(aData)
-  {
+  _onComplete: function(data) {
     let response = {
       mimeType: "",
-      text: aData || "",
+      text: data || "",
     };
 
     response.size = response.text.length;
     response.transferredSize = this.transferredSize;
 
     try {
       response.mimeType = this.request.contentType;
+    } catch (ex) {
+      // Ignore.
     }
-    catch (ex) { }
 
-    if (!response.mimeType || !NetworkHelper.isTextMimeType(response.mimeType)) {
+    if (!response.mimeType ||
+        !NetworkHelper.isTextMimeType(response.mimeType)) {
       response.encoding = "base64";
       try {
         response.text = btoa(response.text);
-      } catch (err) { }
+      } catch (err) {
+        // Ignore.
+      }
     }
 
     if (response.mimeType && this.request.contentCharset) {
       response.mimeType += "; charset=" + this.request.contentCharset;
     }
 
     this.receivedData = "";
 
@@ -414,90 +411,89 @@ NetworkResponseListener.prototype = {
     this.request = null;
     this.owner = null;
   },
 
   /**
    * The nsIInputStreamCallback for when the request input stream is ready -
    * either it has more data or it is closed.
    *
-   * @param nsIAsyncInputStream aStream
+   * @param nsIAsyncInputStream stream
    *        The sink input stream from which data is coming.
    * @returns void
    */
-  onInputStreamReady: function NRL_onInputStreamReady(aStream)
-  {
-    if (!(aStream instanceof Ci.nsIAsyncInputStream) || !this.httpActivity) {
+  onInputStreamReady: function(stream) {
+    if (!(stream instanceof Ci.nsIAsyncInputStream) || !this.httpActivity) {
       return;
     }
 
     let available = -1;
     try {
       // This may throw if the stream is closed normally or due to an error.
-      available = aStream.available();
+      available = stream.available();
+    } catch (ex) {
+      // Ignore.
     }
-    catch (ex) { }
 
     if (available != -1) {
       if (available != 0) {
         if (this.converter) {
-          this.converter.onDataAvailable(this.request, null, aStream, this.offset, available);
+          this.converter.onDataAvailable(this.request, null, stream,
+                                         this.offset, available);
         } else {
-          this.onDataAvailable(this.request, null, aStream, this.offset, available);
+          this.onDataAvailable(this.request, null, stream, this.offset,
+                               available);
         }
       }
       this.offset += available;
-      this.setAsyncListener(aStream, this);
-    }
-    else {
+      this.setAsyncListener(stream, this);
+    } else {
       this.onStreamClose();
       this.offset = 0;
     }
   },
-}; // NetworkResponseListener.prototype
-
+};
 
 /**
  * The network monitor uses the nsIHttpActivityDistributor to monitor network
  * requests. The nsIObserverService is also used for monitoring
  * http-on-examine-response notifications. All network request information is
  * routed to the remote Web Console.
  *
  * @constructor
- * @param object aFilters
+ * @param object filters
  *        Object with the filters to use for network requests:
  *        - window (nsIDOMWindow): filter network requests by the associated
  *        window object.
  *        - appId (number): filter requests by the appId.
  *        - topFrame (nsIDOMElement): filter requests by their topFrameElement.
  *        Filters are optional. If any of these filters match the request is
  *        logged (OR is applied). If no filter is provided then all requests are
  *        logged.
- * @param object aOwner
+ * @param object owner
  *        The network monitor owner. This object needs to hold:
- *        - onNetworkEvent(aRequestInfo, aChannel, aNetworkMonitor).
+ *        - onNetworkEvent(requestInfo, channel, networkMonitor).
  *        This method is invoked once for every new network request and it is
  *        given the following arguments: the initial network request
  *        information, and the channel. The third argument is the NetworkMonitor
  *        instance.
  *        onNetworkEvent() must return an object which holds several add*()
  *        methods which are used to add further network request/response
  *        information.
  */
-function NetworkMonitor(aFilters, aOwner)
-{
-  if (aFilters) {
-    this.window = aFilters.window;
-    this.appId = aFilters.appId;
-    this.topFrame = aFilters.topFrame;
+function NetworkMonitor(filters, owner) {
+  if (filters) {
+    this.window = filters.window;
+    this.appId = filters.appId;
+    this.topFrame = filters.topFrame;
   }
   if (!this.window && !this.appId && !this.topFrame) {
     this._logEverything = true;
   }
-  this.owner = aOwner;
+  this.owner = owner;
   this.openRequests = {};
   this.openResponses = {};
   this._httpResponseExaminer =
     DevToolsUtils.makeInfallible(this._httpResponseExaminer).bind(this);
   this._serviceWorkerRequest = this._serviceWorkerRequest.bind(this);
 }
 exports.NetworkMonitor = NetworkMonitor;
 
@@ -544,18 +540,17 @@ NetworkMonitor.prototype = {
   /**
    * Object that holds response headers coming from this._httpResponseExaminer.
    */
   openResponses: null,
 
   /**
    * The network monitor initializer.
    */
-  init: function NM_init()
-  {
+  init: function() {
     this.responsePipeSegmentSize = Services.prefs
                                    .getIntPref("network.buffer.cache.size");
     this.interceptedChannels = new Set();
 
     if (Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT) {
       gActivityDistributor.addObserver(this);
       Services.obs.addObserver(this._httpResponseExaminer,
                                "http-on-examine-response", false);
@@ -563,82 +558,81 @@ NetworkMonitor.prototype = {
                                "http-on-examine-cached-response", false);
     }
     // In child processes, only watch for service worker requests
     // everything else only happens in the parent process
     Services.obs.addObserver(this._serviceWorkerRequest,
                              "service-worker-synthesized-response", false);
   },
 
-  _serviceWorkerRequest: function(aSubject, aTopic, aData)
-  {
-    let channel = aSubject.QueryInterface(Ci.nsIHttpChannel);
+  _serviceWorkerRequest: function(subject, topic, data) {
+    let channel = subject.QueryInterface(Ci.nsIHttpChannel);
 
     if (!this._matchRequest(channel)) {
       return;
     }
 
-    this.interceptedChannels.add(aSubject);
+    this.interceptedChannels.add(subject);
 
     // On e10s, we never receive http-on-examine-cached-response, so fake one.
     if (Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT) {
       this._httpResponseExaminer(channel, "http-on-examine-cached-response");
     }
   },
 
   /**
    * Observe notifications for the http-on-examine-response topic, coming from
    * the nsIObserverService.
    *
    * @private
-   * @param nsIHttpChannel aSubject
-   * @param string aTopic
+   * @param nsIHttpChannel subject
+   * @param string topic
    * @returns void
    */
-  _httpResponseExaminer: function NM__httpResponseExaminer(aSubject, aTopic)
-  {
+  _httpResponseExaminer: function(subject, topic) {
     // The httpResponseExaminer is used to retrieve the uncached response
     // headers. The data retrieved is stored in openResponses. The
     // NetworkResponseListener is responsible with updating the httpActivity
     // object with the data from the new object in openResponses.
 
     if (!this.owner ||
-        (aTopic != "http-on-examine-response" &&
-         aTopic != "http-on-examine-cached-response") ||
-        !(aSubject instanceof Ci.nsIHttpChannel)) {
+        (topic != "http-on-examine-response" &&
+         topic != "http-on-examine-cached-response") ||
+        !(subject instanceof Ci.nsIHttpChannel)) {
       return;
     }
 
-    let channel = aSubject.QueryInterface(Ci.nsIHttpChannel);
+    let channel = subject.QueryInterface(Ci.nsIHttpChannel);
 
     if (!this._matchRequest(channel)) {
       return;
     }
 
     let response = {
       id: gSequenceId(),
       channel: channel,
       headers: [],
       cookies: [],
     };
 
     let setCookieHeader = null;
 
     channel.visitResponseHeaders({
-      visitHeader: function NM__visitHeader(aName, aValue) {
-        let lowerName = aName.toLowerCase();
+      visitHeader: function(name, value) {
+        let lowerName = name.toLowerCase();
         if (lowerName == "set-cookie") {
-          setCookieHeader = aValue;
+          setCookieHeader = value;
         }
-        response.headers.push({ name: aName, value: aValue });
+        response.headers.push({ name: name, value: value });
       }
     });
 
     if (!response.headers.length) {
-      return; // No need to continue.
+      // No need to continue.
+      return;
     }
 
     if (setCookieHeader) {
       response.cookies = NetworkHelper.parseSetCookieHeader(setCookieHeader);
     }
 
     // Determine the HTTP version.
     let httpVersionMaj = {};
@@ -649,17 +643,17 @@ NetworkMonitor.prototype = {
 
     response.status = channel.responseStatus;
     response.statusText = channel.responseStatusText;
     response.httpVersion = "HTTP/" + httpVersionMaj.value + "." +
                                      httpVersionMin.value;
 
     this.openResponses[response.id] = response;
 
-    if (aTopic === "http-on-examine-cached-response") {
+    if (topic === "http-on-examine-cached-response") {
       // Service worker requests emits cached-reponse notification on non-e10s,
       // and we fake one on e10s.
       let fromServiceWorker = this.interceptedChannels.has(channel);
       this.interceptedChannels.delete(channel);
 
       // If this is a cached response, there never was a request event
       // so we need to construct one here so the frontend gets all the
       // expected events.
@@ -683,237 +677,243 @@ NetworkMonitor.prototype = {
     }
   },
 
   /**
    * Begin observing HTTP traffic that originates inside the current tab.
    *
    * @see https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIHttpActivityObserver
    *
-   * @param nsIHttpChannel aChannel
-   * @param number aActivityType
-   * @param number aActivitySubtype
-   * @param number aTimestamp
-   * @param number aExtraSizeData
-   * @param string aExtraStringData
+   * @param nsIHttpChannel channel
+   * @param number activityType
+   * @param number activitySubtype
+   * @param number timestamp
+   * @param number extraSizeData
+   * @param string extraStringData
    */
-  observeActivity: DevToolsUtils.makeInfallible(function NM_observeActivity(aChannel, aActivityType, aActivitySubtype, aTimestamp, aExtraSizeData, aExtraStringData)
-  {
+  observeActivity:
+  DevToolsUtils.makeInfallible(function(channel, activityType, activitySubtype,
+                                        timestamp, extraSizeData,
+                                        extraStringData) {
     if (!this.owner ||
-        aActivityType != gActivityDistributor.ACTIVITY_TYPE_HTTP_TRANSACTION &&
-        aActivityType != gActivityDistributor.ACTIVITY_TYPE_SOCKET_TRANSPORT) {
+        activityType != gActivityDistributor.ACTIVITY_TYPE_HTTP_TRANSACTION &&
+        activityType != gActivityDistributor.ACTIVITY_TYPE_SOCKET_TRANSPORT) {
       return;
     }
 
-    if (!(aChannel instanceof Ci.nsIHttpChannel)) {
+    if (!(channel instanceof Ci.nsIHttpChannel)) {
       return;
     }
 
-    aChannel = aChannel.QueryInterface(Ci.nsIHttpChannel);
+    channel = channel.QueryInterface(Ci.nsIHttpChannel);
 
-    if (aActivitySubtype ==
+    if (activitySubtype ==
         gActivityDistributor.ACTIVITY_SUBTYPE_REQUEST_HEADER) {
-      this._onRequestHeader(aChannel, aTimestamp, aExtraStringData);
+      this._onRequestHeader(channel, timestamp, extraStringData);
       return;
     }
 
-    // Iterate over all currently ongoing requests. If aChannel can't
+    // Iterate over all currently ongoing requests. If channel can't
     // be found within them, then exit this function.
     let httpActivity = null;
     for (let id in this.openRequests) {
       let item = this.openRequests[id];
-      if (item.channel === aChannel) {
+      if (item.channel === channel) {
         httpActivity = item;
         break;
       }
     }
 
     if (!httpActivity) {
       return;
     }
 
     let transCodes = this.httpTransactionCodes;
 
     // Store the time information for this activity subtype.
-    if (aActivitySubtype in transCodes) {
-      let stage = transCodes[aActivitySubtype];
+    if (activitySubtype in transCodes) {
+      let stage = transCodes[activitySubtype];
       if (stage in httpActivity.timings) {
-        httpActivity.timings[stage].last = aTimestamp;
-      }
-      else {
+        httpActivity.timings[stage].last = timestamp;
+      } else {
         httpActivity.timings[stage] = {
-          first: aTimestamp,
-          last: aTimestamp,
+          first: timestamp,
+          last: timestamp,
         };
       }
     }
 
-    switch (aActivitySubtype) {
+    switch (activitySubtype) {
       case gActivityDistributor.ACTIVITY_SUBTYPE_REQUEST_BODY_SENT:
         this._onRequestBodySent(httpActivity);
         break;
       case gActivityDistributor.ACTIVITY_SUBTYPE_RESPONSE_HEADER:
-        this._onResponseHeader(httpActivity, aExtraStringData);
+        this._onResponseHeader(httpActivity, extraStringData);
         break;
       case gActivityDistributor.ACTIVITY_SUBTYPE_TRANSACTION_CLOSE:
         this._onTransactionClose(httpActivity);
         break;
       default:
         break;
     }
   }),
 
   /**
    * Check if a given network request should be logged by this network monitor
    * instance based on the current filters.
    *
    * @private
-   * @param nsIHttpChannel aChannel
+   * @param nsIHttpChannel channel
    *        Request to check.
    * @return boolean
    *         True if the network request should be logged, false otherwise.
    */
-  _matchRequest: function NM__matchRequest(aChannel)
-  {
+  _matchRequest: function(channel) {
     if (this._logEverything) {
       return true;
     }
 
     // Ignore requests from chrome or add-on code when we are monitoring
     // content.
     // TODO: one particular test (browser_styleeditor_fetch-from-cache.js) needs
     // the DevToolsUtils.testing check. We will move to a better way to serve
     // its needs in bug 1167188, where this check should be removed.
-    if (!DevToolsUtils.testing && aChannel.loadInfo &&
-        aChannel.loadInfo.loadingDocument === null &&
-        aChannel.loadInfo.loadingPrincipal === Services.scriptSecurityManager.getSystemPrincipal()) {
+    if (!DevToolsUtils.testing && channel.loadInfo &&
+        channel.loadInfo.loadingDocument === null &&
+        channel.loadInfo.loadingPrincipal ===
+        Services.scriptSecurityManager.getSystemPrincipal()) {
       return false;
     }
 
     if (this.window) {
       // Since frames support, this.window may not be the top level content
       // frame, so that we can't only compare with win.top.
-      let win = NetworkHelper.getWindowForRequest(aChannel);
-      while(win) {
+      let win = NetworkHelper.getWindowForRequest(channel);
+      while (win) {
         if (win == this.window) {
           return true;
         }
         if (win.parent == win) {
           break;
         }
         win = win.parent;
       }
     }
 
     if (this.topFrame) {
-      let topFrame = NetworkHelper.getTopFrameForRequest(aChannel);
+      let topFrame = NetworkHelper.getTopFrameForRequest(channel);
       if (topFrame && topFrame === this.topFrame) {
         return true;
       }
     }
 
     if (this.appId) {
-      let appId = NetworkHelper.getAppIdForRequest(aChannel);
+      let appId = NetworkHelper.getAppIdForRequest(channel);
       if (appId && appId == this.appId) {
         return true;
       }
     }
 
     // The following check is necessary because beacon channels don't come
     // associated with a load group. Bug 1160837 will hopefully introduce a
     // platform fix that will render the following code entirely useless.
-    if (aChannel.loadInfo &&
-        aChannel.loadInfo.externalContentPolicyType == Ci.nsIContentPolicy.TYPE_BEACON) {
+    if (channel.loadInfo &&
+        channel.loadInfo.externalContentPolicyType ==
+        Ci.nsIContentPolicy.TYPE_BEACON) {
       let nonE10sMatch = this.window &&
-                         aChannel.loadInfo.loadingDocument === this.window.document;
+          channel.loadInfo.loadingDocument === this.window.document;
+      const loadingPrincipal = channel.loadInfo.loadingPrincipal;
       let e10sMatch = this.topFrame &&
-                      this.topFrame.contentPrincipal &&
-                      this.topFrame.contentPrincipal.equals(aChannel.loadInfo.loadingPrincipal) &&
-                      this.topFrame.contentPrincipal.URI.spec == aChannel.referrer.spec;
-      let b2gMatch = this.appId &&
-                     aChannel.loadInfo.loadingPrincipal.appId === this.appId;
+          this.topFrame.contentPrincipal &&
+          this.topFrame.contentPrincipal.equals(loadingPrincipal) &&
+          this.topFrame.contentPrincipal.URI.spec == channel.referrer.spec;
+      let b2gMatch = this.appId && loadingPrincipal.appId === this.appId;
       if (nonE10sMatch || e10sMatch || b2gMatch) {
         return true;
       }
     }
 
     return false;
   },
 
   /**
    *
    */
-  _createNetworkEvent: function(aChannel, { timestamp, extraStringData, fromCache, fromServiceWorker }) {
-    let win = NetworkHelper.getWindowForRequest(aChannel);
-    let httpActivity = this.createActivityObject(aChannel);
+  _createNetworkEvent: function(channel, { timestamp, extraStringData,
+                                           fromCache, fromServiceWorker }) {
+    let win = NetworkHelper.getWindowForRequest(channel);
+    let httpActivity = this.createActivityObject(channel);
 
-    // see NM__onRequestBodySent()
+    // see _onRequestBodySent()
     httpActivity.charset = win ? win.document.characterSet : null;
 
-    aChannel.QueryInterface(Ci.nsIPrivateBrowsingChannel);
-    httpActivity.private = aChannel.isChannelPrivate;
+    channel.QueryInterface(Ci.nsIPrivateBrowsingChannel);
+    httpActivity.private = channel.isChannelPrivate;
 
     if (timestamp) {
       httpActivity.timings.REQUEST_HEADER = {
         first: timestamp,
         last: timestamp
       };
     }
 
     let event = {};
-    event.method = aChannel.requestMethod;
-    event.url = aChannel.URI.spec;
+    event.method = channel.requestMethod;
+    event.url = channel.URI.spec;
     event.private = httpActivity.private;
     event.headersSize = 0;
-    event.startedDateTime = (timestamp ? new Date(Math.round(timestamp / 1000)) : new Date()).toISOString();
+    event.startedDateTime =
+      (timestamp ? new Date(Math.round(timestamp / 1000)) : new Date())
+      .toISOString();
     event.fromCache = fromCache;
     event.fromServiceWorker = fromServiceWorker;
     httpActivity.fromServiceWorker = fromServiceWorker;
 
     if (extraStringData) {
       event.headersSize = extraStringData.length;
     }
 
     // Determine if this is an XHR request.
     httpActivity.isXHR = event.isXHR =
-        (aChannel.loadInfo.externalContentPolicyType === Ci.nsIContentPolicy.TYPE_XMLHTTPREQUEST ||
-         aChannel.loadInfo.externalContentPolicyType === Ci.nsIContentPolicy.TYPE_FETCH);
+      (channel.loadInfo.externalContentPolicyType ===
+       Ci.nsIContentPolicy.TYPE_XMLHTTPREQUEST ||
+       channel.loadInfo.externalContentPolicyType ===
+       Ci.nsIContentPolicy.TYPE_FETCH);
 
     // Determine the HTTP version.
     let httpVersionMaj = {};
     let httpVersionMin = {};
-    aChannel.QueryInterface(Ci.nsIHttpChannelInternal);
-    aChannel.getRequestVersion(httpVersionMaj, httpVersionMin);
+    channel.QueryInterface(Ci.nsIHttpChannelInternal);
+    channel.getRequestVersion(httpVersionMaj, httpVersionMin);
 
     event.httpVersion = "HTTP/" + httpVersionMaj.value + "." +
                                   httpVersionMin.value;
 
     event.discardRequestBody = !this.saveRequestAndResponseBodies;
     event.discardResponseBody = !this.saveRequestAndResponseBodies;
 
     let headers = [];
     let cookies = [];
     let cookieHeader = null;
 
     // Copy the request header data.
-    aChannel.visitRequestHeaders({
-      visitHeader: function NM__visitHeader(aName, aValue)
-      {
-        if (aName == "Cookie") {
-          cookieHeader = aValue;
+    channel.visitRequestHeaders({
+      visitHeader: function(name, value) {
+        if (name == "Cookie") {
+          cookieHeader = value;
         }
-        headers.push({ name: aName, value: aValue });
+        headers.push({ name: name, value: value });
       }
     });
 
     if (cookieHeader) {
       cookies = NetworkHelper.parseCookieHeader(cookieHeader);
     }
 
-    httpActivity.owner = this.owner.onNetworkEvent(event, aChannel);
+    httpActivity.owner = this.owner.onNetworkEvent(event, channel);
 
     this._setupResponseListener(httpActivity);
 
     httpActivity.owner.addRequestHeaders(headers, extraStringData);
     httpActivity.owner.addRequestCookies(cookies);
 
     this.openRequests[httpActivity.id] = httpActivity;
     return httpActivity;
@@ -921,291 +921,281 @@ NetworkMonitor.prototype = {
 
   /**
    * Handler for ACTIVITY_SUBTYPE_REQUEST_HEADER. When a request starts the
    * headers are sent to the server. This method creates the |httpActivity|
    * object where we store the request and response information that is
    * collected through its lifetime.
    *
    * @private
-   * @param nsIHttpChannel aChannel
-   * @param number aTimestamp
-   * @param string aExtraStringData
+   * @param nsIHttpChannel channel
+   * @param number timestamp
+   * @param string extraStringData
    * @return void
    */
-  _onRequestHeader:
-  function NM__onRequestHeader(aChannel, aTimestamp, aExtraStringData)
-  {
-    if (!this._matchRequest(aChannel)) {
+  _onRequestHeader: function(channel, timestamp, extraStringData) {
+    if (!this._matchRequest(channel)) {
       return;
     }
 
-    this._createNetworkEvent(aChannel, { timestamp: aTimestamp,
-                                         extraStringData: aExtraStringData });
+    this._createNetworkEvent(channel, { timestamp: timestamp,
+                                         extraStringData: extraStringData });
   },
 
   /**
    * Create the empty HTTP activity object. This object is used for storing all
    * the request and response information.
    *
    * This is a HAR-like object. Conformance to the spec is not guaranteed at
    * this point.
    *
    * TODO: Bug 708717 - Add support for network log export to HAR
    *
    * @see http://www.softwareishard.com/blog/har-12-spec
-   * @param nsIHttpChannel aChannel
+   * @param nsIHttpChannel channel
    *        The HTTP channel for which the HTTP activity object is created.
    * @return object
    *         The new HTTP activity object.
    */
-  createActivityObject: function NM_createActivityObject(aChannel)
-  {
+  createActivityObject: function(channel) {
     return {
       id: gSequenceId(),
-      channel: aChannel,
-      charset: null, // see NM__onRequestHeader()
-      url: aChannel.URI.spec,
-      hostname: aChannel.URI.host, // needed for host specific security info
+      channel: channel,
+      // see _onRequestHeader()
+      charset: null,
+      url: channel.URI.spec,
+      // needed for host specific security info
+      hostname: channel.URI.host,
       discardRequestBody: !this.saveRequestAndResponseBodies,
       discardResponseBody: !this.saveRequestAndResponseBodies,
-      timings: {}, // internal timing information, see NM_observeActivity()
-      responseStatus: null, // see NM__onResponseHeader()
-      owner: null, // the activity owner which is notified when changes happen
+      // internal timing information, see observeActivity()
+      timings: {},
+      // see _onResponseHeader()
+      responseStatus: null,
+      // the activity owner which is notified when changes happen
+      owner: null,
     };
   },
 
   /**
    * Setup the network response listener for the given HTTP activity. The
    * NetworkResponseListener is responsible for storing the response body.
    *
    * @private
-   * @param object aHttpActivity
+   * @param object httpActivity
    *        The HTTP activity object we are tracking.
    */
-  _setupResponseListener: function NM__setupResponseListener(aHttpActivity)
-  {
-    let channel = aHttpActivity.channel;
+  _setupResponseListener: function(httpActivity) {
+    let channel = httpActivity.channel;
     channel.QueryInterface(Ci.nsITraceableChannel);
 
     // The response will be written into the outputStream of this pipe.
     // This allows us to buffer the data we are receiving and read it
     // asynchronously.
     // Both ends of the pipe must be blocking.
     let sink = Cc["@mozilla.org/pipe;1"].createInstance(Ci.nsIPipe);
 
     // The streams need to be blocking because this is required by the
     // stream tee.
     sink.init(false, false, this.responsePipeSegmentSize, PR_UINT32_MAX, null);
 
     // Add listener for the response body.
-    let newListener = new NetworkResponseListener(this, aHttpActivity);
+    let newListener = new NetworkResponseListener(this, httpActivity);
 
     // Remember the input stream, so it isn't released by GC.
     newListener.inputStream = sink.inputStream;
     newListener.sink = sink;
 
-    let tee = Cc["@mozilla.org/network/stream-listener-tee;1"].
-              createInstance(Ci.nsIStreamListenerTee);
+    let tee = Cc["@mozilla.org/network/stream-listener-tee;1"]
+              .createInstance(Ci.nsIStreamListenerTee);
 
     let originalListener = channel.setNewListener(tee);
 
     tee.init(originalListener, sink.outputStream, newListener);
   },
 
   /**
    * Handler for ACTIVITY_SUBTYPE_REQUEST_BODY_SENT. The request body is logged
    * here.
    *
    * @private
-   * @param object aHttpActivity
+   * @param object httpActivity
    *        The HTTP activity object we are working with.
    */
-  _onRequestBodySent: function NM__onRequestBodySent(aHttpActivity)
-  {
-    if (aHttpActivity.discardRequestBody) {
+  _onRequestBodySent: function(httpActivity) {
+    if (httpActivity.discardRequestBody) {
       return;
     }
 
-    let sentBody = NetworkHelper.
-                   readPostTextFromRequest(aHttpActivity.channel,
-                                           aHttpActivity.charset);
+    let sentBody = NetworkHelper.readPostTextFromRequest(httpActivity.channel,
+                                                         httpActivity.charset);
 
     if (!sentBody && this.window &&
-        aHttpActivity.url == this.window.location.href) {
+        httpActivity.url == this.window.location.href) {
       // If the request URL is the same as the current page URL, then
       // we can try to get the posted text from the page directly.
       // This check is necessary as otherwise the
       //   NetworkHelper.readPostTextFromPageViaWebNav()
       // function is called for image requests as well but these
       // are not web pages and as such don't store the posted text
       // in the cache of the webpage.
-      let webNav = this.window.QueryInterface(Ci.nsIInterfaceRequestor).
-                   getInterface(Ci.nsIWebNavigation);
-      sentBody = NetworkHelper.
-                 readPostTextFromPageViaWebNav(webNav, aHttpActivity.charset);
+      let webNav = this.window.QueryInterface(Ci.nsIInterfaceRequestor)
+                   .getInterface(Ci.nsIWebNavigation);
+      sentBody = NetworkHelper
+                 .readPostTextFromPageViaWebNav(webNav, httpActivity.charset);
     }
 
     if (sentBody) {
-      aHttpActivity.owner.addRequestPostData({ text: sentBody });
+      httpActivity.owner.addRequestPostData({ text: sentBody });
     }
   },
 
   /**
    * Handler for ACTIVITY_SUBTYPE_RESPONSE_HEADER. This method stores
    * information about the response headers.
    *
    * @private
-   * @param object aHttpActivity
+   * @param object httpActivity
    *        The HTTP activity object we are working with.
-   * @param string aExtraStringData
+   * @param string extraStringData
    *        The uncached response headers.
    */
-  _onResponseHeader:
-  function NM__onResponseHeader(aHttpActivity, aExtraStringData)
-  {
-    // aExtraStringData contains the uncached response headers. The first line
+  _onResponseHeader: function(httpActivity, extraStringData) {
+    // extraStringData contains the uncached response headers. The first line
     // contains the response status (e.g. HTTP/1.1 200 OK).
     //
     // Note: The response header is not saved here. Calling the
     // channel.visitResponseHeaders() method at this point sometimes causes an
     // NS_ERROR_NOT_AVAILABLE exception.
     //
-    // We could parse aExtraStringData to get the headers and their values, but
+    // We could parse extraStringData to get the headers and their values, but
     // that is not trivial to do in an accurate manner. Hence, we save the
     // response headers in this._httpResponseExaminer().
 
-    let headers = aExtraStringData.split(/\r\n|\n|\r/);
+    let headers = extraStringData.split(/\r\n|\n|\r/);
     let statusLine = headers.shift();
     let statusLineArray = statusLine.split(" ");
 
     let response = {};
     response.httpVersion = statusLineArray.shift();
-    response.remoteAddress = aHttpActivity.channel.remoteAddress;
-    response.remotePort = aHttpActivity.channel.remotePort;
+    response.remoteAddress = httpActivity.channel.remoteAddress;
+    response.remotePort = httpActivity.channel.remotePort;
     response.status = statusLineArray.shift();
     response.statusText = statusLineArray.join(" ");
-    response.headersSize = aExtraStringData.length;
+    response.headersSize = extraStringData.length;
 
-    aHttpActivity.responseStatus = response.status;
+    httpActivity.responseStatus = response.status;
 
     // Discard the response body for known response statuses.
-    switch (parseInt(response.status)) {
+    switch (parseInt(response.status, 10)) {
       case HTTP_MOVED_PERMANENTLY:
       case HTTP_FOUND:
       case HTTP_SEE_OTHER:
       case HTTP_TEMPORARY_REDIRECT:
-        aHttpActivity.discardResponseBody = true;
+        httpActivity.discardResponseBody = true;
         break;
     }
 
-    response.discardResponseBody = aHttpActivity.discardResponseBody;
+    response.discardResponseBody = httpActivity.discardResponseBody;
 
-    aHttpActivity.owner.addResponseStart(response, aExtraStringData);
+    httpActivity.owner.addResponseStart(response, extraStringData);
   },
 
   /**
    * Handler for ACTIVITY_SUBTYPE_TRANSACTION_CLOSE. This method updates the HAR
    * timing information on the HTTP activity object and clears the request
    * from the list of known open requests.
    *
    * @private
-   * @param object aHttpActivity
+   * @param object httpActivity
    *        The HTTP activity object we work with.
    */
-  _onTransactionClose: function NM__onTransactionClose(aHttpActivity)
-  {
-    let result = this._setupHarTimings(aHttpActivity);
-    aHttpActivity.owner.addEventTimings(result.total, result.timings);
-    delete this.openRequests[aHttpActivity.id];
+  _onTransactionClose: function(httpActivity) {
+    let result = this._setupHarTimings(httpActivity);
+    httpActivity.owner.addEventTimings(result.total, result.timings);
+    delete this.openRequests[httpActivity.id];
   },
 
   /**
    * Update the HTTP activity object to include timing information as in the HAR
    * spec. The HTTP activity object holds the raw timing information in
    * |timings| - these are timings stored for each activity notification. The
    * HAR timing information is constructed based on these lower level
    * data.
    *
-   * @param object aHttpActivity
+   * @param object httpActivity
    *        The HTTP activity object we are working with.
    * @param boolean fromCache
    *        Indicates that the result was returned from the browser cache
    * @return object
    *         This object holds two properties:
    *         - total - the total time for all of the request and response.
    *         - timings - the HAR timings object.
    */
-  _setupHarTimings: function NM__setupHarTimings(aHttpActivity, fromCache)
-  {
+  _setupHarTimings: function(httpActivity, fromCache) {
     if (fromCache) {
       // If it came from the browser cache, we have no timing
       // information and these should all be 0
       return {
         total: 0,
         timings: {
           blocked: 0,
           dns: 0,
           connect: 0,
           send: 0,
           wait: 0,
           receive: 0
         }
       };
     }
 
-    let timings = aHttpActivity.timings;
+    let timings = httpActivity.timings;
     let harTimings = {};
 
     // Not clear how we can determine "blocked" time.
     harTimings.blocked = -1;
 
     // DNS timing information is available only in when the DNS record is not
     // cached.
     harTimings.dns = timings.STATUS_RESOLVING && timings.STATUS_RESOLVED ?
                      timings.STATUS_RESOLVED.last -
                      timings.STATUS_RESOLVING.first : -1;
 
     if (timings.STATUS_CONNECTING_TO && timings.STATUS_CONNECTED_TO) {
       harTimings.connect = timings.STATUS_CONNECTED_TO.last -
                            timings.STATUS_CONNECTING_TO.first;
-    }
-    else if (timings.STATUS_SENDING_TO) {
+    } else if (timings.STATUS_SENDING_TO) {
       harTimings.connect = timings.STATUS_SENDING_TO.first -
                            timings.REQUEST_HEADER.first;
-    }
-    else {
+    } else {
       harTimings.connect = -1;
     }
 
     if ((timings.STATUS_WAITING_FOR || timings.STATUS_RECEIVING_FROM) &&
         (timings.STATUS_CONNECTED_TO || timings.STATUS_SENDING_TO)) {
       harTimings.send = (timings.STATUS_WAITING_FOR ||
                          timings.STATUS_RECEIVING_FROM).first -
                         (timings.STATUS_CONNECTED_TO ||
                          timings.STATUS_SENDING_TO).last;
-    }
-    else {
+    } else {
       harTimings.send = -1;
     }
 
     if (timings.RESPONSE_START) {
       harTimings.wait = timings.RESPONSE_START.first -
                         (timings.REQUEST_BODY_SENT ||
                          timings.STATUS_SENDING_TO).last;
-    }
-    else {
+    } else {
       harTimings.wait = -1;
     }
 
     if (timings.RESPONSE_START && timings.RESPONSE_COMPLETE) {
       harTimings.receive = timings.RESPONSE_COMPLETE.last -
                            timings.RESPONSE_START.first;
-    }
-    else {
+    } else {
       harTimings.receive = -1;
     }
 
     let totalTime = 0;
     for (let timing in harTimings) {
       let time = Math.max(Math.round(harTimings[timing] / 1000), -1);
       harTimings[timing] = time;
       if (time > -1) {
@@ -1218,18 +1208,17 @@ NetworkMonitor.prototype = {
       timings: harTimings,
     };
   },
 
   /**
    * Suspend Web Console activity. This is called when all Web Consoles are
    * closed.
    */
-  destroy: function NM_destroy()
-  {
+  destroy: function() {
     if (Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT) {
       gActivityDistributor.removeObserver(this);
       Services.obs.removeObserver(this._httpResponseExaminer,
                                   "http-on-examine-response");
       Services.obs.removeObserver(this._httpResponseExaminer,
                                   "http-on-examine-cached-response");
     }
 
@@ -1238,18 +1227,17 @@ NetworkMonitor.prototype = {
 
     this.interceptedChannels.clear();
     this.openRequests = {};
     this.openResponses = {};
     this.owner = null;
     this.window = null;
     this.topFrame = null;
   },
-}; // NetworkMonitor.prototype
-
+};
 
 /**
  * The NetworkMonitorChild is used to proxy all of the network activity of the
  * child app process from the main process. The child WebConsoleActor creates an
  * instance of this object.
  *
  * Network requests for apps happen in the main process. As such,
  * a NetworkMonitor instance is used by the WebappsActor in the main process to
@@ -1320,45 +1308,48 @@ NetworkMonitorChild.prototype = {
     this._netEvents.set(id, Cu.getWeakReference(actor));
   }),
 
   _onUpdateEvent: DevToolsUtils.makeInfallible(function _onUpdateEvent(msg) {
     let {id, method, args} = msg.data;
     let weakActor = this._netEvents.get(id);
     let actor = weakActor ? weakActor.get() : null;
     if (!actor) {
-      Cu.reportError("Received debug:netmonitor:updateEvent for unknown event ID: " + id);
+      Cu.reportError("Received debug:netmonitor:updateEvent for unknown " +
+                     "event ID: " + id);
       return;
     }
     if (!(method in actor)) {
-      Cu.reportError("Received debug:netmonitor:updateEvent unsupported method: " + method);
+      Cu.reportError("Received debug:netmonitor:updateEvent unsupported " +
+                     "method: " + method);
       return;
     }
     actor[method].apply(actor, args);
   }),
 
   destroy: function() {
     let mm = this._messageManager;
     try {
       mm.removeMessageListener("debug:netmonitor:" + this.connID + ":newEvent",
                                this._onNewEvent);
-      mm.removeMessageListener("debug:netmonitor:" + this.connID + ":updateEvent",
+      mm.removeMessageListener("debug:netmonitor:" + this.connID +
+                               ":updateEvent",
                                this._onUpdateEvent);
-    } catch(e) {
+    } catch (e) {
       // On b2g, when registered to a new root docshell,
       // all message manager functions throw when trying to call them during
       // message-manager-disconnect event.
       // As there is no attribute/method on message manager to know
       // if they are still usable or not, we can only catch the exception...
     }
     this._netEvents.clear();
     this._messageManager = null;
     this.owner = null;
   },
-}; // NetworkMonitorChild.prototype
+};
 
 /**
  * The NetworkEventActorProxy is used to send network request information from
  * the main process to the child app process. One proxy is used per request.
  * Similarly, one NetworkEventActor in the child app process is used per
  * request. The client receives all network logs from the child actors.
  *
  * The child process has a NetworkMonitorChild instance that is listening for
@@ -1396,18 +1387,17 @@ NetworkEventActorProxy.prototype = {
    * Initialize the network event. This method sends the network request event
    * to the content process.
    *
    * @param object event
    *        Object describing the network request.
    * @return object
    *         This object.
    */
-  init: DevToolsUtils.makeInfallible(function(event)
-  {
+  init: DevToolsUtils.makeInfallible(function(event) {
     let mm = this.messageManager;
     mm.sendAsyncMessage("debug:netmonitor:" + this.connID + ":newEvent", {
       id: this.id,
       event: event,
     });
     return this;
   }),
 };
@@ -1418,32 +1408,31 @@ NetworkEventActorProxy.prototype = {
                  "addResponseStart", "addSecurityInfo", "addResponseHeaders",
                  "addResponseCookies", "addResponseContent", "addEventTimings"];
   let factory = NetworkEventActorProxy.methodFactory;
   for (let method of methods) {
     NetworkEventActorProxy.prototype[method] = factory(method);
   }
 })();
 
-
 /**
  * The NetworkMonitor manager used by the Webapps actor in the main process.
  * This object uses the message manager to listen for requests from the child
  * process to start/stop the network monitor.
  *
  * @constructor
  * @param nsIDOMElement frame
  *        The browser frame to work with (mozbrowser).
  * @param string id
  *        Instance identifier to use for messages.
  */
-function NetworkMonitorManager(frame, id)
-{
+function NetworkMonitorManager(frame, id) {
   this.id = id;
-  let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
+  let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader
+      .messageManager;
   this.messageManager = mm;
   this.frame = frame;
   this.onNetMonitorMessage = this.onNetMonitorMessage.bind(this);
   this.onNetworkEvent = this.onNetworkEvent.bind(this);
 
   mm.addMessageListener("debug:netmonitor:" + id, this.onNetMonitorMessage);
 }
 exports.NetworkMonitorManager = NetworkMonitorManager;
@@ -1455,17 +1444,17 @@ NetworkMonitorManager.prototype = {
 
   /**
    * Handler for "debug:monitor" messages received through the message manager
    * from the content process.
    *
    * @param object msg
    *        Message from the content.
    */
-  onNetMonitorMessage: DevToolsUtils.makeInfallible(function _onNetMonitorMessage(msg) {
+  onNetMonitorMessage: DevToolsUtils.makeInfallible(function(msg) {
     let { action, appId } = msg.json;
     // Pipe network monitor data from parent to child via the message manager.
     switch (action) {
       case "start":
         if (!this.netMonitor) {
           this.netMonitor = new NetworkMonitor({
             topFrame: this.frame,
             appId: appId,
@@ -1506,51 +1495,48 @@ NetworkMonitorManager.prototype = {
    * @return object
    *         A NetworkEventActorProxy instance which is notified when further
    *         data about the request is available.
    */
   onNetworkEvent: DevToolsUtils.makeInfallible(function _onNetworkEvent(event) {
     return new NetworkEventActorProxy(this.messageManager, this.id).init(event);
   }),
 
-  destroy: function()
-  {
+  destroy: function() {
     if (this.messageManager) {
       this.messageManager.removeMessageListener("debug:netmonitor:" + this.id,
                                                 this.onNetMonitorMessage);
     }
     this.messageManager = null;
     this.filters = null;
 
     if (this.netMonitor) {
       this.netMonitor.destroy();
       this.netMonitor = null;
     }
   },
-}; // NetworkMonitorManager.prototype
-
+};
 
 /**
  * A WebProgressListener that listens for location changes.
  *
  * This progress listener is used to track file loads and other kinds of
  * location changes.
  *
  * @constructor
- * @param object aWindow
+ * @param object window
  *        The window for which we need to track location changes.
- * @param object aOwner
+ * @param object owner
  *        The listener owner which needs to implement two methods:
  *        - onFileActivity(aFileURI)
  *        - onLocationChange(aState, aTabURI, aPageTitle)
  */
-function ConsoleProgressListener(aWindow, aOwner)
-{
-  this.window = aWindow;
-  this.owner = aOwner;
+function ConsoleProgressListener(window, owner) {
+  this.window = window;
+  this.owner = owner;
 }
 exports.ConsoleProgressListener = ConsoleProgressListener;
 
 ConsoleProgressListener.prototype = {
   /**
    * Constant used for startMonitor()/stopMonitor() that tells you want to
    * monitor file loads.
    */
@@ -1587,18 +1573,17 @@ ConsoleProgressListener.prototype = {
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
                                          Ci.nsISupportsWeakReference]),
 
   /**
    * Initialize the ConsoleProgressListener.
    * @private
    */
-  _init: function CPL__init()
-  {
+  _init: function() {
     if (this._initialized) {
       return;
     }
 
     this._webProgress = this.window.QueryInterface(Ci.nsIInterfaceRequestor)
                         .getInterface(Ci.nsIWebNavigation)
                         .QueryInterface(Ci.nsIWebProgress);
     this._webProgress.addProgressListener(this,
@@ -1606,164 +1591,154 @@ ConsoleProgressListener.prototype = {
 
     this._initialized = true;
   },
 
   /**
    * Start a monitor/tracker related to the current nsIWebProgressListener
    * instance.
    *
-   * @param number aMonitor
+   * @param number monitor
    *        Tells what you want to track. Available constants:
    *        - this.MONITOR_FILE_ACTIVITY
    *          Track file loads.
    *        - this.MONITOR_LOCATION_CHANGE
    *          Track location changes for the top window.
    */
-  startMonitor: function CPL_startMonitor(aMonitor)
-  {
-    switch (aMonitor) {
+  startMonitor: function(monitor) {
+    switch (monitor) {
       case this.MONITOR_FILE_ACTIVITY:
         this._fileActivity = true;
         break;
       case this.MONITOR_LOCATION_CHANGE:
         this._locationChange = true;
         break;
       default:
         throw new Error("ConsoleProgressListener: unknown monitor type " +
-                        aMonitor + "!");
+                        monitor + "!");
     }
     this._init();
   },
 
   /**
    * Stop a monitor.
    *
-   * @param number aMonitor
+   * @param number monitor
    *        Tells what you want to stop tracking. See this.startMonitor() for
    *        the list of constants.
    */
-  stopMonitor: function CPL_stopMonitor(aMonitor)
-  {
-    switch (aMonitor) {
+  stopMonitor: function(monitor) {
+    switch (monitor) {
       case this.MONITOR_FILE_ACTIVITY:
         this._fileActivity = false;
         break;
       case this.MONITOR_LOCATION_CHANGE:
         this._locationChange = false;
         break;
       default:
         throw new Error("ConsoleProgressListener: unknown monitor type " +
-                        aMonitor + "!");
+                        monitor + "!");
     }
 
     if (!this._fileActivity && !this._locationChange) {
       this.destroy();
     }
   },
 
-  onStateChange:
-  function CPL_onStateChange(aProgress, aRequest, aState, aStatus)
-  {
+  onStateChange: function(progress, request, state, status) {
     if (!this.owner) {
       return;
     }
 
     if (this._fileActivity) {
-      this._checkFileActivity(aProgress, aRequest, aState, aStatus);
+      this._checkFileActivity(progress, request, state, status);
     }
 
     if (this._locationChange) {
-      this._checkLocationChange(aProgress, aRequest, aState, aStatus);
+      this._checkLocationChange(progress, request, state, status);
     }
   },
 
   /**
    * Check if there is any file load, given the arguments of
    * nsIWebProgressListener.onStateChange. If the state change tells that a file
    * URI has been loaded, then the remote Web Console instance is notified.
    * @private
    */
-  _checkFileActivity:
-  function CPL__checkFileActivity(aProgress, aRequest, aState, aStatus)
-  {
-    if (!(aState & Ci.nsIWebProgressListener.STATE_START)) {
+  _checkFileActivity: function(progress, request, state, status) {
+    if (!(state & Ci.nsIWebProgressListener.STATE_START)) {
       return;
     }
 
     let uri = null;
-    if (aRequest instanceof Ci.imgIRequest) {
-      let imgIRequest = aRequest.QueryInterface(Ci.imgIRequest);
+    if (request instanceof Ci.imgIRequest) {
+      let imgIRequest = request.QueryInterface(Ci.imgIRequest);
       uri = imgIRequest.URI;
-    }
-    else if (aRequest instanceof Ci.nsIChannel) {
-      let nsIChannel = aRequest.QueryInterface(Ci.nsIChannel);
+    } else if (request instanceof Ci.nsIChannel) {
+      let nsIChannel = request.QueryInterface(Ci.nsIChannel);
       uri = nsIChannel.URI;
     }
 
     if (!uri || !uri.schemeIs("file") && !uri.schemeIs("ftp")) {
       return;
     }
 
     this.owner.onFileActivity(uri.spec);
   },
 
   /**
    * Check if the current window.top location is changing, given the arguments
    * of nsIWebProgressListener.onStateChange. If that is the case, the remote
    * Web Console instance is notified.
    * @private
    */
-  _checkLocationChange:
-  function CPL__checkLocationChange(aProgress, aRequest, aState, aStatus)
-  {
-    let isStart = aState & Ci.nsIWebProgressListener.STATE_START;
-    let isStop = aState & Ci.nsIWebProgressListener.STATE_STOP;
-    let isNetwork = aState & Ci.nsIWebProgressListener.STATE_IS_NETWORK;
-    let isWindow = aState & Ci.nsIWebProgressListener.STATE_IS_WINDOW;
+  _checkLocationChange: function(progress, request, state) {
+    let isStart = state & Ci.nsIWebProgressListener.STATE_START;
+    let isStop = state & Ci.nsIWebProgressListener.STATE_STOP;
+    let isNetwork = state & Ci.nsIWebProgressListener.STATE_IS_NETWORK;
+    let isWindow = state & Ci.nsIWebProgressListener.STATE_IS_WINDOW;
 
     // Skip non-interesting states.
-    if (!isNetwork || !isWindow || aProgress.DOMWindow != this.window) {
+    if (!isNetwork || !isWindow || progress.DOMWindow != this.window) {
       return;
     }
 
-    if (isStart && aRequest instanceof Ci.nsIChannel) {
-      this.owner.onLocationChange("start", aRequest.URI.spec, "");
-    }
-    else if (isStop) {
+    if (isStart && request instanceof Ci.nsIChannel) {
+      this.owner.onLocationChange("start", request.URI.spec, "");
+    } else if (isStop) {
       this.owner.onLocationChange("stop", this.window.location.href,
                                   this.window.document.title);
     }
   },
 
   onLocationChange: function() {},
   onStatusChange: function() {},
   onProgressChange: function() {},
   onSecurityChange: function() {},
 
   /**
    * Destroy the ConsoleProgressListener.
    */
-  destroy: function CPL_destroy()
-  {
+  destroy: function() {
     if (!this._initialized) {
       return;
     }
 
     this._initialized = false;
     this._fileActivity = false;
     this._locationChange = false;
 
     try {
       this._webProgress.removeProgressListener(this);
-    }
-    catch (ex) {
+    } catch (ex) {
       // This can throw during browser shutdown.
     }
 
     this._webProgress = null;
     this.window = null;
     this.owner = null;
   },
-}; // ConsoleProgressListener.prototype
+};
 
-function gSequenceId() { return gSequenceId.n++; }
+function gSequenceId() {
+  return gSequenceId.n++;
+}
 gSequenceId.n = 1;
--- a/devtools/shared/webconsole/server-logger-monitor.js
+++ b/devtools/shared/webconsole/server-logger-monitor.js
@@ -13,29 +13,30 @@ const {DebuggerServer} = require("devtoo
 const {makeInfallible} = require("devtools/shared/DevToolsUtils");
 
 loader.lazyGetter(this, "NetworkHelper", () => require("devtools/shared/webconsole/network-helper"));
 
 // Helper tracer. Should be generic sharable by other modules (bug 1171927)
 const trace = {
   log: function(...args) {
   }
-}
+};
 
 const acceptableHeaders = ["x-chromelogger-data"];
 
 /**
  * This object represents HTTP events observer. It's intended to be
  * used in e10s enabled browser only.
  *
  * Since child processes can't register HTTP event observer they use
  * this module to do the observing in the parent process. This monitor
- * is loaded through DebuggerServerConnection.setupInParent() that is executed
- * from within the child process. The execution is done by {@ServerLoggingListener}.
- * The monitor listens to HTTP events and forwards it into the right child process.
+ * is loaded through DebuggerServerConnection.setupInParent() that is
+ * executed from within the child process. The execution is done by
+ * {@ServerLoggingListener}.  The monitor listens to HTTP events and
+ * forwards it into the right child process.
  *
  * Read more about the architecture:
  * https://github.com/mozilla/gecko-dev/blob/fx-team/devtools/server/docs/actor-e10s-handling.md
  */
 var ServerLoggerMonitor = {
   // Initialization
 
   initialize: function() {
@@ -154,17 +155,18 @@ var ServerLoggerMonitor = {
 
     trace.log("ServerLoggerMonitor.onExamineResponse; ", httpChannel.name,
       this.targets);
 
     // Ignore requests from chrome or add-on code when we are monitoring
     // content.
     if (!httpChannel.loadInfo &&
         httpChannel.loadInfo.loadingDocument === null &&
-        httpChannel.loadInfo.loadingPrincipal === Services.scriptSecurityManager.getSystemPrincipal()) {
+        httpChannel.loadInfo.loadingPrincipal ===
+        Services.scriptSecurityManager.getSystemPrincipal()) {
       return;
     }
 
     let requestFrame = NetworkHelper.getTopFrameForRequest(httpChannel);
     if (!requestFrame) {
       return;
     }
 
--- a/devtools/shared/webconsole/server-logger.js
+++ b/devtools/shared/webconsole/server-logger.js
@@ -148,17 +148,18 @@ var ServerLoggingListener = Class({
       return;
     }
 
     let method = msg.data.method;
     trace.log("ServerLogger.onParentMessage; ", method, msg.data);
 
     switch (method) {
       case "examineHeaders":
-        return this.onExamineHeaders(msg);
+        this.onExamineHeaders(msg);
+        break;
       default:
         trace.log("Unknown method name: ", method);
     }
   }),
 
   // HTTP Observer
 
   onExamineHeaders: function(event) {
@@ -214,40 +215,41 @@ var ServerLoggingListener = Class({
     });
   }),
 
   /**
    * Check if a given network request should be logged by this network monitor
    * instance based on the current filters.
    *
    * @private
-   * @param nsIHttpChannel aChannel
+   * @param nsIHttpChannel channel
    *        Request to check.
    * @return boolean
    *         True if the network request should be logged, false otherwise.
    */
-  _matchRequest: function(aChannel) {
+  _matchRequest: function(channel) {
     trace.log("_matchRequest ", this.window, ", ", this.topFrame);
 
     // Log everything if the window is null (it's null in the browser context)
     if (!this.window) {
       return true;
     }
 
     // Ignore requests from chrome or add-on code when we are monitoring
     // content.
-    if (!aChannel.loadInfo &&
-        aChannel.loadInfo.loadingDocument === null &&
-        aChannel.loadInfo.loadingPrincipal === Services.scriptSecurityManager.getSystemPrincipal()) {
+    if (!channel.loadInfo &&
+        channel.loadInfo.loadingDocument === null &&
+        channel.loadInfo.loadingPrincipal ===
+        Services.scriptSecurityManager.getSystemPrincipal()) {
       return false;
     }
 
     // Since frames support, this.window may not be the top level content
     // frame, so that we can't only compare with win.top.
-    let win = NetworkHelper.getWindowForRequest(aChannel);
+    let win = NetworkHelper.getWindowForRequest(channel);
     while (win) {
       if (win == this.window) {
         return true;
       }
       if (win.parent == win) {
         break;
       }
       win = win.parent;
--- a/devtools/shared/webconsole/utils.js
+++ b/devtools/shared/webconsole/utils.js
@@ -10,53 +10,51 @@ const {Cc, Ci, Cu, components} = require
 const {isWindowIncluded} = require("devtools/shared/layout/utils");
 const Services = require("Services");
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 // TODO: Bug 842672 - browser/ imports modules from toolkit/.
 // Note that these are only used in WebConsoleCommands, see $0 and pprint().
 loader.lazyImporter(this, "VariablesView", "resource://devtools/client/shared/widgets/VariablesView.jsm");
-const DevToolsUtils = require("devtools/shared/DevToolsUtils");
 
 XPCOMUtils.defineLazyServiceGetter(this,
                                    "swm",
                                    "@mozilla.org/serviceworkers/manager;1",
                                    "nsIServiceWorkerManager");
 
 // Match the function name from the result of toString() or toSource().
 //
 // Examples:
 // (function foobar(a, b) { ...
 // function foobar2(a) { ...
 // function() { ...
 const REGEX_MATCH_FUNCTION_NAME = /^\(?function\s+([^(\s]+)\s*\(/;
 
-// Match the function arguments from the result of toString() or toSource().
-const REGEX_MATCH_FUNCTION_ARGS = /^\(?function\s*[^\s(]*\s*\((.+?)\)/;
-
 // Number of terminal entries for the self-xss prevention to go away
 const CONSOLE_ENTRY_THRESHOLD = 5;
 
-const CONSOLE_WORKER_IDS = exports.CONSOLE_WORKER_IDS = [ 'SharedWorker', 'ServiceWorker', 'Worker' ];
-
+const CONSOLE_WORKER_IDS = exports.CONSOLE_WORKER_IDS = [
+  "SharedWorker",
+  "ServiceWorker",
+  "Worker"
+];
 
 var WebConsoleUtils = {
 
   /**
    * Wrap a string in an nsISupportsString object.
    *
-   * @param string aString
+   * @param string string
    * @return nsISupportsString
    */
-  supportsString: function WCU_supportsString(aString)
-  {
-    let str = Cc["@mozilla.org/supports-string;1"].
-              createInstance(Ci.nsISupportsString);
-    str.data = aString;
+  supportsString: function(string) {
+    let str = Cc["@mozilla.org/supports-string;1"]
+              .createInstance(Ci.nsISupportsString);
+    str.data = string;
     return str;
   },
 
   /**
    * Given a message, return one of CONSOLE_WORKER_IDS if it matches
    * one of those.
    *
    * @return string
@@ -64,190 +62,180 @@ var WebConsoleUtils = {
   getWorkerType: function(message) {
     let id = message ? message.innerID : null;
     return CONSOLE_WORKER_IDS[CONSOLE_WORKER_IDS.indexOf(id)] || null;
   },
 
   /**
    * Clone an object.
    *
-   * @param object aObject
+   * @param object object
    *        The object you want cloned.
-   * @param boolean aRecursive
+   * @param boolean recursive
    *        Tells if you want to dig deeper into the object, to clone
    *        recursively.
-   * @param function [aFilter]
+   * @param function [filter]
    *        Optional, filter function, called for every property. Three
    *        arguments are passed: key, value and object. Return true if the
    *        property should be added to the cloned object. Return false to skip
    *        the property.
    * @return object
    *         The cloned object.
    */
-  cloneObject: function WCU_cloneObject(aObject, aRecursive, aFilter)
-  {
-    if (typeof aObject != "object") {
-      return aObject;
+  cloneObject: function(object, recursive, filter) {
+    if (typeof object != "object") {
+      return object;
     }
 
     let temp;
 
-    if (Array.isArray(aObject)) {
+    if (Array.isArray(object)) {
       temp = [];
-      Array.forEach(aObject, function(aValue, aIndex) {
-        if (!aFilter || aFilter(aIndex, aValue, aObject)) {
-          temp.push(aRecursive ? WCU_cloneObject(aValue) : aValue);
+      Array.forEach(object, function(value, index) {
+        if (!filter || filter(index, value, object)) {
+          temp.push(recursive ? WebConsoleUtils.cloneObject(value) : value);
         }
       });
-    }
-    else {
+    } else {
       temp = {};
-      for (let key in aObject) {
-        let value = aObject[key];
-        if (aObject.hasOwnProperty(key) &&
-            (!aFilter || aFilter(key, value, aObject))) {
-          temp[key] = aRecursive ? WCU_cloneObject(value) : value;
+      for (let key in object) {
+        let value = object[key];
+        if (object.hasOwnProperty(key) &&
+            (!filter || filter(key, value, object))) {
+          temp[key] = recursive ? WebConsoleUtils.cloneObject(value) : value;
         }
       }
     }
 
     return temp;
   },
 
   /**
    * Copies certain style attributes from one element to another.
    *
-   * @param nsIDOMNode aFrom
+   * @param nsIDOMNode from
    *        The target node.
-   * @param nsIDOMNode aTo
+   * @param nsIDOMNode to
    *        The destination node.
    */
-  copyTextStyles: function WCU_copyTextStyles(aFrom, aTo)
-  {
-    let win = aFrom.ownerDocument.defaultView;
-    let style = win.getComputedStyle(aFrom);
-    aTo.style.fontFamily = style.getPropertyCSSValue("font-family").cssText;
-    aTo.style.fontSize = style.getPropertyCSSValue("font-size").cssText;
-    aTo.style.fontWeight = style.getPropertyCSSValue("font-weight").cssText;
-    aTo.style.fontStyle = style.getPropertyCSSValue("font-style").cssText;
+  copyTextStyles: function(from, to) {
+    let win = from.ownerDocument.defaultView;
+    let style = win.getComputedStyle(from);
+    to.style.fontFamily = style.getPropertyCSSValue("font-family").cssText;
+    to.style.fontSize = style.getPropertyCSSValue("font-size").cssText;
+    to.style.fontWeight = style.getPropertyCSSValue("font-weight").cssText;
+    to.style.fontStyle = style.getPropertyCSSValue("font-style").cssText;
   },
 
   /**
    * Gets the ID of the inner window of this DOM window.
    *
-   * @param nsIDOMWindow aWindow
+   * @param nsIDOMWindow window
    * @return integer
-   *         Inner ID for the given aWindow.
+   *         Inner ID for the given window.
    */
-  getInnerWindowId: function WCU_getInnerWindowId(aWindow)
-  {
-    return aWindow.QueryInterface(Ci.nsIInterfaceRequestor).
-             getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID;
+  getInnerWindowId: function(window) {
+    return window.QueryInterface(Ci.nsIInterfaceRequestor)
+             .getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID;
   },
 
   /**
    * Recursively gather a list of inner window ids given a
    * top level window.
    *
-   * @param nsIDOMWindow aWindow
+   * @param nsIDOMWindow window
    * @return Array
    *         list of inner window ids.
    */
-  getInnerWindowIDsForFrames: function WCU_getInnerWindowIDsForFrames(aWindow)
-  {
-    let innerWindowID = this.getInnerWindowId(aWindow);
+  getInnerWindowIDsForFrames: function(window) {
+    let innerWindowID = this.getInnerWindowId(window);
     let ids = [innerWindowID];
 
-    if (aWindow.frames) {
-      for (let i = 0; i < aWindow.frames.length; i++) {
-        let frame = aWindow.frames[i];
+    if (window.frames) {
+      for (let i = 0; i < window.frames.length; i++) {
+        let frame = window.frames[i];
         ids = ids.concat(this.getInnerWindowIDsForFrames(frame));
       }
     }
 
     return ids;
   },
 
-
   /**
    * Gets the ID of the outer window of this DOM window.
    *
-   * @param nsIDOMWindow aWindow
+   * @param nsIDOMWindow window
    * @return integer
-   *         Outer ID for the given aWindow.
+   *         Outer ID for the given window.
    */
-  getOuterWindowId: function WCU_getOuterWindowId(aWindow)
-  {
-    return aWindow.QueryInterface(Ci.nsIInterfaceRequestor).
-           getInterface(Ci.nsIDOMWindowUtils).outerWindowID;
+  getOuterWindowId: function(window) {
+    return window.QueryInterface(Ci.nsIInterfaceRequestor)
+           .getInterface(Ci.nsIDOMWindowUtils).outerWindowID;
   },
 
   /**
    * Tells if the given function is native or not.
    *
-   * @param function aFunction
+   * @param function func
    *        The function you want to check if it is native or not.
    * @return boolean
    *         True if the given function is native, false otherwise.
    */
-  isNativeFunction: function WCU_isNativeFunction(aFunction)
-  {
-    return typeof aFunction == "function" && !("prototype" in aFunction);
+  isNativeFunction: function(func) {
+    return typeof func == "function" && !("prototype" in func);
   },
 
   /**
-   * Tells if the given property of the provided object is a non-native getter or
-   * not.
+   * Tells if the given property of the provided object is a
+   * non-native getter or not.
    *
-   * @param object aObject
+   * @param object object
    *        The object that contains the property.
-   * @param string aProp
+   * @param string prop
    *        The property you want to check if it is a getter or not.
    * @return boolean
    *         True if the given property is a getter, false otherwise.
    */
-  isNonNativeGetter: function WCU_isNonNativeGetter(aObject, aProp)
-  {
-    if (typeof aObject != "object") {
+  isNonNativeGetter: function(object, prop) {
+    if (typeof object != "object") {
       return false;
     }
-    let desc = this.getPropertyDescriptor(aObject, aProp);
+    let desc = this.getPropertyDescriptor(object, prop);
     return desc && desc.get && !this.isNativeFunction(desc.get);
   },
 
   /**
    * Get the property descriptor for the given object.
    *
-   * @param object aObject
+   * @param object object
    *        The object that contains the property.
-   * @param string aProp
+   * @param string prop
    *        The property you want to get the descriptor for.
    * @return object
    *         Property descriptor.
    */
-  getPropertyDescriptor: function WCU_getPropertyDescriptor(aObject, aProp)
-  {
+  getPropertyDescriptor: function(object, prop) {
     let desc = null;
-    while (aObject) {
+    while (object) {
       try {
-        if ((desc = Object.getOwnPropertyDescriptor(aObject, aProp))) {
+        if ((desc = Object.getOwnPropertyDescriptor(object, prop))) {
           break;
         }
       } catch (ex) {
         // Native getters throw here. See bug 520882.
         // null throws TypeError.
         if (ex.name != "NS_ERROR_XPC_BAD_CONVERT_JS" &&
             ex.name != "NS_ERROR_XPC_BAD_OP_ON_WN_PROTO" &&
             ex.name != "TypeError") {
           throw ex;
         }
       }
 
       try {
-        aObject = Object.getPrototypeOf(aObject);
+        object = Object.getPrototypeOf(object);
       } catch (ex) {
         if (ex.name == "TypeError") {
           return desc;
         }
         throw ex;
       }
     }
     return desc;
@@ -260,416 +248,398 @@ var WebConsoleUtils = {
    *        Property descriptor.
    * @param object b
    *        Property descriptor.
    * @return integer
    *         -1 if a.name < b.name,
    *         1 if a.name > b.name,
    *         0 otherwise.
    */
-  propertiesSort: function WCU_propertiesSort(a, b)
-  {
+  propertiesSort: function(a, b) {
     // Convert the pair.name to a number for later sorting.
-    let aNumber = parseFloat(a.name);
+    let number = parseFloat(a.name);
     let bNumber = parseFloat(b.name);
 
-    // Sort numbers.
-    if (!isNaN(aNumber) && isNaN(bNumber)) {
+    // Sort numbers, then string.
+    if (!isNaN(number) && isNaN(bNumber)) {
       return -1;
-    }
-    else if (isNaN(aNumber) && !isNaN(bNumber)) {
+    } else if (isNaN(number) && !isNaN(bNumber)) {
+      return 1;
+    } else if (!isNaN(number) && !isNaN(bNumber)) {
+      return number - bNumber;
+    } else if (a.name < b.name) {
+      return -1;
+    } else if (a.name > b.name) {
       return 1;
     }
-    else if (!isNaN(aNumber) && !isNaN(bNumber)) {
-      return aNumber - bNumber;
-    }
-    // Sort string.
-    else if (a.name < b.name) {
-      return -1;
-    }
-    else if (a.name > b.name) {
-      return 1;
-    }
-    else {
-      return 0;
-    }
+    return 0;
   },
 
   /**
    * Create a grip for the given value. If the value is an object,
    * an object wrapper will be created.
    *
-   * @param mixed aValue
+   * @param mixed value
    *        The value you want to create a grip for, before sending it to the
    *        client.
-   * @param function aObjectWrapper
-   *        If the value is an object then the aObjectWrapper function is
+   * @param function objectWrapper
+   *        If the value is an object then the objectWrapper function is
    *        invoked to give us an object grip. See this.getObjectGrip().
    * @return mixed
    *         The value grip.
    */
-  createValueGrip: function WCU_createValueGrip(aValue, aObjectWrapper)
-  {
-    switch (typeof aValue) {
+  createValueGrip: function(value, objectWrapper) {
+    switch (typeof value) {
       case "boolean":
-        return aValue;
+        return value;
       case "string":
-        return aObjectWrapper(aValue);
+        return objectWrapper(value);
       case "number":
-        if (aValue === Infinity) {
+        if (value === Infinity) {
           return { type: "Infinity" };
-        }
-        else if (aValue === -Infinity) {
+        } else if (value === -Infinity) {
           return { type: "-Infinity" };
-        }
-        else if (Number.isNaN(aValue)) {
+        } else if (Number.isNaN(value)) {
           return { type: "NaN" };
-        }
-        else if (!aValue && 1 / aValue === -Infinity) {
+        } else if (!value && 1 / value === -Infinity) {
           return { type: "-0" };
         }
-        return aValue;
+        return value;
       case "undefined":
         return { type: "undefined" };
       case "object":
-        if (aValue === null) {
+        if (value === null) {
           return { type: "null" };
         }
+        // Fall through.
       case "function":
-        return aObjectWrapper(aValue);
+        return objectWrapper(value);
       default:
-        Cu.reportError("Failed to provide a grip for value of " + typeof aValue
-                       + ": " + aValue);
+        Cu.reportError("Failed to provide a grip for value of " + typeof value
+                       + ": " + value);
         return null;
     }
   },
 
   /**
    * Check if the given object is an iterator or a generator.
    *
-   * @param object aObject
+   * @param object object
    *        The object you want to check.
    * @return boolean
    *         True if the given object is an iterator or a generator, otherwise
    *         false is returned.
    */
-  isIteratorOrGenerator: function WCU_isIteratorOrGenerator(aObject)
-  {
-    if (aObject === null) {
+  isIteratorOrGenerator: function(object) {
+    if (object === null) {
       return false;
     }
 
-    if (typeof aObject == "object") {
-      if (typeof aObject.__iterator__ == "function" ||
-          aObject.constructor && aObject.constructor.name == "Iterator") {
+    if (typeof object == "object") {
+      if (typeof object.__iterator__ == "function" ||
+          object.constructor && object.constructor.name == "Iterator") {
         return true;
       }
 
       try {
-        let str = aObject.toString();
-        if (typeof aObject.next == "function" &&
+        let str = object.toString();
+        if (typeof object.next == "function" &&
             str.indexOf("[object Generator") == 0) {
           return true;
         }
-      }
-      catch (ex) {
+      } catch (ex) {
         // window.history.next throws in the typeof check above.
         return false;
       }
     }
 
     return false;
   },
 
   /**
    * Determine if the given request mixes HTTP with HTTPS content.
    *
-   * @param string aRequest
+   * @param string request
    *        Location of the requested content.
-   * @param string aLocation
+   * @param string location
    *        Location of the current page.
    * @return boolean
    *         True if the content is mixed, false if not.
    */
-  isMixedHTTPSRequest: function WCU_isMixedHTTPSRequest(aRequest, aLocation)
-  {
+  isMixedHTTPSRequest: function(request, location) {
     try {
-      let requestURI = Services.io.newURI(aRequest, null, null);
-      let contentURI = Services.io.newURI(aLocation, null, null);
+      let requestURI = Services.io.newURI(request, null, null);
+      let contentURI = Services.io.newURI(location, null, null);
       return (contentURI.scheme == "https" && requestURI.scheme != "https");
-    }
-    catch (ex) {
+    } catch (ex) {
       return false;
     }
   },
 
   /**
    * Helper function to deduce the name of the provided function.
    *
-   * @param funtion aFunction
+   * @param funtion function
    *        The function whose name will be returned.
    * @return string
    *         Function name.
    */
-  getFunctionName: function WCF_getFunctionName(aFunction)
-  {
+  getFunctionName: function(func) {
     let name = null;
-    if (aFunction.name) {
-      name = aFunction.name;
-    }
-    else {
+    if (func.name) {
+      name = func.name;
+    } else {
       let desc;
       try {
-        desc = aFunction.getOwnPropertyDescriptor("displayName");
+        desc = func.getOwnPropertyDescriptor("displayName");
+      } catch (ex) {
+        // Ignore.
       }
-      catch (ex) { }
       if (desc && typeof desc.value == "string") {
         name = desc.value;
       }
     }
     if (!name) {
       try {
-        let str = (aFunction.toString() || aFunction.toSource()) + "";
+        let str = (func.toString() || func.toSource()) + "";
         name = (str.match(REGEX_MATCH_FUNCTION_NAME) || [])[1];
+      } catch (ex) {
+        // Ignore.
       }
-      catch (ex) { }
     }
     return name;
   },
 
   /**
    * Get the object class name. For example, the |window| object has the Window
    * class name (based on [object Window]).
    *
-   * @param object aObject
+   * @param object object
    *        The object you want to get the class name for.
    * @return string
    *         The object class name.
    */
-  getObjectClassName: function WCU_getObjectClassName(aObject)
-  {
-    if (aObject === null) {
+  getObjectClassName: function(object) {
+    if (object === null) {
       return "null";
     }
-    if (aObject === undefined) {
+    if (object === undefined) {
       return "undefined";
     }
 
-    let type = typeof aObject;
+    let type = typeof object;
     if (type != "object") {
       // Grip class names should start with an uppercase letter.
       return type.charAt(0).toUpperCase() + type.substr(1);
     }
 
     let className;
 
     try {
-      className = ((aObject + "").match(/^\[object (\S+)\]$/) || [])[1];
+      className = ((object + "").match(/^\[object (\S+)\]$/) || [])[1];
       if (!className) {
-        className = ((aObject.constructor + "").match(/^\[object (\S+)\]$/) || [])[1];
+        className = ((object.constructor + "")
+                     .match(/^\[object (\S+)\]$/) || [])[1];
       }
-      if (!className && typeof aObject.constructor == "function") {
-        className = this.getFunctionName(aObject.constructor);
+      if (!className && typeof object.constructor == "function") {
+        className = this.getFunctionName(object.constructor);
       }
+    } catch (ex) {
+      // Ignore.
     }
-    catch (ex) { }
 
     return className;
   },
 
   /**
    * Check if the given value is a grip with an actor.
    *
-   * @param mixed aGrip
+   * @param mixed grip
    *        Value you want to check if it is a grip with an actor.
    * @return boolean
    *         True if the given value is a grip with an actor.
    */
-  isActorGrip: function WCU_isActorGrip(aGrip)
-  {
-    return aGrip && typeof(aGrip) == "object" && aGrip.actor;
+  isActorGrip: function(grip) {
+    return grip && typeof (grip) == "object" && grip.actor;
   },
+
   /**
    * Value of devtools.selfxss.count preference
    *
    * @type number
    * @private
    */
   _usageCount: 0,
   get usageCount() {
     if (WebConsoleUtils._usageCount < CONSOLE_ENTRY_THRESHOLD) {
-      WebConsoleUtils._usageCount = Services.prefs.getIntPref("devtools.selfxss.count");
+      WebConsoleUtils._usageCount =
+        Services.prefs.getIntPref("devtools.selfxss.count");
       if (Services.prefs.getBoolPref("devtools.chrome.enabled")) {
         WebConsoleUtils.usageCount = CONSOLE_ENTRY_THRESHOLD;
       }
     }
     return WebConsoleUtils._usageCount;
   },
   set usageCount(newUC) {
     if (newUC <= CONSOLE_ENTRY_THRESHOLD) {
       WebConsoleUtils._usageCount = newUC;
       Services.prefs.setIntPref("devtools.selfxss.count", newUC);
     }
   },
   /**
-   * The inputNode "paste" event handler generator. Helps prevent self-xss attacks
+   * The inputNode "paste" event handler generator. Helps prevent
+   * self-xss attacks
    *
    * @param nsIDOMElement inputField
    * @param nsIDOMElement notificationBox
-   * @returns A function to be added as a handler to 'paste' and 'drop' events on the input field
+   * @returns A function to be added as a handler to 'paste' and
+   *'drop' events on the input field
    */
-  pasteHandlerGen: function WCU_pasteHandlerGen(inputField, notificationBox, msg, okstring) {
-    let handler = function WCU_pasteHandler(aEvent) {
+  pasteHandlerGen: function(inputField, notificationBox, msg, okstring) {
+    let handler = function(event) {
       if (WebConsoleUtils.usageCount >= CONSOLE_ENTRY_THRESHOLD) {
         inputField.removeEventListener("paste", handler);
         inputField.removeEventListener("drop", handler);
         return true;
       }
       if (notificationBox.getNotificationWithValue("selfxss-notification")) {
-        aEvent.preventDefault();
-        aEvent.stopPropagation();
+        event.preventDefault();
+        event.stopPropagation();
         return false;
       }
 
-
       let notification = notificationBox.appendNotification(msg,
-        "selfxss-notification", null, notificationBox.PRIORITY_WARNING_HIGH, null,
+        "selfxss-notification", null,
+        notificationBox.PRIORITY_WARNING_HIGH, null,
         function(eventType) {
           // Cleanup function if notification is dismissed
           if (eventType == "removed") {
             inputField.removeEventListener("keyup", pasteKeyUpHandler);
           }
         });
 
-      function pasteKeyUpHandler(aEvent2) {
+      function pasteKeyUpHandler(event2) {
         let value = inputField.value || inputField.textContent;
         if (value.includes(okstring)) {
           notificationBox.removeNotification(notification);
           inputField.removeEventListener("keyup", pasteKeyUpHandler);
           WebConsoleUtils.usageCount = CONSOLE_ENTRY_THRESHOLD;
         }
       }
       inputField.addEventListener("keyup", pasteKeyUpHandler);
 
-      aEvent.preventDefault();
-      aEvent.stopPropagation();
+      event.preventDefault();
+      event.stopPropagation();
       return false;
     };
     return handler;
   },
-
-
 };
 
 exports.Utils = WebConsoleUtils;
 
-//////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////
 // Localization
-//////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////
 
 WebConsoleUtils.L10n = function(bundleURI) {
   this._bundleUri = bundleURI;
 };
 
 WebConsoleUtils.L10n.prototype = {
   _stringBundle: null,
 
-  get stringBundle()
-  {
+  get stringBundle() {
     if (!this._stringBundle) {
       this._stringBundle = Services.strings.createBundle(this._bundleUri);
     }
     return this._stringBundle;
   },
 
   /**
    * Generates a formatted timestamp string for displaying in console messages.
    *
-   * @param integer [aMilliseconds]
+   * @param integer [milliseconds]
    *        Optional, allows you to specify the timestamp in milliseconds since
    *        the UNIX epoch.
    * @return string
    *         The timestamp formatted for display.
    */
-  timestampString: function WCU_l10n_timestampString(aMilliseconds)
-  {
-    let d = new Date(aMilliseconds ? aMilliseconds : null);
+  timestampString: function(milliseconds) {
+    let d = new Date(milliseconds ? milliseconds : null);
     let hours = d.getHours(), minutes = d.getMinutes();
-    let seconds = d.getSeconds(), milliseconds = d.getMilliseconds();
+    let seconds = d.getSeconds();
+    milliseconds = d.getMilliseconds();
     let parameters = [hours, minutes, seconds, milliseconds];
     return this.getFormatStr("timestampFormat", parameters);
   },
 
   /**
    * Retrieve a localized string.
    *
-   * @param string aName
+   * @param string name
    *        The string name you want from the Web Console string bundle.
    * @return string
    *         The localized string.
    */
-  getStr: function WCU_l10n_getStr(aName)
-  {
+  getStr: function(name) {
     let result;
     try {
-      result = this.stringBundle.GetStringFromName(aName);
-    }
-    catch (ex) {
-      Cu.reportError("Failed to get string: " + aName);
+      result = this.stringBundle.GetStringFromName(name);
+    } catch (ex) {
+      Cu.reportError("Failed to get string: " + name);
       throw ex;
     }
     return result;
   },
 
   /**
    * Retrieve a localized string formatted with values coming from the given
    * array.
    *
-   * @param string aName
+   * @param string name
    *        The string name you want from the Web Console string bundle.
-   * @param array aArray
+   * @param array array
    *        The array of values you want in the formatted string.
    * @return string
    *         The formatted local string.
    */
-  getFormatStr: function WCU_l10n_getFormatStr(aName, aArray)
-  {
+  getFormatStr: function(name, array) {
     let result;
     try {
-      result = this.stringBundle.formatStringFromName(aName, aArray, aArray.length);
-    }
-    catch (ex) {
-      Cu.reportError("Failed to format string: " + aName);
+      result = this.stringBundle.formatStringFromName(name, array,
+                                                      array.length);
+    } catch (ex) {
+      Cu.reportError("Failed to format string: " + name);
       throw ex;
     }
     return result;
   },
 };
 
-///////////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////////
 // The page errors listener
-///////////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////////
 
 /**
  * The nsIConsoleService listener. This is used to send all of the console
  * messages (JavaScript, CSS and more) to the remote Web Console instance.
  *
  * @constructor
- * @param nsIDOMWindow [aWindow]
+ * @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 aListener
+ * @param object listener
  *        The listener object must have one method:
  *        - onConsoleServiceMessage(). This method is invoked with one argument,
  *        the nsIConsoleMessage, whenever a relevant message is received.
  */
-function ConsoleServiceListener(aWindow, aListener)
-{
-  this.window = aWindow;
-  this.listener = aListener;
+function ConsoleServiceListener(window, listener) {
+  this.window = window;
+  this.listener = listener;
 }
 exports.ConsoleServiceListener = ConsoleServiceListener;
 
 ConsoleServiceListener.prototype =
 {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIConsoleListener]),
 
   /**
@@ -682,67 +652,64 @@ ConsoleServiceListener.prototype =
    * The listener object which is notified of messages from the console service.
    * @type object
    */
   listener: null,
 
   /**
    * Initialize the nsIConsoleService listener.
    */
-  init: function CSL_init()
-  {
+  init: function() {
     Services.console.registerListener(this);
   },
 
   /**
    * The nsIConsoleService observer. This method takes all the script error
    * messages belonging to the current window and sends them to the remote Web
    * Console instance.
    *
-   * @param nsIConsoleMessage aMessage
+   * @param nsIConsoleMessage message
    *        The message object coming from the nsIConsoleService.
    */
-  observe: function CSL_observe(aMessage)
-  {
+  observe: function(message) {
     if (!this.listener) {
       return;
     }
 
     if (this.window) {
-      if (!(aMessage instanceof Ci.nsIScriptError) ||
-          !aMessage.outerWindowID ||
-          !this.isCategoryAllowed(aMessage.category)) {
+      if (!(message instanceof Ci.nsIScriptError) ||
+          !message.outerWindowID ||
+          !this.isCategoryAllowed(message.category)) {
         return;
       }
 
-      let errorWindow = Services.wm.getOuterWindowWithId(aMessage .outerWindowID);
+      let errorWindow = Services.wm.getOuterWindowWithId(message.outerWindowID);
       if (!errorWindow || !isWindowIncluded(this.window, errorWindow)) {
         return;
       }
     }
 
-    this.listener.onConsoleServiceMessage(aMessage);
+    this.listener.onConsoleServiceMessage(message);
   },
 
   /**
    * Check if the given message category is allowed to be tracked or not.
    * We ignore chrome-originating errors as we only care about content.
    *
-   * @param string aCategory
+   * @param string category
    *        The message category you want to check.
    * @return boolean
    *         True if the category is allowed to be logged, false otherwise.
    */
-  isCategoryAllowed: function CSL_isCategoryAllowed(aCategory)
-  {
-    if (!aCategory) {
+  isCategoryAllowed: function(category) {
+    if (!category) {
       return false;
     }
 
-    switch (aCategory) {
+    switch (category) {
       case "XPConnect JavaScript":
       case "component javascript":
       case "chrome javascript":
       case "chrome registration":
       case "XBL":
       case "XBL Prototype Handler":
       case "XBL Content Sink":
       case "xbl javascript":
@@ -750,100 +717,95 @@ ConsoleServiceListener.prototype =
     }
 
     return true;
   },
 
   /**
    * Get the cached page errors for the current inner window and its (i)frames.
    *
-   * @param boolean [aIncludePrivate=false]
+   * @param boolean [includePrivate=false]
    *        Tells if you want to also retrieve messages coming from private
    *        windows. Defaults to false.
    * @return array
    *         The array of cached messages. Each element is an nsIScriptError or
    *         an nsIConsoleMessage
    */
-  getCachedMessages: function CSL_getCachedMessages(aIncludePrivate = false)
-  {
+  getCachedMessages: function(includePrivate = false) {
     let errors = Services.console.getMessageArray() || [];
 
     // if !this.window, we're in a browser console. Still need to filter
     // private messages.
     if (!this.window) {
-      return errors.filter((aError) => {
-        if (aError instanceof Ci.nsIScriptError) {
-          if (!aIncludePrivate && aError.isFromPrivateWindow) {
+      return errors.filter((error) => {
+        if (error instanceof Ci.nsIScriptError) {
+          if (!includePrivate && error.isFromPrivateWindow) {
             return false;
           }
         }
 
         return true;
       });
     }
 
     let ids = WebConsoleUtils.getInnerWindowIDsForFrames(this.window);
 
-    return errors.filter((aError) => {
-      if (aError instanceof Ci.nsIScriptError) {
-        if (!aIncludePrivate && aError.isFromPrivateWindow) {
+    return errors.filter((error) => {
+      if (error instanceof Ci.nsIScriptError) {
+        if (!includePrivate && error.isFromPrivateWindow) {
           return false;
         }
         if (ids &&
-            (ids.indexOf(aError.innerWindowID) == -1 ||
-             !this.isCategoryAllowed(aError.category))) {
+            (ids.indexOf(error.innerWindowID) == -1 ||
+             !this.isCategoryAllowed(error.category))) {
           return false;
         }
-      }
-      else if (ids && ids[0]) {
+      } else if (ids && ids[0]) {
         // If this is not an nsIScriptError and we need to do window-based
         // filtering we skip this message.
         return false;
       }
 
       return true;
     });
   },
 
   /**
    * Remove the nsIConsoleService listener.
    */
-  destroy: function CSL_destroy()
-  {
+  destroy: function() {
     Services.console.unregisterListener(this);
     this.listener = this.window = null;
   },
 };
 
-
-///////////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////////
 // The window.console API observer
-///////////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////////
 
 /**
  * The window.console API observer. This allows the window.console API messages
  * to be sent to the remote Web Console instance.
  *
  * @constructor
- * @param nsIDOMWindow aWindow
+ * @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 aOwner
+ * @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 string aConsoleID
+ * @param string consoleID
  *        Options - The consoleID that this listener should listen to
  */
-function ConsoleAPIListener(aWindow, aOwner, aConsoleID)
-{
-  this.window = aWindow;
-  this.owner = aOwner;
-  this.consoleID = aConsoleID;
+function ConsoleAPIListener(window, owner, consoleID) {
+  this.window = window;
+  this.owner = owner;
+  this.consoleID = consoleID;
 }
 exports.ConsoleAPIListener = ConsoleAPIListener;
 
 ConsoleAPIListener.prototype =
 {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 
   /**
@@ -866,42 +828,40 @@ ConsoleAPIListener.prototype =
    * The consoleID that we listen for. If not null then only messages from this
    * console will be returned.
    */
   consoleID: null,
 
   /**
    * Initialize the window.console API observer.
    */
-  init: function CAL_init()
-  {
+  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);
   },
 
   /**
    * The console API message observer. When messages are received from the
    * observer service we forward them to the remote Web Console instance.
    *
-   * @param object aMessage
+   * @param object message
    *        The message object receives from the observer service.
-   * @param string aTopic
+   * @param string topic
    *        The message topic received from the observer service.
    */
-  observe: function CAL_observe(aMessage, aTopic)
-  {
+  observe: function(message, topic) {
     if (!this.owner) {
       return;
     }
 
     // Here, wrappedJSObject is not a security wrapper but a property defined
     // by the XPCOM component which allows us to unwrap the XPCOM interface and
     // access the underlying JSObject.
-    let apiMessage = aMessage.wrappedJSObject;
+    let apiMessage = message.wrappedJSObject;
 
     if (!this.isMessageRelevant(apiMessage)) {
       return;
     }
 
     this.owner.onConsoleAPICall(apiMessage);
   },
 
@@ -941,24 +901,23 @@ ConsoleAPIListener.prototype =
     }
 
     return true;
   },
 
   /**
    * Get the cached messages for the current inner window and its (i)frames.
    *
-   * @param boolean [aIncludePrivate=false]
+   * @param boolean [includePrivate=false]
    *        Tells if you want to also retrieve messages coming from private
    *        windows. Defaults to false.
    * @return array
    *         The array of cached messages.
    */
-  getCachedMessages: function CAL_getCachedMessages(aIncludePrivate = false)
-  {
+  getCachedMessages: function(includePrivate = false) {
     let messages = [];
     let ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"]
                               .getService(Ci.nsIConsoleAPIStorage);
 
     // if !this.window, we're in a browser console. Retrieve all events
     // for filtering based on privacy.
     if (!this.window) {
       messages = ConsoleAPIStorage.getEvents();
@@ -972,28 +931,27 @@ ConsoleAPIListener.prototype =
     CONSOLE_WORKER_IDS.forEach((id) => {
       messages = messages.concat(ConsoleAPIStorage.getEvents(id));
     });
 
     messages = messages.filter(msg => {
       return this.isMessageRelevant(msg);
     });
 
-    if (aIncludePrivate) {
+    if (includePrivate) {
       return messages;
     }
 
     return messages.filter((m) => !m.private);
   },
 
   /**
    * Destroy the console API listener.
    */
-  destroy: function CAL_destroy()
-  {
+  destroy: function() {
     Services.obs.removeObserver(this, "console-api-log-event");
     this.window = this.owner = null;
   },
 };
 
 /**
  * WebConsole commands manager.
  *
@@ -1007,17 +965,17 @@ var WebConsoleCommands = {
 
   /**
    * @private
    * Reserved for built-in commands. To register a command from the code of an
    * add-on, see WebConsoleCommands.register instead.
    *
    * @see WebConsoleCommands.register
    */
-  _registerOriginal: function (name, command) {
+  _registerOriginal: function(name, command) {
     this.register(name, command);
     this._originalCommands.set(name, this.getCommand(name));
   },
 
   /**
    * Register a new command.
    * @param {string} name The command name (exemple: "$")
    * @param {(function|object)} command The command to register.
@@ -1028,24 +986,24 @@ var WebConsoleCommands = {
    *  The command function or the command getter are passed a owner object as
    *  their first parameter (see the example below).
    *
    *  Note that setters don't work currently and "enumerable" and "configurable"
    *  are forced to true.
    *
    * @example
    *
-   *   WebConsoleCommands.register("$", function JSTH_$(aOwner, aSelector)
+   *   WebConsoleCommands.register("$", function JSTH_$(owner, selector)
    *   {
-   *     return aOwner.window.document.querySelector(aSelector);
+   *     return owner.window.document.querySelector(selector);
    *   });
    *
    *   WebConsoleCommands.register("$0", {
-   *     get: function(aOwner) {
-   *       return aOwner.makeDebuggeeValue(aOwner.selectedNode);
+   *     get: function(owner) {
+   *       return owner.makeDebuggeeValue(owner.selectedNode);
    *     }
    *   });
    */
   register: function(name, command) {
     this._registeredCommands.set(name, command);
   },
 
   /**
@@ -1083,335 +1041,320 @@ var WebConsoleCommands = {
    */
   hasCommand: function(name) {
     return this._registeredCommands.has(name);
   },
 };
 
 exports.WebConsoleCommands = WebConsoleCommands;
 
-
 /*
  * Built-in commands.
   *
   * A list of helper functions used by Firebug can be found here:
   *   http://getfirebug.com/wiki/index.php/Command_Line_API
  */
 
 /**
  * Find a node by ID.
  *
- * @param string aId
+ * @param string id
  *        The ID of the element you want.
  * @return nsIDOMNode or null
- *         The result of calling document.querySelector(aSelector).
+ *         The result of calling document.querySelector(selector).
  */
-WebConsoleCommands._registerOriginal("$", function JSTH_$(aOwner, aSelector)
-{
-  return aOwner.window.document.querySelector(aSelector);
+WebConsoleCommands._registerOriginal("$", function(owner, selector) {
+  return owner.window.document.querySelector(selector);
 });
 
 /**
  * Find the nodes matching a CSS selector.
  *
- * @param string aSelector
+ * @param string selector
  *        A string that is passed to window.document.querySelectorAll.
  * @return nsIDOMNodeList
- *         Returns the result of document.querySelectorAll(aSelector).
+ *         Returns the result of document.querySelectorAll(selector).
  */
-WebConsoleCommands._registerOriginal("$$", function JSTH_$$(aOwner, aSelector)
-{
-  let nodes = aOwner.window.document.querySelectorAll(aSelector);
+WebConsoleCommands._registerOriginal("$$", function(owner, selector) {
+  let nodes = owner.window.document.querySelectorAll(selector);
 
-  // Calling aOwner.window.Array.from() doesn't work without accessing the
+  // Calling owner.window.Array.from() doesn't work without accessing the
   // wrappedJSObject, so just loop through the results instead.
-  let result = new aOwner.window.Array();
+  let result = new owner.window.Array();
   for (let i = 0; i < nodes.length; i++) {
     result.push(nodes[i]);
   }
   return result;
 });
 
 /**
  * Returns the result of the last console input evaluation
  *
  * @return object|undefined
  * Returns last console evaluation or undefined
  */
 WebConsoleCommands._registerOriginal("$_", {
-  get: function(aOwner) {
-    return aOwner.consoleActor.getLastConsoleInputEvaluation();
+  get: function(owner) {
+    return owner.consoleActor.getLastConsoleInputEvaluation();
   }
 });
 
-
 /**
  * Runs an xPath query and returns all matched nodes.
  *
- * @param string aXPath
+ * @param string xPath
  *        xPath search query to execute.
- * @param [optional] nsIDOMNode aContext
+ * @param [optional] nsIDOMNode context
  *        Context to run the xPath query on. Uses window.document if not set.
  * @return array of nsIDOMNode
  */
-WebConsoleCommands._registerOriginal("$x", function JSTH_$x(aOwner, aXPath, aContext)
-{
-  let nodes = new aOwner.window.Array();
+WebConsoleCommands._registerOriginal("$x", function(owner, xPath, context) {
+  let nodes = new owner.window.Array();
 
   // Not waiving Xrays, since we want the original Document.evaluate function,
   // instead of anything that's been redefined.
-  let doc =  aOwner.window.document;
-  aContext = aContext || doc;
+  let doc = owner.window.document;
+  context = context || doc;
 
-  let results = doc.evaluate(aXPath, aContext, null,
+  let results = doc.evaluate(xPath, context, null,
                              Ci.nsIDOMXPathResult.ANY_TYPE, null);
   let node;
   while ((node = results.iterateNext())) {
     nodes.push(node);
   }
 
   return nodes;
 });
 
 /**
  * Returns the currently selected object in the highlighter.
  *
  * @return Object representing the current selection in the
  *         Inspector, or null if no selection exists.
  */
 WebConsoleCommands._registerOriginal("$0", {
-  get: function(aOwner) {
-    return aOwner.makeDebuggeeValue(aOwner.selectedNode);
+  get: function(owner) {
+    return owner.makeDebuggeeValue(owner.selectedNode);
   }
 });
 
 /**
  * Clears the output of the WebConsole.
  */
-WebConsoleCommands._registerOriginal("clear", function JSTH_clear(aOwner)
-{
-  aOwner.helperResult = {
+WebConsoleCommands._registerOriginal("clear", function(owner) {
+  owner.helperResult = {
     type: "clearOutput",
   };
 });
 
 /**
  * Clears the input history of the WebConsole.
  */
-WebConsoleCommands._registerOriginal("clearHistory", function JSTH_clearHistory(aOwner)
-{
-  aOwner.helperResult = {
+WebConsoleCommands._registerOriginal("clearHistory", function(owner) {
+  owner.helperResult = {
     type: "clearHistory",
   };
 });
 
 /**
- * Returns the result of Object.keys(aObject).
+ * Returns the result of Object.keys(object).
  *
- * @param object aObject
+ * @param object object
  *        Object to return the property names from.
  * @return array of strings
  */
-WebConsoleCommands._registerOriginal("keys", function JSTH_keys(aOwner, aObject)
-{
+WebConsoleCommands._registerOriginal("keys", function(owner, object) {
   // Need to waive Xrays so we can iterate functions and accessor properties
-  return Cu.cloneInto(Object.keys(Cu.waiveXrays(aObject)), aOwner.window);
+  return Cu.cloneInto(Object.keys(Cu.waiveXrays(object)), owner.window);
 });
 
 /**
- * Returns the values of all properties on aObject.
+ * Returns the values of all properties on object.
  *
- * @param object aObject
+ * @param object object
  *        Object to display the values from.
  * @return array of string
  */
-WebConsoleCommands._registerOriginal("values", function JSTH_values(aOwner, aObject)
-{
+WebConsoleCommands._registerOriginal("values", function(owner, object) {
   let values = [];
   // Need to waive Xrays so we can iterate functions and accessor properties
-  let waived = Cu.waiveXrays(aObject);
+  let waived = Cu.waiveXrays(object);
   let names = Object.getOwnPropertyNames(waived);
 
   for (let name of names) {
     values.push(waived[name]);
   }
 
-  return Cu.cloneInto(values, aOwner.window);
+  return Cu.cloneInto(values, owner.window);
 });
 
 /**
  * Opens a help window in MDN.
  */
-WebConsoleCommands._registerOriginal("help", function JSTH_help(aOwner)
-{
-  aOwner.helperResult = { type: "help" };
+WebConsoleCommands._registerOriginal("help", function(owner) {
+  owner.helperResult = { type: "help" };
 });
 
 /**
  * Change the JS evaluation scope.
  *
- * @param DOMElement|string|window aWindow
+ * @param DOMElement|string|window window
  *        The window object to use for eval scope. This can be a string that
  *        is used to perform document.querySelector(), to find the iframe that
  *        you want to cd() to. A DOMElement can be given as well, the
  *        .contentWindow property is used. Lastly, you can directly pass
  *        a window object. If you call cd() with no arguments, the current
  *        eval scope is cleared back to its default (the top window).
  */
-WebConsoleCommands._registerOriginal("cd", function JSTH_cd(aOwner, aWindow)
-{
-  if (!aWindow) {
-    aOwner.consoleActor.evalWindow = null;
-    aOwner.helperResult = { type: "cd" };
+WebConsoleCommands._registerOriginal("cd", function(owner, window) {
+  if (!window) {
+    owner.consoleActor.evalWindow = null;
+    owner.helperResult = { type: "cd" };
     return;
   }
 
-  if (typeof aWindow == "string") {
-    aWindow = aOwner.window.document.querySelector(aWindow);
+  if (typeof window == "string") {
+    window = owner.window.document.querySelector(window);
+  }
+  if (window instanceof Ci.nsIDOMElement && window.contentWindow) {
+    window = window.contentWindow;
   }
-  if (aWindow instanceof Ci.nsIDOMElement && aWindow.contentWindow) {
-    aWindow = aWindow.contentWindow;
-  }
-  if (!(aWindow instanceof Ci.nsIDOMWindow)) {
-    aOwner.helperResult = { type: "error", message: "cdFunctionInvalidArgument" };
+  if (!(window instanceof Ci.nsIDOMWindow)) {
+    owner.helperResult = {
+      type: "error",
+      message: "cdFunctionInvalidArgument"
+    };
     return;
   }
 
-  aOwner.consoleActor.evalWindow = aWindow;
-  aOwner.helperResult = { type: "cd" };
+  owner.consoleActor.evalWindow = window;
+  owner.helperResult = { type: "cd" };
 });
 
 /**
- * Inspects the passed aObject. This is done by opening the PropertyPanel.
+ * Inspects the passed object. This is done by opening the PropertyPanel.
  *
- * @param object aObject
+ * @param object object
  *        Object to inspect.
  */
-WebConsoleCommands._registerOriginal("inspect", function JSTH_inspect(aOwner, aObject)
-{
-  let dbgObj = aOwner.makeDebuggeeValue(aObject);
-  let grip = aOwner.createValueGrip(dbgObj);
-  aOwner.helperResult = {
+WebConsoleCommands._registerOriginal("inspect", function(owner, object) {
+  let dbgObj = owner.makeDebuggeeValue(object);
+  let grip = owner.createValueGrip(dbgObj);
+  owner.helperResult = {
     type: "inspectObject",
-    input: aOwner.evalInput,
+    input: owner.evalInput,
     object: grip,
   };
 });
 
 /**
- * Prints aObject to the output.
+ * Prints object to the output.
  *
- * @param object aObject
+ * @param object object
  *        Object to print to the output.
  * @return string
  */
-WebConsoleCommands._registerOriginal("pprint", function JSTH_pprint(aOwner, aObject)
-{
-  if (aObject === null || aObject === undefined || aObject === true ||
-      aObject === false) {
-    aOwner.helperResult = {
+WebConsoleCommands._registerOriginal("pprint", function(owner, object) {
+  if (object === null || object === undefined || object === true ||
+      object === false) {
+    owner.helperResult = {
       type: "error",
       message: "helperFuncUnsupportedTypeError",
     };
     return null;
   }
 
-  aOwner.helperResult = { rawOutput: true };
+  owner.helperResult = { rawOutput: true };
 
-  if (typeof aObject == "function") {
-    return aObject + "\n";
+  if (typeof object == "function") {
+    return object + "\n";
   }
 
   let output = [];
 
-  let obj = aObject;
+  let obj = object;
   for (let name in obj) {
     let desc = WebConsoleUtils.getPropertyDescriptor(obj, name) || {};
     if (desc.get || desc.set) {
       // TODO: Bug 842672 - toolkit/ imports modules from browser/.
       let getGrip = VariablesView.getGrip(desc.get);
       let setGrip = VariablesView.getGrip(desc.set);
       let getString = VariablesView.getString(getGrip);
       let setString = VariablesView.getString(setGrip);
       output.push(name + ":", "  get: " + getString, "  set: " + setString);
-    }
-    else {
+    } else {
       let valueGrip = VariablesView.getGrip(obj[name]);
       let valueString = VariablesView.getString(valueGrip);
       output.push(name + ": " + valueString);
     }
   }
 
   return "  " + output.join("\n  ");
 });
 
 /**
  * Print the String representation of a value to the output, as-is.
  *
- * @param any aValue
+ * @param any value
  *        A value you want to output as a string.
  * @return void
  */
-WebConsoleCommands._registerOriginal("print", function JSTH_print(aOwner, aValue)
-{
-  aOwner.helperResult = { rawOutput: true };
-  if (typeof aValue === "symbol") {
-    return Symbol.prototype.toString.call(aValue);
+WebConsoleCommands._registerOriginal("print", function(owner, value) {
+  owner.helperResult = { rawOutput: true };
+  if (typeof value === "symbol") {
+    return Symbol.prototype.toString.call(value);
   }
   // Waiving Xrays here allows us to see a closer representation of the
   // underlying object. This may execute arbitrary content code, but that
   // code will run with content privileges, and the result will be rendered
   // inert by coercing it to a String.
-  return String(Cu.waiveXrays(aValue));
+  return String(Cu.waiveXrays(value));
 });
 
 /**
  * Copy the String representation of a value to the clipboard.
  *
- * @param any aValue
+ * @param any value
  *        A value you want to copy as a string.
  * @return void
  */
-WebConsoleCommands._registerOriginal("copy", function JSTH_copy(aOwner, aValue)
-{
+WebConsoleCommands._registerOriginal("copy", function(owner, value) {
   let payload;
   try {
-    if (aValue instanceof Ci.nsIDOMElement) {
-      payload = aValue.outerHTML;
-    } else if (typeof aValue == "string") {
-      payload = aValue;
+    if (value instanceof Ci.nsIDOMElement) {
+      payload = value.outerHTML;
+    } else if (typeof value == "string") {
+      payload = value;
     } else {
-      payload = JSON.stringify(aValue, null, "  ");
+      payload = JSON.stringify(value, null, "  ");
     }
   } catch (ex) {
-    payload = "/* " + ex  + " */";
+    payload = "/* " + ex + " */";
   }
-  aOwner.helperResult = {
+  owner.helperResult = {
     type: "copyValueToClipboard",
     value: payload,
   };
 });
 
-
 /**
  * (Internal only) Add the bindings to |owner.sandbox|.
  * This is intended to be used by the WebConsole actor only.
   *
-  * @param object aOwner
+  * @param object owner
   *        The owning object.
   */
 function addWebConsoleCommands(owner) {
   if (!owner) {
     throw new Error("The owner is required");
   }
   for (let [name, command] of WebConsoleCommands._registeredCommands) {
     if (typeof command === "function") {
       owner.sandbox[name] = command.bind(undefined, owner);
-    }
-    else if (typeof command === "object") {
+    } else if (typeof command === "object") {
       let clone = Object.assign({}, command, {
         // We force the enumerability and the configurability (so the
         // WebConsoleActor can reconfigure the property).
         enumerable: true,
         configurable: true
       });
 
       if (typeof command.get === "function") {
@@ -1428,99 +1371,93 @@ function addWebConsoleCommands(owner) {
 
 exports.addWebConsoleCommands = addWebConsoleCommands;
 
 /**
  * A ReflowObserver that listens for reflow events from the page.
  * Implements nsIReflowObserver.
  *
  * @constructor
- * @param object aWindow
+ * @param object window
  *        The window for which we need to track reflow.
- * @param object aOwner
+ * @param object owner
  *        The listener owner which needs to implement:
- *        - onReflowActivity(aReflowInfo)
+ *        - onReflowActivity(reflowInfo)
  */
 
-function ConsoleReflowListener(aWindow, aListener)
-{
-  this.docshell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
+function ConsoleReflowListener(window, listener) {
+  this.docshell = window.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIWebNavigation)
                          .QueryInterface(Ci.nsIDocShell);
-  this.listener = aListener;
+  this.listener = listener;
   this.docshell.addWeakReflowObserver(this);
 }
 
 exports.ConsoleReflowListener = ConsoleReflowListener;
 
 ConsoleReflowListener.prototype =
 {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIReflowObserver,
                                          Ci.nsISupportsWeakReference]),
   docshell: null,
   listener: null,
 
   /**
    * Forward reflow event to listener.
    *
-   * @param DOMHighResTimeStamp aStart
-   * @param DOMHighResTimeStamp aEnd
-   * @param boolean aInterruptible
+   * @param DOMHighResTimeStamp start
+   * @param DOMHighResTimeStamp end
+   * @param boolean interruptible
    */
-  sendReflow: function CRL_sendReflow(aStart, aEnd, aInterruptible)
-  {
+  sendReflow: function(start, end, interruptible) {
     let frame = components.stack.caller.caller;
 
     let filename = frame ? frame.filename : null;
 
     if (filename) {
       // Because filename could be of the form "xxx.js -> xxx.js -> xxx.js",
       // we only take the last part.
       filename = filename.split(" ").pop();
     }
 
     this.listener.onReflowActivity({
-      interruptible: aInterruptible,
-      start: aStart,
-      end: aEnd,
+      interruptible: interruptible,
+      start: start,
+      end: end,
       sourceURL: filename,
       sourceLine: frame ? frame.lineNumber : null,
       functionName: frame ? frame.name : null
     });
   },
 
   /**
    * On uninterruptible reflow
    *
-   * @param DOMHighResTimeStamp aStart
-   * @param DOMHighResTimeStamp aEnd
+   * @param DOMHighResTimeStamp start
+   * @param DOMHighResTimeStamp end
    */
-  reflow: function CRL_reflow(aStart, aEnd)
-  {
-    this.sendReflow(aStart, aEnd, false);
+  reflow: function(start, end) {
+    this.sendReflow(start, end, false);
   },
 
   /**
    * On interruptible reflow
    *
-   * @param DOMHighResTimeStamp aStart
-   * @param DOMHighResTimeStamp aEnd
+   * @param DOMHighResTimeStamp start
+   * @param DOMHighResTimeStamp end
    */
-  reflowInterruptible: function CRL_reflowInterruptible(aStart, aEnd)
-  {
-    this.sendReflow(aStart, aEnd, true);
+  reflowInterruptible: function(start, end) {
+    this.sendReflow(start, end, true);
   },
 
   /**
    * Unregister listener.
    */
-  destroy: function CRL_destroy()
-  {
+  destroy: function() {
     this.docshell.removeWeakReflowObserver(this);
     this.listener = this.docshell = null;
   },
 };
 
-function gSequenceId()
-{
+function gSequenceId() {
   return gSequenceId.n++;
 }
 gSequenceId.n = 0;
--- a/devtools/shared/webconsole/worker-utils.js
+++ b/devtools/shared/webconsole/worker-utils.js
@@ -1,14 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft= javascript ts=2 et sw=2 tw=80: */
 /* 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";
+
 // XXXworkers This file is loaded on the server side for worker debugging.
 // Since the server is running in the worker thread, it doesn't
 // have access to Services / Components.  This functionality
 // is stubbed out to prevent errors, and will need to implemented
 // for Bug 1209353.
 
 exports.Utils = { L10n: function() {} };
 exports.ConsoleServiceListener = function() {};