Bug 1515306 - Rename UrlbarMatch to UrlbarResult. r=mak
authorDão Gottwald <dao@mozilla.com>
Thu, 24 Jan 2019 11:23:20 +0000
changeset 455256 0aa259de1b77361ef89c82592b7485f66d4d33fb
parent 455255 c4ef82395d7c720e7e6f0f8c10d4d5c5800341e3
child 455257 dfc1e458a78055ed5d73807b2c27c8b49fc7ea25
child 455304 2c5eb9d8b8e2680e7ff3d8fe2714bfd78ef0c7d0
push id76700
push userdgottwald@mozilla.com
push dateThu, 24 Jan 2019 11:32:41 +0000
treeherderautoland@0aa259de1b77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1515306
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 1515306 - Rename UrlbarMatch to UrlbarResult. r=mak Differential Revision: https://phabricator.services.mozilla.com/D17481
browser/components/urlbar/UrlbarInput.jsm
browser/components/urlbar/UrlbarMatch.jsm
browser/components/urlbar/UrlbarProviderOpenTabs.jsm
browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
browser/components/urlbar/UrlbarResult.jsm
browser/components/urlbar/UrlbarUtils.jsm
browser/components/urlbar/UrlbarView.jsm
browser/components/urlbar/moz.build
browser/components/urlbar/tests/browser/head.js
browser/components/urlbar/tests/legacy/browser_urlbarDecode.js
browser/components/urlbar/tests/unit/head.js
browser/components/urlbar/tests/unit/test_UrlbarController_integration.js
browser/components/urlbar/tests/unit/test_UrlbarController_telemetry.js
browser/components/urlbar/tests/unit/test_muxer.js
browser/components/urlbar/tests/unit/test_providersManager.js
browser/components/urlbar/tests/unit/test_providersManager_filtering.js
browser/components/urlbar/tests/unit/test_providersManager_maxResults.js
browser/docs/AddressBar.rst
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -220,17 +220,17 @@ class UrlbarInput {
     // Use the selected result if we have one; this should always be the case
     // when the view is open.
     let result = this.view.selectedResult;
     if (result) {
       this.pickResult(event, result);
       return;
     }
 
-    // Use the current value if we don't have a UrlbarMatch e.g. because the
+    // Use the current value if we don't have a UrlbarResult e.g. because the
     // view is closed.
     let url = this.value;
     if (!url) {
       return;
     }
 
     let where = openWhere || this._whereToOpen(event);
 
@@ -271,17 +271,17 @@ class UrlbarInput {
       this.select();
     }
   }
 
   /**
    * Called by the view when a result is picked.
    *
    * @param {Event} event The event that picked the result.
-   * @param {UrlbarMatch} result The result that was picked.
+   * @param {UrlbarResult} result The result that was picked.
    */
   pickResult(event, result) {
     this.setValueFromResult(result);
 
     this.view.close();
 
     // TODO: Work out how we get the user selection behavior, probably via passing
     // it in, since we don't have the old autocomplete controller to work with.
@@ -345,17 +345,17 @@ class UrlbarInput {
     }
 
     this._loadURL(url, where, openParams);
   }
 
   /**
    * Called by the view when moving through results with the keyboard.
    *
-   * @param {UrlbarMatch} result The result that was selected.
+   * @param {UrlbarResult} result The result that was selected.
    */
   setValueFromResult(result) {
     let val;
 
     switch (result.type) {
       case UrlbarUtils.MATCH_TYPE.SEARCH:
         val = result.payload.suggestion || result.payload.query;
         break;
--- a/browser/components/urlbar/UrlbarProviderOpenTabs.jsm
+++ b/browser/components/urlbar/UrlbarProviderOpenTabs.jsm
@@ -10,19 +10,19 @@
  */
 
 var EXPORTED_SYMBOLS = ["UrlbarProviderOpenTabs"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   Log: "resource://gre/modules/Log.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
-  UrlbarMatch: "resource:///modules/UrlbarMatch.jsm",
   UrlbarProvider: "resource:///modules/UrlbarUtils.jsm",
   UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.jsm",
+  UrlbarResult: "resource:///modules/UrlbarResult.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
 });
 
 XPCOMUtils.defineLazyGetter(this, "logger",
   () => Log.repository.getLogger("Places.Urlbar.Provider.OpenTabs"));
 
 /**
  * Class used to create the provider.
@@ -157,18 +157,18 @@ class ProviderOpenTabs extends UrlbarPro
     await conn.executeCached(`
       SELECT url, userContextId
       FROM moz_openpages_temp
     `, {}, (row, cancel) => {
       if (!this.queries.has(queryContext)) {
         cancel();
         return;
       }
-      addCallback(this, new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                                        UrlbarUtils.MATCH_SOURCE.TABS, {
+      addCallback(this, new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                                         UrlbarUtils.MATCH_SOURCE.TABS, {
         url: row.getResultByName("url"),
         userContextId: row.getResultByName("userContextId"),
       }));
     });
     // We are done.
     this.queries.delete(queryContext);
   }
 
--- a/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
+++ b/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
@@ -11,18 +11,18 @@
  */
 
 var EXPORTED_SYMBOLS = ["UrlbarProviderUnifiedComplete"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   Log: "resource://gre/modules/Log.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
-  UrlbarMatch: "resource:///modules/UrlbarMatch.jsm",
   UrlbarProvider: "resource:///modules/UrlbarUtils.jsm",
+  UrlbarResult: "resource:///modules/UrlbarResult.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
 });
 
 XPCOMUtils.defineLazyServiceGetter(this, "unifiedComplete",
   "@mozilla.org/autocomplete/search;1?name=unifiedcomplete",
   "nsIAutoCompleteSearch");
 
