Bug 1534830 - Fix UrlbarUtils.ICON.DEFAULT. r=mak
authorDão Gottwald <dao@mozilla.com>
Wed, 13 Mar 2019 12:27:43 +0000
changeset 524697 17c3b29f3b070a129be84a7f2daeb3fc71d871d1
parent 524696 4be0480f48d3bede45eb0f18479dc7cd2d686aa8
child 524698 7c663cf76b8d561d3334b11314ca41255b7a1b66
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [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.