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].
This commit is contained in:
Bill Gianopoulos 2017-08-17 16:37:09 -04:00
Родитель cba230ede1
Коммит 3c810096ff
1 изменённых файлов: 3 добавлений и 12 удалений

Просмотреть файл

@ -1167,7 +1167,6 @@ nsPlacesAutoComplete.prototype = {
} }
let entryTitle = aRow.getResultByIndex(kQueryIndexTitle) || ""; let entryTitle = aRow.getResultByIndex(kQueryIndexTitle) || "";
let entryFavicon = "";
let entryBookmarked = aRow.getResultByIndex(kQueryIndexBookmarked); let entryBookmarked = aRow.getResultByIndex(kQueryIndexBookmarked);
let entryBookmarkTitle = entryBookmarked ? let entryBookmarkTitle = entryBookmarked ?
aRow.getResultByIndex(kQueryIndexBookmarkTitle) : null; aRow.getResultByIndex(kQueryIndexBookmarkTitle) : null;
@ -1215,7 +1214,7 @@ nsPlacesAutoComplete.prototype = {
} }
} }
this._addToResults(entryId, url, title, entryFavicon, action + style); this._addToResults(entryId, url, title, action + style);
return true; return true;
}, },
@ -1254,13 +1253,11 @@ nsPlacesAutoComplete.prototype = {
* The URI spec for the entry. * The URI spec for the entry.
* @param aTitle * @param aTitle
* The title to give the entry. * The title to give the entry.
* @param aFaviconSpec
* The favicon to give to the entry.
* @param aStyle * @param aStyle
* Indicates how the entry should be styled when displayed. * Indicates how the entry should be styled when displayed.
*/ */
_addToResults: function PAC_addToResults(aPlaceId, aURISpec, aTitle, _addToResults: function PAC_addToResults(aPlaceId, aURISpec, aTitle,
aFaviconSpec, aStyle) aStyle)
{ {
// Add this to our internal tracker to ensure duplicates do not end up in // 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. // the result. _usedPlaces is an Object that is being used as a set.
@ -1271,13 +1268,7 @@ nsPlacesAutoComplete.prototype = {
this._usedPlaces[aPlaceId || aURISpec] = true; this._usedPlaces[aPlaceId || aURISpec] = true;
// Obtain the favicon for this URI. // Obtain the favicon for this URI.
let favicon; let favicon = "page-icon:" + aURISpec;
if (aFaviconSpec) {
let uri = NetUtil.newURI(aFaviconSpec);
favicon = PlacesUtils.favicons.getFaviconLinkForIcon(uri).spec;
}
favicon = favicon || PlacesUtils.favicons.defaultFavicon.spec;
this._result.appendMatch(aURISpec, aTitle, favicon, aStyle); this._result.appendMatch(aURISpec, aTitle, favicon, aStyle);
}, },