Bug 1520907 - Rename QueryContext to UrlbarQueryContext. r=Standard8
authorDrew Willcoxon <adw@mozilla.com>
Wed, 23 Jan 2019 00:39:07 +0000
changeset 514943 efa95aa6623ab9ddf1ad633fd5574bc755e8ff07
parent 514942 fb80118393dc7ab2c942eeeaf5a600221e47b716
child 514944 bce1b588653a2c8c6884e0dcce569c820b81651a
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1520907
milestone66.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 1520907 - Rename QueryContext to UrlbarQueryContext. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D17033
browser/components/urlbar/UrlbarController.jsm
browser/components/urlbar/UrlbarInput.jsm
browser/components/urlbar/UrlbarMuxerUnifiedComplete.jsm
browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
browser/components/urlbar/UrlbarProvidersManager.jsm
browser/components/urlbar/UrlbarTokenizer.jsm
browser/components/urlbar/UrlbarUtils.jsm
browser/components/urlbar/tests/browser/browser_UrlbarInput_unit.js
browser/components/urlbar/tests/browser/head.js
browser/components/urlbar/tests/unit/head.js
browser/components/urlbar/tests/unit/test_QueryContext.js
browser/components/urlbar/tests/unit/test_UrlbarController_integration.js
browser/components/urlbar/tests/unit/test_UrlbarController_unit.js
browser/components/urlbar/tests/unit/test_UrlbarQueryContext.js
browser/components/urlbar/tests/unit/xpcshell.ini
browser/docs/AddressBar.rst
tools/lint/eslint/modules.json
--- a/browser/components/urlbar/UrlbarController.jsm
+++ b/browser/components/urlbar/UrlbarController.jsm
@@ -1,15 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-var EXPORTED_SYMBOLS = ["QueryContext", "UrlbarController"];
+var EXPORTED_SYMBOLS = [
+  "UrlbarController",
+];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   AppConstants: "resource://gre/modules/AppConstants.jsm",
   // BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
