Bug - 1355780 - Part 2 - Use the "page-icon:" protocol. r=frg
authorBill Gianopoulos <wgianopoulos@gmail.com>
Thu, 17 Aug 2017 16:37:09 -0400
changeset 22026 a6d47656d6e349c28b188fd5ddb77329d816f017
parent 22025 8e63fdcf0e3c856af2314679f0968c0fed2bc656
child 22027 1777ffb9363fbcefae20fc70dbc6652943f1eb77
push id13445
push userfrgrahl@gmx.net
push dateWed, 23 Aug 2017 17:25:08 +0000
treeherdercomm-central@a6d47656d6e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg
bugs1355780, 977177
Bug - 1355780 - Part 2 - Use the "page-icon:" protocol. r=frg Port Bug 977177 [move favicons blobs out of places.sqlite to their own database].
suite/common/places/nsPlacesAutoComplete.js
--- a/suite/common/places/nsPlacesAutoComplete.js
+++ b/suite/common/places/nsPlacesAutoComplete.js
@@ -1162,17 +1162,16 @@ nsPlacesAutoComplete.prototype = {
                         ["moz-action:switchtab," + escapedEntryURL, "action "] :
                         [escapedEntryURL, ""];
 
     if (this._inResults(entryId, url)) {
       return false;
     }
 
     let entryTitle = aRow.getResultByIndex(kQueryIndexTitle) || "";
-    let entryFavicon = "";
     let entryBookmarked = aRow.getResultByIndex(kQueryIndexBookmarked);
     let entryBookmarkTitle = entryBookmarked ?
       aRow.getResultByIndex(kQueryIndexBookmarkTitle) : null;
     let entryTags = aRow.getResultByIndex(kQueryIndexTags) || "";
 
     // Always prefer the bookmark title unless it is empty
     let title = entryBookmarkTitle || entryTitle;
 
@@ -1210,17 +1209,17 @@ nsPlacesAutoComplete.prototype = {
       else if (entryBookmarked) {
         style = "bookmark";
       }
       else {
         style = "favicon";
       }
     }
 
-    this._addToResults(entryId, url, title, entryFavicon, action + style);
+    this._addToResults(entryId, url, title, action + style);
     return true;
   },
 
   /**
    * Checks to see if the given place has already been added to the results.
    *
    * @param aPlaceId
    *        The place id to check for, may be null.
@@ -1249,40 +1248,32 @@ nsPlacesAutoComplete.prototype = {
    *
    * @param aPlaceId
    *        The place_id of the item to be added to the result set.  This is
    *        used by _inResults.
    * @param aURISpec
    *        The URI spec for the entry.
    * @param aTitle
    *        The title to give the entry.
-   * @param aFaviconSpec
-   *        The favicon to give to the entry.
    * @param aStyle
    *        Indicates how the entry should be styled when displayed.
    */
   _addToResults: function PAC_addToResults(aPlaceId, aURISpec, aTitle,
-                                           aFaviconSpec, aStyle)
+                                           aStyle)
   {
     // Add this to our internal tracker to ensure duplicates do not end up in
     // the result.  _usedPlaces is an Object that is being used as a set.
     // Not all entries have a place id, thus we fallback to the url for them.
     // We cannot use only the url since keywords entries are modified to
     // include the search string, and would be returned multiple times.  Ids
     // are faster too.
     this._usedPlaces[aPlaceId || aURISpec] = true;
 
     // Obtain the favicon for this URI.
-    let favicon;
-    if (aFaviconSpec) {
-      let uri = NetUtil.newURI(aFaviconSpec);
-      favicon = PlacesUtils.favicons.getFaviconLinkForIcon(uri).spec;
-    }
-    favicon = favicon || PlacesUtils.favicons.defaultFavicon.spec;
-
+    let favicon = "page-icon:" + aURISpec;
     this._result.appendMatch(aURISpec, aTitle, favicon, aStyle);
   },
 
   /**
    * Determines if the specified AutoComplete behavior is set.
    *
    * @param aType
    *        The behavior type to test for.