@@ -181,17 +181,17 @@ function convertResultToMatches(context,
     // wrong order here, but that's a task for the UrlbarMuxer.
     let url = result.getFinalCompleteValueAt(i);
     if (urls.has(url)) {
       continue;
     }
     urls.add(url);
     // Not used yet: result.getLabelAt(i)
     let style = result.getStyleAt(i);
-    let match = makeUrlbarMatch(context.tokens, {
+    let match = makeUrlbarResult(context.tokens, {
       url,
       icon: result.getImageAt(i),
       style,
       comment: result.getCommentAt(i),
       firstToken: context.tokens[0],
     });
     // Should not happen, but better safe than sorry.
     if (!match) {
@@ -207,102 +207,102 @@ function convertResultToMatches(context,
         context.preselected = true;
       }
     }
   }
   return {matches, done};
 }
 
 /**
- * Creates a new UrlbarMatch from the provided data.
+ * Creates a new UrlbarResult from the provided data.
  * @param {array} tokens the search tokens.
  * @param {object} info includes properties from the legacy match.
- * @returns {object} an UrlbarMatch
+ * @returns {object} an UrlbarResult
  */
-function makeUrlbarMatch(tokens, info) {
+function makeUrlbarResult(tokens, info) {
   let action = PlacesUtils.parseActionUrl(info.url);
   if (action) {
     switch (action.type) {
       case "searchengine":
-        return new UrlbarMatch(
+        return new UrlbarResult(
           UrlbarUtils.MATCH_TYPE.SEARCH,
           UrlbarUtils.MATCH_SOURCE.SEARCH,
-          ...UrlbarMatch.payloadAndSimpleHighlights(tokens, {
+          ...UrlbarResult.payloadAndSimpleHighlights(tokens, {
             engine: [action.params.engineName, true],
             suggestion: [action.params.searchSuggestion, true],
             keyword: [action.params.alias, true],
             query: [action.params.searchQuery, true],
             icon: [info.icon, false],
           })
         );
       case "keyword":
-        return new UrlbarMatch(
+        return new UrlbarResult(
           UrlbarUtils.MATCH_TYPE.KEYWORD,
           UrlbarUtils.MATCH_SOURCE.BOOKMARKS,
-          ...UrlbarMatch.payloadAndSimpleHighlights(tokens, {
+          ...UrlbarResult.payloadAndSimpleHighlights(tokens, {
             url: [action.params.url, true],
             keyword: [info.firstToken, true],
             postData: [action.params.postData, false],
             icon: [info.icon, false],
           })
         );
       case "extension":
-        return new UrlbarMatch(
+        return new UrlbarResult(
           UrlbarUtils.MATCH_TYPE.OMNIBOX,
           UrlbarUtils.MATCH_SOURCE.OTHER_NETWORK,
-          ...UrlbarMatch.payloadAndSimpleHighlights(tokens, {
+          ...UrlbarResult.payloadAndSimpleHighlights(tokens, {
             title: [info.comment, true],
             content: [action.params.content, true],
             keyword: [action.params.keyword, true],
             icon: [info.icon, false],
           })
         );
       case "remotetab":
-        return new UrlbarMatch(
+        return new UrlbarResult(
           UrlbarUtils.MATCH_TYPE.REMOTE_TAB,
           UrlbarUtils.MATCH_SOURCE.TABS,
-          ...UrlbarMatch.payloadAndSimpleHighlights(tokens, {
+          ...UrlbarResult.payloadAndSimpleHighlights(tokens, {
             url: [action.params.url, true],
             title: [info.comment, true],
             device: [action.params.deviceName, true],
             icon: [info.icon, false],
           })
         );
       case "switchtab":
-        return new UrlbarMatch(
+        return new UrlbarResult(
           UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
           UrlbarUtils.MATCH_SOURCE.TABS,
-          ...UrlbarMatch.payloadAndSimpleHighlights(tokens, {
+          ...UrlbarResult.payloadAndSimpleHighlights(tokens, {
             url: [action.params.url, true],
             title: [info.comment, true],
             device: [action.params.deviceName, true],
             icon: [info.icon, false],
           })
         );
       case "visiturl":
-        return new UrlbarMatch(
+        return new UrlbarResult(
           UrlbarUtils.MATCH_TYPE.URL,
           UrlbarUtils.MATCH_SOURCE.OTHER_LOCAL,
-          ...UrlbarMatch.payloadAndSimpleHighlights(tokens, {
+          ...UrlbarResult.payloadAndSimpleHighlights(tokens, {
             title: [info.comment, true],
             url: [action.params.url, true],
             icon: [info.icon, false],
           })
         );
       default:
         Cu.reportError(`Unexpected action type: ${action.type}`);
         return null;
     }
   }
 
   if (info.style.includes("priority-search")) {
-    return new UrlbarMatch(
+    return new UrlbarResult(
       UrlbarUtils.MATCH_TYPE.SEARCH,
       UrlbarUtils.MATCH_SOURCE.SEARCH,
-      ...UrlbarMatch.payloadAndSimpleHighlights(tokens, {
+      ...UrlbarResult.payloadAndSimpleHighlights(tokens, {
         engine: [info.comment, true],
         icon: [info.icon, false],
       })
     );
   }
 
   // This is a normal url/title tuple.
   let source;
@@ -316,19 +316,19 @@ function makeUrlbarMatch(tokens, info) {
       [comment, tags] = info.comment.split(TITLE_TAGS_SEPARATOR);
       tags = tags.split(",").map(t => t.trim());
     }
   } else if (info.style.includes("preloaded-top-sites")) {
     source = UrlbarUtils.MATCH_SOURCE.OTHER_LOCAL;
   } else {
     source = UrlbarUtils.MATCH_SOURCE.HISTORY;
   }
-  return new UrlbarMatch(
+  return new UrlbarResult(
     UrlbarUtils.MATCH_TYPE.URL,
     source,
-    ...UrlbarMatch.payloadAndSimpleHighlights(tokens, {
+    ...UrlbarResult.payloadAndSimpleHighlights(tokens, {
       url: [info.url, true],
       icon: [info.icon, false],
       title: [comment, true],
       tags: [tags, true],
     })
   );
 }
rename from browser/components/urlbar/UrlbarMatch.jsm
rename to browser/components/urlbar/UrlbarResult.jsm
--- a/browser/components/urlbar/UrlbarMatch.jsm
+++ b/browser/components/urlbar/UrlbarResult.jsm
@@ -1,35 +1,35 @@
 /* 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 urlbar match class, each representing a single match.
- * A match is a single search result found by a provider, that can be passed
- * from the model to the view, through the controller. It is mainly defined by
- * a type of the match, and a payload, containing the data. A few getters allow
- * to retrieve information common to all the match types.
+ * This module exports a urlbar result class, each representing a single result
+ * found by a provider that can be passed from the model to the view through
+ * the controller. It is mainly defined by a match type, and a payload,
+ * containing the data. A few getters allow to retrieve information common to all
+ * the match types.
  */
 
-var EXPORTED_SYMBOLS = ["UrlbarMatch"];
+var EXPORTED_SYMBOLS = ["UrlbarResult"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
 });
 
 /**
- * Class used to create a match.
+ * Class used to create a single result.
  */
-class UrlbarMatch {
+class UrlbarResult {
   /**
-   * Creates a match.
+   * Creates a result.
    * @param {integer} matchType one of UrlbarUtils.MATCH_TYPE.* values
    * @param {integer} matchSource one of UrlbarUtils.MATCH_SOURCE.* values
    * @param {object} payload data for this match. A payload should always
    *        contain a way to extract a final url to visit. The url getter
    *        should have a case for each of the types.
    * @param {object} [payloadHighlights] payload highlights, if any. Each
    *        property in the payload may have a corresponding property in this
    *        object. The value of each property should be an array of [index,
@@ -120,17 +120,17 @@ class UrlbarMatch {
   }
 
   /**
    * A convenience function that takes a payload annotated with should-highlight
    * bools and returns the payload and the payload's highlights.  Use this
    * function when the highlighting required by your payload is based on simple
    * substring matching, as done by UrlbarUtils.getTokenMatches().  Pass the
    * return values as the `payload` and `payloadHighlights` params of the
-   * UrlbarMatch constructor.
+   * UrlbarResult constructor.
    *
    * @param {array} tokens The tokens that should be highlighted in each of the
    *        payload properties.
    * @param {object} payloadInfo An object that looks like this:
    *        {
    *          payloadPropertyName: [payloadPropertyValue, shouldHighlight],
    *          ...
    *        }
--- a/browser/components/urlbar/UrlbarUtils.jsm
+++ b/browser/components/urlbar/UrlbarUtils.jsm
@@ -61,17 +61,17 @@ var UrlbarUtils = {
     // Can be delayed, contains results coming from the session or the profile.
     PROFILE: 2,
     // Can be delayed, contains results coming from the network.
     NETWORK: 3,
     // Can be delayed, contains results coming from unknown sources.
     EXTENSION: 4,
   },
 
-  // Defines UrlbarMatch types.
+  // Defines UrlbarResult types.
   MATCH_TYPE: {
     // An open tab.
     // Payload: { icon, url, userContextId }
     TAB_SWITCH: 1,
     // A search suggestion or engine.
     // Payload: { icon, suggestion, keyword, query }
     SEARCH: 2,
     // A common url/title tuple, may be a bookmark with tags.
@@ -346,19 +346,19 @@ class UrlbarProvider {
    */
   get sources() {
     throw new Error("Trying to access the base class, must be overridden");
   }
   /**
    * Starts querying.
    * @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.
+   *        result. A UrlbarResult should be passed to it.
    * @note Extended classes should return a Promise resolved when the provider
-   *       is done searching AND returning matches.
+   *       is done searching AND returning results.
    * @abstract
    */
   startQuery(queryContext, addCallback) {
     throw new Error("Trying to access the base class, must be overridden");
   }
   /**
    * Cancels a running query,
    * @param {UrlbarQueryContext} queryContext the query context object to cancel
--- a/browser/components/urlbar/UrlbarView.jsm
+++ b/browser/components/urlbar/UrlbarView.jsm
@@ -55,17 +55,17 @@ class UrlbarView {
    * @returns {boolean}
    *   Whether the panel is open.
    */
   get isOpen() {
     return this.panel.state == "open" || this.panel.state == "showing";
   }
 
   /**
-   * @returns {UrlbarMatch}
+   * @returns {UrlbarResult}
    *   The currently selected result.
    */
   get selectedResult() {
     if (!this.isOpen) {
       return null;
     }
 
     let resultIndex = this._selected.getAttribute("resultIndex");
--- a/browser/components/urlbar/moz.build
+++ b/browser/components/urlbar/moz.build
@@ -3,22 +3,22 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 with Files("**"):
     BUG_COMPONENT = ("Firefox", "Address Bar")
 
 EXTRA_JS_MODULES += [
     'UrlbarController.jsm',
     'UrlbarInput.jsm',
-    'UrlbarMatch.jsm',
     'UrlbarMuxerUnifiedComplete.jsm',
     'UrlbarPrefs.jsm',
     'UrlbarProviderOpenTabs.jsm',
     'UrlbarProvidersManager.jsm',
     'UrlbarProviderUnifiedComplete.jsm',
+    'UrlbarResult.jsm',
     'UrlbarTokenizer.jsm',
     'UrlbarUtils.jsm',
     'UrlbarValueFormatter.jsm',
     'UrlbarView.jsm',
 ]
 
 TESTING_JS_MODULES += [
     'tests/UrlbarTestUtils.jsm',
--- a/browser/components/urlbar/tests/browser/head.js
+++ b/browser/components/urlbar/tests/browser/head.js
@@ -9,17 +9,17 @@
 
 let sandbox;
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
   Services: "resource://gre/modules/Services.jsm",
   UrlbarController: "resource:///modules/UrlbarController.jsm",
-  UrlbarMatch: "resource:///modules/UrlbarMatch.jsm",
+  UrlbarResult: "resource:///modules/UrlbarResult.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/legacy/browser_urlbarDecode.js
+++ b/browser/components/urlbar/tests/legacy/browser_urlbarDecode.js
@@ -1,17 +1,17 @@
 "use strict";
 
 // This test makes sure (1) you can't break the urlbar by typing particular JSON
 // or JS fragments into it, (2) urlbar.textValue shows URLs unescaped, and (3)
 // the urlbar also shows the URLs embedded in action URIs unescaped.  See bug
 // 1233672.
 
 XPCOMUtils.defineLazyModuleGetters(this, {
-  UrlbarMatch: "resource:///modules/UrlbarMatch.jsm",
+  UrlbarResult: "resource:///modules/UrlbarResult.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
 });
 
 add_task(async function injectJSON() {
   let inputStrs = [
     'http://example.com/ ", "url": "bar',
     "http://example.com/\\",
     'http://example.com/"',
@@ -28,19 +28,19 @@ add_task(async function injectJSON() {
   gURLBar.handleRevert();
   gURLBar.blur();
 });
 
 add_task(function losslessDecode() {
   let urlNoScheme = "example.com/\u30a2\u30a4\u30a6\u30a8\u30aa";
   let url = "http://" + urlNoScheme;
   if (Services.prefs.getBoolPref("browser.urlbar.quantumbar", true)) {
-    const result = new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                                   UrlbarUtils.MATCH_SOURCE.TABS,
-                                   { url });
+    const result = new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                                    UrlbarUtils.MATCH_SOURCE.TABS,
+                                    { url });
     gURLBar.setValueFromResult(result);
   } else {
     gURLBar.textValue = url;
   }
   // Since this is directly setting textValue, it is expected to be trimmed.
   Assert.equal(gURLBar.inputField.value, urlNoScheme,
                "The string displayed in the textbox should not be escaped");
   gURLBar.value = "";
--- a/browser/components/urlbar/tests/unit/head.js
+++ b/browser/components/urlbar/tests/unit/head.js
@@ -14,20 +14,20 @@ if (commonFile) {
 // Put any other stuff relative to this test folder below.
 ChromeUtils.import("resource:///modules/UrlbarUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   HttpServer: "resource://testing-common/httpd.js",
   PlacesTestUtils: "resource://testing-common/PlacesTestUtils.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   UrlbarController: "resource:///modules/UrlbarController.jsm",
   UrlbarInput: "resource:///modules/UrlbarInput.jsm",
-  UrlbarMatch: "resource:///modules/UrlbarMatch.jsm",
   UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
   UrlbarProviderOpenTabs: "resource:///modules/UrlbarProviderOpenTabs.jsm",
   UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.jsm",
+  UrlbarResult: "resource:///modules/UrlbarResult.jsm",
   UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
 });
 
 // ================================================
 // Load mocking/stubbing library, sinon
 // docs: http://sinonjs.org/releases/v2.3.2/
 // Sinon needs Timer.jsm for setTimeout etc.
 ChromeUtils.import("resource://gre/modules/Timer.jsm");
--- a/browser/components/urlbar/tests/unit/test_UrlbarController_integration.js
+++ b/browser/components/urlbar/tests/unit/test_UrlbarController_integration.js
@@ -5,19 +5,19 @@
  * These tests test the UrlbarController in association with the model.
  */
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
 
 const TEST_URL = "http://example.com";
-const match = new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                              UrlbarUtils.MATCH_SOURCE.TABS,
-                              { url: TEST_URL });
+const match = new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                               UrlbarUtils.MATCH_SOURCE.TABS,
+                               { url: TEST_URL });
 let controller;
 
 /**
  * Asserts that the query context has the expected values.
  *
  * @param {UrlbarQueryContext} context
  * @param {object} expectedValues The expected values for the UrlbarQueryContext.
  */
--- a/browser/components/urlbar/tests/unit/test_UrlbarController_telemetry.js
+++ b/browser/components/urlbar/tests/unit/test_UrlbarController_telemetry.js
@@ -4,19 +4,19 @@
 /**
  * These tests unit test the functionality of UrlbarController by stubbing out the
  * model and providing stubs to be called.
  */
 
 "use strict";
 
 const TEST_URL = "http://example.com";
-const MATCH = new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                              UrlbarUtils.MATCH_SOURCE.TABS,
-                              { url: TEST_URL });
+const MATCH = new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                               UrlbarUtils.MATCH_SOURCE.TABS,
+                               { url: TEST_URL });
 const TELEMETRY_1ST_RESULT = "PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS";
 const TELEMETRY_6_FIRST_RESULTS = "PLACES_AUTOCOMPLETE_6_FIRST_RESULTS_TIME_MS";
 
 let controller;
 let firstHistogram;
 let sixthHistogram;
 
 /**
@@ -151,19 +151,19 @@ add_task(async function test_n_autocompl
     "Should have recorded one time for the first result");
   Assert.equal(getHistogramReportsCount(first6Results), 0,
     "Should not have recorded any times (first 6 results)");
 
   // Now add 5 more results, so that the first 6 results is triggered.
   for (let i = 0; i < 5; i++) {
     resultsPromise = promiseControllerNotification(controller, "onQueryResults");
     provider.addResults([
-      new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                      UrlbarUtils.MATCH_SOURCE.TABS,
-                      { url: TEST_URL + "/i" }),
+      new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                       UrlbarUtils.MATCH_SOURCE.TABS,
+                       { url: TEST_URL + "/i" }),
     ]);
     await resultsPromise;
   }
 
   Assert.ok(!TelemetryStopwatch.running(TELEMETRY_1ST_RESULT, context),
     "Should have stopped the first stopwatch");
   Assert.ok(!TelemetryStopwatch.running(TELEMETRY_6_FIRST_RESULTS, context),
     "Should have stopped the first 6 results stopwatch");
@@ -173,19 +173,19 @@ add_task(async function test_n_autocompl
   Assert.deepEqual(updatedResults, firstResults,
     "Should not have changed the histogram for the first result");
   Assert.equal(getHistogramReportsCount(updated6Results), 1,
     "Should have recorded one time for the first 6 results");
 
   // Add one more, to check neither are updated.
   resultsPromise = promiseControllerNotification(controller, "onQueryResults");
   provider.addResults([
-    new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                    UrlbarUtils.MATCH_SOURCE.TABS,
-                    { url: TEST_URL + "/6" }),
+    new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                     UrlbarUtils.MATCH_SOURCE.TABS,
+                     { url: TEST_URL + "/6" }),
   ]);
   await resultsPromise;
 
   let secondUpdateResults = firstHistogram.snapshot();
   let secondUpdate6Results = sixthHistogram.snapshot();
   Assert.deepEqual(secondUpdateResults, firstResults,
     "Should not have changed the histogram for the first result");
   Assert.equal(getHistogramReportsCount(secondUpdate6Results), 1,
--- a/browser/components/urlbar/tests/unit/test_muxer.js
+++ b/browser/components/urlbar/tests/unit/test_muxer.js
@@ -18,25 +18,25 @@ add_task(async function test_muxer() {
   Assert.throws(() => UrlbarProvidersManager.registerMuxer({
                   name: "test",
                   sort: "no",
                 }),
                 /invalid muxer/,
                 "Should throw with invalid sort");
 
   let matches = [
-    new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                    UrlbarUtils.MATCH_SOURCE.TABS,
-                    { url: "http://mozilla.org/tab/" }),
-    new UrlbarMatch(UrlbarUtils.MATCH_TYPE.URL,
-                    UrlbarUtils.MATCH_SOURCE.BOOKMARKS,
-                    { url: "http://mozilla.org/bookmark/" }),
-    new UrlbarMatch(UrlbarUtils.MATCH_TYPE.URL,
-                    UrlbarUtils.MATCH_SOURCE.HISTORY,
-                    { url: "http://mozilla.org/history/" }),
+    new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                     UrlbarUtils.MATCH_SOURCE.TABS,
+                     { url: "http://mozilla.org/tab/" }),
+    new UrlbarResult(UrlbarUtils.MATCH_TYPE.URL,
+                     UrlbarUtils.MATCH_SOURCE.BOOKMARKS,
+                     { url: "http://mozilla.org/bookmark/" }),
+    new UrlbarResult(UrlbarUtils.MATCH_TYPE.URL,
+                     UrlbarUtils.MATCH_SOURCE.HISTORY,
+                     { url: "http://mozilla.org/history/" }),
   ];
 
   let providerName = registerBasicTestProvider(matches);
   let context = createContext(undefined, {providers: [providerName]});
   let controller = new UrlbarController({
     browserWindow: {
       location: {
         href: AppConstants.BROWSER_CHROME_URL,
--- a/browser/components/urlbar/tests/unit/test_providersManager.js
+++ b/browser/components/urlbar/tests/unit/test_providersManager.js
@@ -24,19 +24,19 @@ add_task(async function test_providers()
   Assert.throws(() => UrlbarProvidersManager.registerProvider({
                   name: "test",
                   startQuery: () => {},
                   cancelQuery: "no",
                 }),
                 /invalid provider/,
                 "Should throw with invalid cancelQuery");
 
-  let match = new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                              UrlbarUtils.MATCH_SOURCE.TABS,
-                              { url: "http://mozilla.org/foo/" });
+  let match = new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                               UrlbarUtils.MATCH_SOURCE.TABS,
+                               { url: "http://mozilla.org/foo/" });
 
   let providerName = registerBasicTestProvider([match]);
   let context = createContext(undefined, {providers: [providerName]});
   let controller = new UrlbarController({
     browserWindow: {
       location: {
         href: AppConstants.BROWSER_CHROME_URL,
       },
--- a/browser/components/urlbar/tests/unit/test_providersManager_filtering.js
+++ b/browser/components/urlbar/tests/unit/test_providersManager_filtering.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 add_task(async function test_filtering() {
-  let match = new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                              UrlbarUtils.MATCH_SOURCE.TABS,
-                              { url: "http://mozilla.org/foo/" });
+  let match = new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                               UrlbarUtils.MATCH_SOURCE.TABS,
+                               { url: "http://mozilla.org/foo/" });
   let providerName = registerBasicTestProvider([match]);
   let context = createContext(undefined, {providers: [providerName]});
   let controller = new UrlbarController({
     browserWindow: {
       location: {
         href: AppConstants.BROWSER_CHROME_URL,
       },
     },
@@ -24,19 +24,19 @@ add_task(async function test_filtering()
     promiseControllerNotification(controller, "onQueryFinished"),
   ]);
   await controller.startQuery(context);
   await promise;
   Services.prefs.clearUserPref("browser.urlbar.suggest.openpage");
 
   let matches = [
     match,
-    new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                    UrlbarUtils.MATCH_SOURCE.HISTORY,
-                    { url: "http://mozilla.org/foo/" }),
+    new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                     UrlbarUtils.MATCH_SOURCE.HISTORY,
+                     { url: "http://mozilla.org/foo/" }),
   ];
   providerName = registerBasicTestProvider(matches);
   context = createContext(undefined, {providers: [providerName]});
 
   info("Disable one of the sources, should get a single match");
   Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
   promise = Promise.all([
     promiseControllerNotification(controller, "onQueryResults"),
@@ -62,22 +62,22 @@ add_task(async function test_filtering()
 add_task(async function test_filter_javascript() {
   let controller = new UrlbarController({
     browserWindow: {
       location: {
         href: AppConstants.BROWSER_CHROME_URL,
       },
     },
   });
-  let match = new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                              UrlbarUtils.MATCH_SOURCE.TABS,
-                              { url: "http://mozilla.org/foo/" });
-  let jsMatch = new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                                UrlbarUtils.MATCH_SOURCE.HISTORY,
-                                { url: "javascript:foo" });
+  let match = new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                               UrlbarUtils.MATCH_SOURCE.TABS,
+                               { url: "http://mozilla.org/foo/" });
+  let jsMatch = new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                                 UrlbarUtils.MATCH_SOURCE.HISTORY,
+                                 { url: "javascript:foo" });
   let providerName = registerBasicTestProvider([match, jsMatch]);
   let context = createContext(undefined, {providers: [providerName]});
 
   info("By default javascript should be filtered out");
   let promise = promiseControllerNotification(controller, "onQueryResults");
   await controller.startQuery(context, controller);
   await promise;
   Assert.deepEqual(context.results, [match]);
@@ -105,22 +105,22 @@ add_task(async function test_filter_sour
     browserWindow: {
       location: {
         href: AppConstants.BROWSER_CHROME_URL,
       },
     },
   });
 
   let goodMatches = [
-    new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                    UrlbarUtils.MATCH_SOURCE.TABS,
-                    { url: "http://mozilla.org/foo/" }),
-    new UrlbarMatch(UrlbarUtils.MATCH_TYPE.URL,
-                    UrlbarUtils.MATCH_SOURCE.HISTORY,
-                    { url: "http://mozilla.org/foo/" }),
+    new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                     UrlbarUtils.MATCH_SOURCE.TABS,
+                     { url: "http://mozilla.org/foo/" }),
+    new UrlbarResult(UrlbarUtils.MATCH_TYPE.URL,
+                     UrlbarUtils.MATCH_SOURCE.HISTORY,
+                     { url: "http://mozilla.org/foo/" }),
   ];
   /**
    * A test provider that should be invoked.
    */
   class TestProvider extends UrlbarProvider {
     get name() {
       return "GoodProvider";
     }
@@ -139,19 +139,19 @@ add_task(async function test_filter_sour
         add(this, match);
       }
     }
     cancelQuery(context) {}
   }
   UrlbarProvidersManager.registerProvider(new TestProvider());
 
   let badMatches = [
-    new UrlbarMatch(UrlbarUtils.MATCH_TYPE.URL,
-                    UrlbarUtils.MATCH_SOURCE.BOOKMARKS,
-                    { url: "http://mozilla.org/foo/" }),
+    new UrlbarResult(UrlbarUtils.MATCH_TYPE.URL,
+                     UrlbarUtils.MATCH_SOURCE.BOOKMARKS,
+                     { url: "http://mozilla.org/foo/" }),
   ];
 
   /**
    * A test provider that should not be invoked.
    */
   class NoInvokeProvider extends UrlbarProvider {
     get name() {
       return "BadProvider";
--- a/browser/components/urlbar/tests/unit/test_providersManager_maxResults.js
+++ b/browser/components/urlbar/tests/unit/test_providersManager_maxResults.js
@@ -2,19 +2,19 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 add_task(async function test_maxResults() {
   const MATCHES_LENGTH = 20;
   let matches = [];
   for (let i = 0; i < MATCHES_LENGTH; i++) {
-    matches.push(new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
-                                 UrlbarUtils.MATCH_SOURCE.TABS,
-                                 { url: `http://mozilla.org/foo/${i}` }));
+    matches.push(new UrlbarResult(UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
+                                  UrlbarUtils.MATCH_SOURCE.TABS,
+                                  { url: `http://mozilla.org/foo/${i}` }));
   }
   let providerName = registerBasicTestProvider(matches);
   let context = createContext(undefined, {providers: [providerName]});
   let controller = new UrlbarController({
     browserWindow: {
       location: {
         href: AppConstants.BROWSER_CHROME_URL,
       },
--- a/browser/docs/AddressBar.rst
+++ b/browser/docs/AddressBar.rst
@@ -33,17 +33,17 @@ 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 *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
+*Model*.  The model appends results 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 UrlbarQueryContext
 ================
@@ -72,18 +72,18 @@ It is augmented as it progresses through
     providers; // {array} List of registered provider names. Providers can be
                // registered through the UrlbarProvidersManager.
     sources; // {array} If provided is the list of sources, as defined by
              // MATCH_SOURCE.*, that can be returned by the model.
 
     // Properties added by the Model.
     autofillValue; // {string} the text value that should be autofilled in the
                    // input, if any.
-    preselected; // {boolean} whether the first match should be preselected.
-    results; // {array} list of UrlbarMatch objects.
+    preselected; // {boolean} whether the first result should be preselected.
+    results; // {array} list of UrlbarResult objects.
     tokens; // {array} tokens extracted from the searchString, each token is an
             // object in the form {type, value}.
   }
 
 
 The Model
 =========
 
@@ -95,28 +95,28 @@ across them.
 
 The *UrlbarProvidersManager* is a singleton, it registers internal providers on
 startup and can register/unregister providers on the fly.
 It can manage multiple concurrent queries, and tracks them internally as
 separate *Query* objects.
 
 The *Controller* starts and stops queries through the *UrlbarProvidersManager*.
 It's possible to wait for the promise returned by *startQuery* to know when no
-more matches will be returned, it is not mandatory though.
+more results will be returned, it is not mandatory though.
 Queries can be canceled.
 
 .. note::
 
   Canceling a query will issue an interrupt() on the database connection,
   terminating any running and future SQL query, unless a query is running inside
   a *runInCriticalSection* task.
 
 The *searchString* gets tokenized by the `UrlbarTokenizer <https://dxr.mozilla.org/mozilla-central/source/browser/components/urlbar/UrlbarTokenizer.jsm>`_
 component into tokens, some of these tokens have a special meaning and can be
-used by the user to restrict the search to specific type of matches (See the
+used by the user to restrict the search to specific match type (See the
 *UrlbarTokenizer::TYPE* enum).
 
 .. caution::
 
   The tokenizer uses heuristics to determine each token's type, as such the
   consumer may want to check the value before applying filters.
 
 .. highlight:: JavaScript
@@ -131,17 +131,17 @@ used by the user to restrict the search 
     cancelQuery(queryContext);
     // Can be used by providers to run uninterruptible queries.
     runInCriticalSection(taskFn);
   }
 
 UrlbarProvider
 --------------
 
-A provider is specialized into searching and returning matches from different
+A provider is specialized into searching and returning results from different
 information sources. Internal providers are usually implemented in separate
 *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::
 
@@ -179,19 +179,19 @@ class UrlbarProvider {
    */
   get sources() {
     throw new Error("Trying to access the base class, must be overridden");
   }
   /**
    * Starts querying.
    * @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.
+   *        result. A UrlbarResult should be passed to it.
    * @note Extended classes should return a Promise resolved when the provider
-   *       is done searching AND returning matches.
+   *       is done searching AND returning results.
    * @abstract
    */
   startQuery(queryContext, addCallback) {
     throw new Error("Trying to access the base class, must be overridden");
   }
   /**
    * Cancels a running query,
    * @param {UrlbarQueryContext} queryContext The query context object to cancel
@@ -201,40 +201,40 @@ class UrlbarProvider {
   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
+The *Muxer* is responsible for sorting results based on their importance and
 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::
 
 class UrlbarMuxer {
   /**
-   * Unique name for the muxer, used by the context to sort matches.
+   * Unique name for the muxer, used by the context to sort results.
    * Not using a unique name will cause the newest registration to win.
    * @abstract
    */
   get name() {
     return "UrlbarMuxerBase";
   }
   /**
-   * Sorts UrlbarQueryContext matches in-place.
-   * @param {UrlbarQueryContext} queryContext the context to sort matches for.
+   * Sorts UrlbarQueryContext results in-place.
+   * @param {UrlbarQueryContext} queryContext the context to sort results for.
    * @abstract
    */
   sort(queryContext) {
     throw new Error("Trying to access the base class, must be overridden");
   }
 }
 
 
@@ -251,19 +251,19 @@ View (e.g. showing/hiding a panel). It i
   Each *View* has a different *Controller* instance.
 
 .. highlight:: JavaScript
 .. code::
 
   UrlbarController {
     async startQuery(queryContext);
     cancelQuery(queryContext);
-    // Invoked by the ProvidersManager when matches are available.
+    // Invoked by the ProvidersManager when results are available.
     receiveResults(queryContext);
-    // Used by the View to listen for matches.
+    // Used by the View to listen for results.
     addQueryListener(listener);
     removeQueryListener(listener);
     // Used to indicate the View context changed, as such any cached information
     // should be reset.
     tabContextChanged();
   }
 
 
@@ -338,41 +338,41 @@ Represents the base *View* implementatio
 .. code::
 
   UrlbarView {
     // Manage View visibility.
     open();
     close();
     // Invoked when the query starts.
     onQueryStarted(queryContext);
-    // Invoked when new matches are available.
+    // Invoked when new results are available.
     onQueryResults(queryContext);
     // Invoked when the query has been canceled.
     onQueryCancelled(queryContext);
     // Invoked when the query is done.
     onQueryFinished(queryContext);
   }
 
-UrlbarMatch
+UrlbarResult
 ===========
 
-An `UrlbarMatch <https://dxr.mozilla.org/mozilla-central/source/browser/components/urlbar/UrlbarMatch.jsm>`_
-instance represents a single match (search result) with a match type, that
+An `UrlbarResult <https://dxr.mozilla.org/mozilla-central/source/browser/components/urlbar/UrlbarResult.jsm>`_
+instance represents a single search result with a match type, that
 identifies specific kind of results.
 Each kind has its own properties, that the *View* may support, and a few common
-properties, supported by all of the matches.
+properties, supported by all of the results.
 
 .. note::
 
   Match types are also enumerated by *UrlbarUtils.MATCH_TYPE*.
 
 .. highlight:: JavaScript
 .. code::
 
-  UrlbarMatch {
+  UrlbarResult {
     constructor(matchType, payload);
 
     type: {integer} One of UrlbarUtils.MATCH_TYPE.
     source: {integer} One of UrlbarUtils.MATCH_SOURCE.
     title: {string} A title that may be used as a label for this match.
     icon: {string} Url of an icon for this match.
     payload: {object} Object containing properties for the specific MATCH_TYPE.
   }