@@ -77,17 +79,17 @@ class UrlbarController {
    */
   setView(view) {
     this.view = view;
   }
 
   /**
    * Takes a query context and starts the query based on the user input.
    *
-   * @param {QueryContext} queryContext The query details.
+   * @param {UrlbarQueryContext} queryContext The query details.
    */
   async startQuery(queryContext) {
     // Cancel any running query.
     if (this._lastQueryContext) {
       this.cancelQuery(this._lastQueryContext);
     }
     this._lastQueryContext = queryContext;
 
@@ -99,34 +101,34 @@ class UrlbarController {
     await this.manager.startQuery(queryContext, this);
     this._notify("onQueryFinished", queryContext);
   }
 
   /**
    * Cancels an in-progress query. Note, queries may continue running if they
    * can't be canceled.
    *
-   * @param {QueryContext} queryContext The query details.
+   * @param {UrlbarQueryContext} queryContext The query details.
    */
   cancelQuery(queryContext) {
     if (queryContext === this._lastQueryContext) {
       delete this._lastQueryContext;
     }
 
     TelemetryStopwatch.cancel(TELEMETRY_1ST_RESULT, queryContext);
     TelemetryStopwatch.cancel(TELEMETRY_6_FIRST_RESULTS, queryContext);
 
     this.manager.cancelQuery(queryContext);
     this._notify("onQueryCancelled", queryContext);
   }
 
   /**
    * Receives results from a query.
    *
-   * @param {QueryContext} queryContext The query details.
+   * @param {UrlbarQueryContext} queryContext The query details.
    */
   receiveResults(queryContext) {
     if (queryContext.lastTelemetryResultCount < 1 &&
         queryContext.results.length >= 1) {
       TelemetryStopwatch.finish(TELEMETRY_1ST_RESULT, queryContext);
     }
     if (queryContext.lastTelemetryResultCount < 6 &&
         queryContext.results.length >= 6) {
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -5,25 +5,25 @@
 "use strict";
 
 var EXPORTED_SYMBOLS = ["UrlbarInput"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AppConstants: "resource://gre/modules/AppConstants.jsm",
+  ExtensionSearchHandler: "resource://gre/modules/ExtensionSearchHandler.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
-  QueryContext: "resource:///modules/UrlbarUtils.jsm",
   Services: "resource://gre/modules/Services.jsm",
   UrlbarController: "resource:///modules/UrlbarController.jsm",
   UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
+  UrlbarQueryContext: "resource:///modules/UrlbarUtils.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
   UrlbarValueFormatter: "resource:///modules/UrlbarValueFormatter.jsm",
   UrlbarView: "resource:///modules/UrlbarView.jsm",
-  ExtensionSearchHandler: "resource://gre/modules/ExtensionSearchHandler.jsm",
 });
 
 XPCOMUtils.defineLazyServiceGetter(this, "ClipboardHelper",
                                    "@mozilla.org/widget/clipboardhelper;1",
                                    "nsIClipboardHelper");
 
 /**
  * Represents the urlbar <textbox>.
@@ -385,17 +385,17 @@ class UrlbarInput {
    */
   startQuery({
     lastKey = null,
   } = {}) {
     if (this._suppressStartQuery) {
       return;
     }
 
-    this.controller.startQuery(new QueryContext({
+    this.controller.startQuery(new UrlbarQueryContext({
       enableAutofill: UrlbarPrefs.get("autoFill"),
       isPrivate: this.isPrivate,
       lastKey,
       maxResults: UrlbarPrefs.get("maxRichResults"),
       muxer: "UnifiedComplete",
       providers: ["UnifiedComplete"],
       searchString: this.textValue,
     }));
--- a/browser/components/urlbar/UrlbarMuxerUnifiedComplete.jsm
+++ b/browser/components/urlbar/UrlbarMuxerUnifiedComplete.jsm
@@ -1,16 +1,16 @@
 /* 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";
 
 /**
- * This module exports a component used to sort matches in a QueryContext.
+ * This module exports a component used to sort matches in a UrlbarQueryContext.
  */
 
 var EXPORTED_SYMBOLS = ["UrlbarMuxerUnifiedComplete"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   Log: "resource://gre/modules/Log.jsm",
   UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
@@ -27,30 +27,30 @@ const MATCH_TYPE_TO_GROUP = new Map([
   [ UrlbarUtils.MATCH_TYPE.URL, UrlbarUtils.MATCH_GROUP.GENERAL ],
   [ UrlbarUtils.MATCH_TYPE.KEYWORD, UrlbarUtils.MATCH_GROUP.GENERAL ],
   [ UrlbarUtils.MATCH_TYPE.OMNIBOX, UrlbarUtils.MATCH_GROUP.EXTENSION ],
   [ UrlbarUtils.MATCH_TYPE.REMOTE_TAB, UrlbarUtils.MATCH_GROUP.GENERAL ],
 ]);
 
 /**
  * Class used to create a muxer.
- * The muxer receives and sorts matches in a QueryContext.
+ * The muxer receives and sorts matches in a UrlbarQueryContext.
  */
 class MuxerUnifiedComplete extends UrlbarMuxer {
   constructor() {
     super();
   }
 
   get name() {
     return "UnifiedComplete";
   }
 
   /**
-   * Sorts matches in the given QueryContext.
-   * @param {object} context a QueryContext
+   * Sorts matches in the given UrlbarQueryContext.
+   * @param {UrlbarQueryContext} context The query context.
    */
   sort(context) {
     if (!context.results.length) {
       return;
     }
     // Check the first match, if it's a preselected search match, use search buckets.
     let firstMatch = context.results[0];
     let buckets = context.preselected &&
--- a/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
+++ b/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
@@ -154,17 +154,17 @@ var UrlbarProviderUnifiedComplete = new 
 /**
  * Convert from a nsIAutocompleteResult to a list of new matches.
  * Note that at every call we get the full set of matches, included the
  * previously returned ones, and new matches may be inserted in the middle.
  * This means we could sort these wrongly, the muxer should take care of it.
  * In any case at least we're sure there's just one heuristic result and it
  * comes first.
  *
- * @param {object} context the QueryContext
+ * @param {UrlbarQueryContext} context the query context.
  * @param {object} result an nsIAutocompleteResult
  * @param {set} urls a Set containing all the found urls, used to discard
  *        already added matches.
  * @returns {object} { matches: {array}, done: {boolean} }
  */
 function convertResultToMatches(context, result, urls) {
   let matches = [];
   let done = [
--- a/browser/components/urlbar/UrlbarProvidersManager.jsm
+++ b/browser/components/urlbar/UrlbarProvidersManager.jsm
@@ -408,18 +408,18 @@ class SkippableTimer {
     logger.debug(`Canceling timer for ${this._timer.delay}ms`);
     this._timer.cancel();
     delete this._timer;
     return this.fire();
   }
 }
 
 /**
- * Gets an array of the provider sources accepted for a given QueryContext.
- * @param {object} context The QueryContext to examine
+ * Gets an array of the provider sources accepted for a given UrlbarQueryContext.
+ * @param {UrlbarQueryContext} context The query context to examine
  * @returns {array} Array of accepted sources
  */
 function getAcceptableMatchSources(context) {
   let acceptedSources = [];
   // There can be only one restrict token about sources.
   let restrictToken = context.tokens.find(t => [ UrlbarTokenizer.TYPE.RESTRICT_HISTORY,
                                                  UrlbarTokenizer.TYPE.RESTRICT_BOOKMARK,
                                                  UrlbarTokenizer.TYPE.RESTRICT_TAG,
--- a/browser/components/urlbar/UrlbarTokenizer.jsm
+++ b/browser/components/urlbar/UrlbarTokenizer.jsm
@@ -159,20 +159,21 @@ var UrlbarTokenizer = {
     return !this.REGEXP_LIKE_PROTOCOL.test(hostPort) &&
            !this.REGEXP_USERINFO_INVALID_CHARS.test(userinfo) &&
            !this.REGEXP_HOSTPORT_INVALID_CHARS.test(hostPort) &&
            (!this.REGEXP_HOSTPORT_IP_LIKE.test(hostPort) ||
             !this.REGEXP_HOSTPORT_INVALID_IP.test(hostPort));
   },
 
   /**
-   * Tokenizes the searchString from a QueryContext.
-   * @param {object} queryContext
-   *        The QueryContext object to tokenize
-   * @returns {object} the same QueryContext object with a new tokens property.
+   * Tokenizes the searchString from a UrlbarQueryContext.
+   * @param {UrlbarQueryContext} queryContext
+   *        The query context object to tokenize
+   * @returns {UrlbarQueryContext} the same query context object with a new
+   *          tokens property.
    */
   tokenize(queryContext) {
     logger.info("Tokenizing", queryContext);
     let searchString = queryContext.searchString;
     if (searchString.length == 0) {
       queryContext.tokens = [];
       return queryContext;
     }
--- a/browser/components/urlbar/UrlbarUtils.jsm
+++ b/browser/components/urlbar/UrlbarUtils.jsm
@@ -5,19 +5,19 @@
 "use strict";
 
 /**
  * This module exports the UrlbarUtils singleton, which contains constants and
  * helper functions that are useful to all components of the urlbar.
  */
 
 var EXPORTED_SYMBOLS = [
-  "QueryContext",
   "UrlbarMuxer",
   "UrlbarProvider",
+  "UrlbarQueryContext",
   "UrlbarUtils",
 ];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   BinarySearch: "resource://gre/modules/BinarySearch.jsm",
   BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
@@ -227,26 +227,26 @@ var UrlbarUtils = {
         }
       }
       return matches;
     }, []);
   },
 };
 
 /**
- * QueryContext defines a user's autocomplete input from within the Address Bar.
+ * UrlbarQueryContext defines a user's autocomplete input from within the urlbar.
  * It supplements it with details of how the search results should be obtained
  * and what they consist of.
  */
-class QueryContext {
+class UrlbarQueryContext {
   /**
-   * Constructs the QueryContext instance.
+   * Constructs the UrlbarQueryContext instance.
    *
    * @param {object} options
-   *   The initial options for QueryContext.
+   *   The initial options for UrlbarQueryContext.
    * @param {string} options.searchString
    *   The string the user entered in autocomplete. Could be the empty string
    *   in the case of the user opening the popup via the mouse.
    * @param {number} options.lastKey
    *   The last key the user entered (as a key code). Could be null if the search
    *   was started via the mouse.
    * @param {boolean} options.isPrivate
    *   Set to true if this query was started from a private browsing window.
@@ -260,17 +260,17 @@ class QueryContext {
       "enableAutofill",
       "isPrivate",
       "lastKey",
       "maxResults",
       "searchString",
     ]);
 
     if (isNaN(parseInt(options.maxResults))) {
-      throw new Error(`Invalid maxResults property provided to QueryContext`);
+      throw new Error(`Invalid maxResults property provided to UrlbarQueryContext`);
     }
 
     if (options.providers &&
         (!Array.isArray(options.providers) || !options.providers.length)) {
       throw new Error(`Invalid providers list`);
     }
 
     if (options.sources &&
@@ -284,17 +284,17 @@ class QueryContext {
    *
    * @param {object} options The options object to check.
    * @param {array} optionNames The names of the options to check for.
    * @throws {Error} Throws if there is a missing option.
    */
   _checkRequiredOptions(options, optionNames) {
     for (let optionName of optionNames) {
       if (!(optionName in options)) {
-        throw new Error(`Missing or empty ${optionName} provided to QueryContext`);
+        throw new Error(`Missing or empty ${optionName} provided to UrlbarQueryContext`);
       }
       this[optionName] = options[optionName];
     }
   }
 }
 
 /**
  * Base class for a muxer.
@@ -306,17 +306,17 @@ class UrlbarMuxer {
    * Not using a unique name will cause the newest registration to win.
    * @abstract
    */
   get name() {
     return "UrlbarMuxerBase";
   }
   /**
    * Sorts queryContext matches in-place.
-   * @param {object} queryContext the context to sort matches for.
+   * @param {UrlbarQueryContext} queryContext the context to sort matches for.
    * @abstract
    */
   sort(queryContext) {
     throw new Error("Trying to access the base class, must be overridden");
   }
 }
 
 /**
@@ -344,27 +344,28 @@ class UrlbarProvider {
    * the provider.
    * @abstract
    */
   get sources() {
     throw new Error("Trying to access the base class, must be overridden");
   }
   /**
    * Starts querying.
-   * @param {object} queryContext The query context object
+   * @param {UrlbarQueryContext} queryContext The query context object
    * @param {function} addCallback Callback invoked by the provider to add a new
    *        match. A UrlbarMatch should be passed to it.
    * @note Extended classes should return a Promise resolved when the provider
    *       is done searching AND returning matches.
    * @abstract
    */
   startQuery(queryContext, addCallback) {
     throw new Error("Trying to access the base class, must be overridden");
   }
   /**
    * Cancels a running query,
-   * @param {object} queryContext the QueryContext object to cancel query for.
+   * @param {UrlbarQueryContext} queryContext the query context object to cancel
+   *        query for.
    * @abstract
    */
   cancelQuery(queryContext) {
     throw new Error("Trying to access the base class, must be overridden");
   }
 }
--- a/browser/components/urlbar/tests/browser/browser_UrlbarInput_unit.js
+++ b/browser/components/urlbar/tests/browser/browser_UrlbarInput_unit.js
@@ -11,49 +11,49 @@
 let fakeController;
 let generalListener;
 let input;
 let inputOptions;
 
 /**
  * Asserts that the query context has the expected values.
  *
- * @param {QueryContext} context
- * @param {object} expectedValues The expected values for the QueryContext.
+ * @param {UrlbarQueryContext} context
+ * @param {object} expectedValues The expected values for the UrlbarQueryContext.
  */
 function assertContextMatches(context, expectedValues) {
-  Assert.ok(context instanceof QueryContext,
-    "Should be a QueryContext");
+  Assert.ok(context instanceof UrlbarQueryContext,
+    "Should be a UrlbarQueryContext");
 
   for (let [key, value] of Object.entries(expectedValues)) {
     Assert.equal(context[key], value,
-      `Should have the expected value for ${key} in the QueryContext`);
+      `Should have the expected value for ${key} in the UrlbarQueryContext`);
   }
 }
 
 /**
  * Checks the result of a startQuery call on the controller.
  *
  * @param {object} stub The sinon stub that should have been called with the
- *                      QueryContext.
+ *                      UrlbarQueryContext.
  * @param {object} expectedQueryContextProps
  *                   An object consisting of name/value pairs to check against the
- *                   QueryContext properties.
+ *                   UrlbarQueryContext properties.
  */
 function checkStartQueryCall(stub, expectedQueryContextProps) {
   Assert.equal(stub.callCount, 1,
     "Should have called startQuery on the controller");
 
   let args = stub.args[0];
   Assert.equal(args.length, 1,
     "Should have called startQuery with one argument");
 
   let queryContext = args[0];
-  Assert.ok(queryContext instanceof QueryContext,
-    "Should have been passed a QueryContext");
+  Assert.ok(queryContext instanceof UrlbarQueryContext,
+    "Should have been passed a UrlbarQueryContext");
 
   for (let [name, value] of Object.entries(expectedQueryContextProps)) {
     Assert.deepEqual(queryContext[name],
      value, `Should have the correct value for queryContext.${name}`);
   }
 }
 
 add_task(async function setup() {
--- a/browser/components/urlbar/tests/browser/head.js
+++ b/browser/components/urlbar/tests/browser/head.js
@@ -8,19 +8,19 @@
 "use strict";
 
 let sandbox;
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
   Services: "resource://gre/modules/Services.jsm",
-  QueryContext: "resource:///modules/UrlbarUtils.jsm",
   UrlbarController: "resource:///modules/UrlbarController.jsm",
   UrlbarMatch: "resource:///modules/UrlbarMatch.jsm",
+  UrlbarQueryContext: "resource:///modules/UrlbarUtils.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
 });
 
 /* import-globals-from head-common.js */
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/browser/components/urlbar/tests/browser/head-common.js",
   this);
 
--- a/browser/components/urlbar/tests/unit/head.js
+++ b/browser/components/urlbar/tests/unit/head.js
@@ -33,20 +33,21 @@ XPCOMUtils.defineLazyModuleGetters(this,
 ChromeUtils.import("resource://gre/modules/Timer.jsm");
 Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js", this);
 /* globals sinon */
 // ================================================
 
 /**
  * @param {string} searchString The search string to insert into the context.
  * @param {object} properties Overrides for the default values.
- * @returns {QueryContext} Creates a dummy query context with pre-filled required options.
+ * @returns {UrlbarQueryContext} Creates a dummy query context with pre-filled
+ *          required options.
  */
 function createContext(searchString = "foo", properties = {}) {
-  let context = new QueryContext({
+  let context = new UrlbarQueryContext({
     enableAutofill: UrlbarPrefs.get("autoFill"),
     isPrivate: true,
     lastKey: searchString ? searchString[searchString.length - 1] : "",
     maxResults: UrlbarPrefs.get("maxRichResults"),
     searchString,
   });
   return Object.assign(context, properties);
 }
--- a/browser/components/urlbar/tests/unit/test_UrlbarController_integration.js
+++ b/browser/components/urlbar/tests/unit/test_UrlbarController_integration.js
@@ -13,26 +13,26 @@ const TEST_URL = "http://example.com";
 const match = new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
                               UrlbarUtils.MATCH_SOURCE.TABS,
                               { url: TEST_URL });
 let controller;
 
 /**
  * Asserts that the query context has the expected values.
  *
- * @param {QueryContext} context
- * @param {object} expectedValues The expected values for the QueryContext.
+ * @param {UrlbarQueryContext} context
+ * @param {object} expectedValues The expected values for the UrlbarQueryContext.
  */
 function assertContextMatches(context, expectedValues) {
-  Assert.ok(context instanceof QueryContext,
-    "Should be a QueryContext");
+  Assert.ok(context instanceof UrlbarQueryContext,
+    "Should be a UrlbarQueryContext");
 
   for (let [key, value] of Object.entries(expectedValues)) {
     Assert.equal(context[key], value,
-      `Should have the expected value for ${key} in the QueryContext`);
+      `Should have the expected value for ${key} in the UrlbarQueryContext`);
   }
 }
 
 add_task(async function setup() {
   controller = new UrlbarController({
     browserWindow: {
       location: {
         href: AppConstants.BROWSER_CHROME_URL,
--- a/browser/components/urlbar/tests/unit/test_UrlbarController_unit.js
+++ b/browser/components/urlbar/tests/unit/test_UrlbarController_unit.js
@@ -12,26 +12,26 @@
 let fPM;
 let sandbox;
 let generalListener;
 let controller;
 
 /**
  * Asserts that the query context has the expected values.
  *
- * @param {QueryContext} context
- * @param {object} expectedValues The expected values for the QueryContext.
+ * @param {UrlbarQueryContext} context
+ * @param {object} expectedValues The expected values for the UrlbarQueryContext.
  */
 function assertContextMatches(context, expectedValues) {
-  Assert.ok(context instanceof QueryContext,
-    "Should be a QueryContext");
+  Assert.ok(context instanceof UrlbarQueryContext,
+    "Should be a UrlbarQueryContext");
 
   for (let [key, value] of Object.entries(expectedValues)) {
     Assert.equal(context[key], value,
-      `Should have the expected value for ${key} in the QueryContext`);
+      `Should have the expected value for ${key} in the UrlbarQueryContext`);
   }
 }
 
 add_task(function setup() {
   sandbox = sinon.sandbox.create();
 
   fPM = {
     startQuery: sandbox.stub(),
rename from browser/components/urlbar/tests/unit/test_QueryContext.js
rename to browser/components/urlbar/tests/unit/test_UrlbarQueryContext.js
--- a/browser/components/urlbar/tests/unit/test_QueryContext.js
+++ b/browser/components/urlbar/tests/unit/test_UrlbarQueryContext.js
@@ -1,51 +1,51 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 add_task(function test_constructor() {
-  Assert.throws(() => new QueryContext(),
-    /Missing or empty enableAutofill provided to QueryContext/,
+  Assert.throws(() => new UrlbarQueryContext(),
+    /Missing or empty enableAutofill provided to UrlbarQueryContext/,
     "Should throw with no arguments");
 
-  Assert.throws(() => new QueryContext({
+  Assert.throws(() => new UrlbarQueryContext({
     enableAutofill: true,
     isPrivate: false,
     maxResults: 1,
     searchString: "foo",
-  }), /Missing or empty lastKey provided to QueryContext/,
+  }), /Missing or empty lastKey provided to UrlbarQueryContext/,
     "Should throw with a missing lastKey parameter");
 
-  Assert.throws(() => new QueryContext({
+  Assert.throws(() => new UrlbarQueryContext({
     enableAutofill: true,
     isPrivate: false,
     lastKey: "b",
     searchString: "foo",
-  }), /Missing or empty maxResults provided to QueryContext/,
+  }), /Missing or empty maxResults provided to UrlbarQueryContext/,
     "Should throw with a missing maxResults parameter");
 
-  Assert.throws(() => new QueryContext({
+  Assert.throws(() => new UrlbarQueryContext({
     enableAutofill: true,
     lastKey: "b",
     maxResults: 1,
     searchString: "foo",
-  }), /Missing or empty isPrivate provided to QueryContext/,
+  }), /Missing or empty isPrivate provided to UrlbarQueryContext/,
     "Should throw with a missing isPrivate parameter");
 
-  Assert.throws(() => new QueryContext({
+  Assert.throws(() => new UrlbarQueryContext({
     isPrivate: false,
     lastKey: "b",
     maxResults: 1,
     searchString: "foo",
-  }), /Missing or empty enableAutofill provided to QueryContext/,
+  }), /Missing or empty enableAutofill provided to UrlbarQueryContext/,
     "Should throw with a missing enableAutofill parameter");
 
-  let qc = new QueryContext({
+  let qc = new UrlbarQueryContext({
     enableAutofill: false,
     isPrivate: true,
     lastKey: "b",
     maxResults: 1,
     searchString: "foo",
   });
 
   Assert.strictEqual(qc.enableAutofill, false,
--- a/browser/components/urlbar/tests/unit/xpcshell.ini
+++ b/browser/components/urlbar/tests/unit/xpcshell.ini
@@ -5,15 +5,15 @@ support-files =
   data/engine-suggestions.xml
 
 [test_muxer.js]
 [test_providerOpenTabs.js]
 [test_providersManager.js]
 [test_providerUnifiedComplete.js]
 [test_providersManager_filtering.js]
 [test_providersManager_maxResults.js]
-[test_QueryContext.js]
 [test_tokenizer.js]
 [test_UrlbarController_unit.js]
 [test_UrlbarController_telemetry.js]
 [test_UrlbarController_integration.js]
+[test_UrlbarQueryContext.js]
 [test_UrlbarUtils_addToUrlbarHistory.js]
 [test_UrlbarUtils_getShortcutOrURIAndPostData.js]
--- a/browser/docs/AddressBar.rst
+++ b/browser/docs/AddressBar.rst
@@ -29,37 +29,37 @@ The *Address Bar* component lives in the
 
 Global Architecture Overview
 ============================
 
 The *Address Bar* is implemented as a *Model-View-Controller* (MVC) system. One of
 the scopes of this architecture is to allow easy replacement of its components,
 for easier experimentation.
 
-Each search is represented by a unique object, the *QueryContext*. This object,
-created by the *View*, describes the search and is passed through all of the
-components, along the way it gets augmented with additional information.
-The *QueryContext* is passed to the *Controller*, and finally to the *Model*.
-The model appends matches to a property of *QueryContext* in chunks, it sorts
-them through a *Muxer* and then notifies the *Controller*.
+Each search is represented by a unique object, the *UrlbarQueryContext*. This
+object, created by the *View*, describes the search and is passed through all of
+the components, along the way it gets augmented with additional information.
+The *UrlbarQueryContext* is passed to the *Controller*, and finally to the
+*Model*.  The model appends matches to a property of *UrlbarQueryContext* in
+chunks, it sorts them through a *Muxer* and then notifies the *Controller*.
 
 See the specific components below, for additional details about each one's tasks
 and responsibilities.
 
 
-The QueryContext
+The UrlbarQueryContext
 ================
 
-The *QueryContext* object describes a single instance of a search.
+The *UrlbarQueryContext* object describes a single instance of a search.
 It is augmented as it progresses through the system, with various information:
 
 .. highlight:: JavaScript
 .. code::
 
-  QueryContext {
+  UrlbarQueryContext {
     enableAutofill; // {boolean} Whether or not to include autofill results.
     isPrivate; // {boolean} Whether the search started in a private context.
     lastKey; // {string} The last key pressed by the user. This can affect the
              // behavior, for example by not autofilling again when the user
              // hit backspace.
     maxResults; // {integer} The maximum number of results requested. It is
                 // possible to request more results than the shown ones, and
                 // do additional filtering at the View level.
@@ -141,17 +141,17 @@ information sources. Internal providers 
 *jsm* modules with a *UrlbarProvider* name prefix. External providers can be
 registered as *Objects* through the *UrlbarProvidersManager*.
 Each provider is independent and must satisfy a base API, while internal
 implementation details may vary deeply among different providers.
 
 .. important::
 
   Providers are singleton, and must track concurrent searches internally, for
-  example mapping them by QueryContext.
+  example mapping them by UrlbarQueryContext.
 
 .. note::
 
   Internal providers can access the Places database through the
   *PlacesUtils.promiseLargeCacheDBConnection* utility.
 
 .. highlight:: JavaScript
 .. code::
@@ -177,42 +177,43 @@ class UrlbarProvider {
    * the provider.
    * @abstract
    */
   get sources() {
     throw new Error("Trying to access the base class, must be overridden");
   }
   /**
    * Starts querying.
-   * @param {object} QueryContext The query context object
-   * @param {function} AddCallback Callback invoked by the provider to add a new
+   * @param {UrlbarQueryContext} queryContext The query context object
+   * @param {function} addCallback Callback invoked by the provider to add a new
    *        match. A UrlbarMatch should be passed to it.
    * @note Extended classes should return a Promise resolved when the provider
    *       is done searching AND returning matches.
    * @abstract
    */
-  startQuery(QueryContext, AddCallback) {
+  startQuery(queryContext, addCallback) {
     throw new Error("Trying to access the base class, must be overridden");
   }
   /**
    * Cancels a running query,
-   * @param {object} QueryContext the QueryContext object to cancel query for.
+   * @param {UrlbarQueryContext} queryContext The query context object to cancel
+   *        query for.
    * @abstract
    */
-  cancelQuery(QueryContext) {
+  cancelQuery(queryContext) {
     throw new Error("Trying to access the base class, must be overridden");
   }
 }
 
 UrlbarMuxer
 -----------
 
 The *Muxer* is responsible for sorting matches based on their importance and
-additional rules that depend on the QueryContext. The muxer to use is indicated
-by the QueryContext.muxer property.
+additional rules that depend on the UrlbarQueryContext. The muxer to use is
+indicated by the UrlbarQueryContext.muxer property.
 
 .. caution::
 
   The Muxer is a replaceable component, as such what is described here is a
   reference for the default View, but may not be valid for other implementations.
 
 .. highlight:: JavaScript
 .. code::
@@ -222,21 +223,21 @@ class UrlbarMuxer {
    * Unique name for the muxer, used by the context to sort matches.
    * Not using a unique name will cause the newest registration to win.
    * @abstract
    */
   get name() {
     return "UrlbarMuxerBase";
   }
   /**
-   * Sorts QueryContext matches in-place.
-   * @param {object} QueryContext the context to sort matches for.
+   * Sorts UrlbarQueryContext matches in-place.
+   * @param {UrlbarQueryContext} queryContext the context to sort matches for.
    * @abstract
    */
-  sort(QueryContext) {
+  sort(queryContext) {
     throw new Error("Trying to access the base class, must be overridden");
   }
 }
 
 
 The Controller
 ==============
 
@@ -248,17 +249,17 @@ View (e.g. showing/hiding a panel). It i
 .. note::
 
   Each *View* has a different *Controller* instance.
 
 .. highlight:: JavaScript
 .. code::
 
   UrlbarController {
-    async startQuery(QueryContext);
+    async startQuery(queryContext);
     cancelQuery(queryContext);
     // Invoked by the ProvidersManager when matches are available.
     receiveResults(queryContext);
     // Used by the View to listen for matches.
     addQueryListener(listener);
     removeQueryListener(listener);
     // Used to indicate the View context changed, as such any cached information
     // should be reset.
--- a/tools/lint/eslint/modules.json
+++ b/tools/lint/eslint/modules.json
@@ -196,17 +196,17 @@
   "Timer.jsm": ["setTimeout", "setTimeoutWithTarget", "clearTimeout", "setInterval", "setIntervalWithTarget", "clearInterval"],
   "tokenserverclient.js": ["TokenServerClient", "TokenServerClientError", "TokenServerClientNetworkError", "TokenServerClientServerError"],
   "ToolboxProcess.jsm": ["BrowserToolboxProcess"],
   "tps.jsm": ["ACTIONS", "Addons", "Addresses", "Bookmarks", "CreditCards", "Formdata", "History", "Passwords", "Prefs", "Tabs", "TPS", "Windows"],
   "Translation.jsm": ["Translation", "TranslationTelemetry"],
   "Traversal.jsm": ["TraversalRules", "TraversalHelper"],
   "UpdateTelemetry.jsm": ["AUSTLMY"],
   "UpdateTopLevelContentWindowIDHelper.jsm": ["trackBrowserWindow"],
-  "UrlbarUtils.jsm": ["QueryContext", "UrlbarMuxer", "UrlbarProvider", "UrlbarUtils"],
+  "UrlbarUtils.jsm": ["UrlbarQueryContext", "UrlbarMuxer", "UrlbarProvider", "UrlbarUtils"],
   "util.js": ["getChromeWindow", "Utils", "Svc", "SerializableSet"],
   "utils.js": ["btoa", "encryptPayload", "makeIdentityConfig", "makeFxAccountsInternalMock", "configureFxAccountIdentity", "configureIdentity", "SyncTestingInfrastructure", "waitForZeroTimer", "Promise", "MockFxaStorageManager", "AccountState", "sumHistogram", "CommonUtils", "CryptoUtils", "TestingUtils", "promiseZeroTimer", "promiseNamedTimer", "getLoginTelemetryScalar", "syncTestLogging"],
   "Utils.jsm": ["Utils", "Logger", "PivotContext", "PrefCache"],
   "VariablesView.jsm": ["VariablesView", "escapeHTML"],
   "VariablesViewController.jsm": ["VariablesViewController", "StackFrameUtils"],
   "version.jsm": ["VERSION"],
   "vtt.jsm": ["WebVTT"],
   "WebChannel.jsm": ["WebChannel", "WebChannelBroker"],