Bug 713269 - Use Asynchronous Favicons API for PlacesUtils.jsm. r=mak
authorFelix Fung <ffung@mozilla.com>
Wed, 11 Jan 2012 00:04:01 -0500
changeset 84202 cee13e0b2ee4453596c39da411818f2f699d45a9
parent 84201 f78cc74ee58933cefcae2db7032bd5af92b0545d
child 84203 03d77ca70f27554ea955e1e2cdd3201a623a2620
push id4785
push userfelix.the.cheshire.cat@gmail.com
push dateWed, 11 Jan 2012 05:13:18 +0000
treeherdermozilla-inbound@cee13e0b2ee4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs713269
milestone12.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 713269 - Use Asynchronous Favicons API for PlacesUtils.jsm. r=mak
toolkit/components/places/PlacesUtils.jsm
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -1444,27 +1444,27 @@ var PlacesUtils = {
         if (aData.charset)
           this.history.setCharsetForURI(this._uri(aData.uri), aData.charset);
         if (aData.uri.substr(0, 6) == "place:")
           searchIds.push(id);
         if (aData.icon) {
           try {
             // Create a fake faviconURI to use (FIXME: bug 523932)
             let faviconURI = this._uri("fake-favicon-uri:" + aData.uri);
-            this.favicons.setFaviconUrlForPage(this._uri(aData.uri), faviconURI);
-            this.favicons.setFaviconDataFromDataURL(faviconURI, aData.icon, 0);
+            this.favicons.replaceFaviconDataFromDataURL(faviconURI, aData.icon, 0);
+            this.favicons.setAndFetchFaviconForPage(this._uri(aData.uri), faviconURI, false);
           } catch (ex) {
             Components.utils.reportError("Failed to import favicon data:"  + ex);
           }
         }
         if (aData.iconUri) {
           try {
-            this.favicons.setAndLoadFaviconForPage(this._uri(aData.uri),
-                                                   this._uri(aData.iconUri),
-                                                   false);
+            this.favicons.setAndFetchFaviconForPage(this._uri(aData.uri),
+                                                    this._uri(aData.iconUri),
+                                                    false);
           } catch (ex) {
             Components.utils.reportError("Failed to import favicon URI:"  + ex);
           }
         }
         break;
       case this.TYPE_X_MOZ_PLACE_SEPARATOR:
         id = this.bookmarks.insertSeparator(aContainer, aIndex);
         break;
@@ -2214,17 +2214,17 @@ XPCOMUtils.defineLazyGetter(PlacesUtils,
 });
 
 XPCOMUtils.defineLazyGetter(PlacesUtils, "ghistory2", function() {
   return PlacesUtils.history.QueryInterface(Ci.nsIGlobalHistory2);
 });
 
 XPCOMUtils.defineLazyServiceGetter(PlacesUtils, "favicons",
                                    "@mozilla.org/browser/favicon-service;1",
-                                   "nsIFaviconService");
+                                   "mozIAsyncFavicons");
 
 XPCOMUtils.defineLazyServiceGetter(PlacesUtils, "bookmarks",
                                    "@mozilla.org/browser/nav-bookmarks-service;1",
                                    "nsINavBookmarksService");
 
 XPCOMUtils.defineLazyServiceGetter(PlacesUtils, "annotations",
                                    "@mozilla.org/browser/annotation-service;1",
                                    "nsIAnnotationService");