Bug 1534830 - Fix UrlbarUtils.ICON.DEFAULT. r=mak
authorDão Gottwald <dao@mozilla.com>
Wed, 13 Mar 2019 12:27:43 +0000
changeset 521699 17c3b29f3b07
parent 521698 4be0480f48d3
child 521700 7c663cf76b8d
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1534830
milestone67.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 1534830 - Fix UrlbarUtils.ICON.DEFAULT. r=mak Differential Revision: https://phabricator.services.mozilla.com/D23297
browser/components/urlbar/UrlbarUtils.jsm
--- a/browser/components/urlbar/UrlbarUtils.jsm
+++ b/browser/components/urlbar/UrlbarUtils.jsm
@@ -97,17 +97,17 @@ var UrlbarUtils = {
     SEARCH: 3,
     TABS: 4,
     OTHER_LOCAL: 5,
     OTHER_NETWORK: 6,
   },
 
   // This defines icon locations that are common used in the UI.
   ICON: {
-    DEFAULT: Ci.nsIFaviconService.FAVICON_DEFAULT_URL,
+    // DEFAULT is defined lazily so it doesn't eagerly initialize PlacesUtils.
     SEARCH_GLASS: "chrome://browser/skin/search-glass.svg",
   },
 
   // IME composition states.
   COMPOSITION: {
     NONE: 1,
     COMPOSING: 2,
     COMMIT: 3,
@@ -359,16 +359,20 @@ var UrlbarUtils = {
       }
 
       pasteData = pasteData.substring(pasteData.indexOf(":") + 1);
     }
     return pasteData;
   },
 };
 
+XPCOMUtils.defineLazyGetter(UrlbarUtils.ICON, "DEFAULT", () => {
+  return PlacesUtils.favicons.defaultFavicon.spec;
+});
+
 /**
  * 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 UrlbarQueryContext {
   /**
    * Constructs the UrlbarQueryContext instance.