Bug 1518551 - Remove the 'MOZ_TOOLKIT_SEARCH' build config constant, because it's unused; we always enable the search service. r=florian
authorMike de Boer <mdeboer@mozilla.com>
Wed, 24 Apr 2019 08:52:32 +0000
changeset 470643 da2bd2908b7145048fca45f395d45ecc4da6e9a6
parent 470642 628d5d8c719dc57c782d83de80a48089d874c561
child 470644 093bf5cadbcc8f90c1e722fec344e4dba71fdf27
push id35910
push usercbrindusan@mozilla.com
push dateWed, 24 Apr 2019 21:51:39 +0000
treeherdermozilla-central@b9a625eff9e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1518551
milestone68.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 1518551 - Remove the 'MOZ_TOOLKIT_SEARCH' build config constant, because it's unused; we always enable the search service. r=florian Differential Revision: https://phabricator.services.mozilla.com/D27702
docshell/base/moz.build
docshell/base/nsDefaultURIFixup.cpp
docshell/base/nsDocShell.cpp
dom/ipc/ContentParent.cpp
dom/ipc/moz.build
old-configure.in
toolkit/components/moz.build
toolkit/components/search/moz.build
toolkit/modules/AppConstants.jsm
toolkit/modules/Services.jsm
toolkit/modules/moz.build
--- a/docshell/base/moz.build
+++ b/docshell/base/moz.build
@@ -116,13 +116,10 @@ LOCAL_INCLUDES += [
     '/layout/xul',
     '/netwerk/base',
     '/netwerk/protocol/viewsource',
     '/toolkit/components/browser',
     '/toolkit/components/find',
     '/tools/profiler',
 ]
 
-if CONFIG['MOZ_TOOLKIT_SEARCH']:
-    DEFINES['MOZ_TOOLKIT_SEARCH'] = True
-
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
--- a/docshell/base/nsDefaultURIFixup.cpp
+++ b/docshell/base/nsDefaultURIFixup.cpp
@@ -6,20 +6,17 @@
 
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIProtocolHandler.h"
 
 #include "nsIFile.h"
 #include <algorithm>
 
-#ifdef MOZ_TOOLKIT_SEARCH
-#  include "nsISearchService.h"
-#endif
-
+#include "nsISearchService.h"
 #include "nsIURIFixup.h"
 #include "nsIURIMutator.h"
 #include "nsDefaultURIFixup.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "mozilla/TextUtils.h"
@@ -424,17 +421,16 @@ nsDefaultURIFixup::KeywordToURI(const ns
       postData.forget(aPostData);
     }
 
     nsCOMPtr<nsIURI> temp = DeserializeURI(uri);
     info->mPreferredURI = temp.forget();
     return NS_OK;
   }
 
-#ifdef MOZ_TOOLKIT_SEARCH
   // Try falling back to the search service's default search engine
   nsCOMPtr<nsISearchService> searchSvc =
       do_GetService("@mozilla.org/browser/search-service;1");
   if (searchSvc) {
     nsCOMPtr<nsISearchEngine> defaultEngine;
     searchSvc->GetDefaultEngine(getter_AddRefs(defaultEngine));
     if (defaultEngine) {
       nsCOMPtr<nsISearchSubmission> submission;
@@ -469,17 +465,16 @@ nsDefaultURIFixup::KeywordToURI(const ns
         }
 
         defaultEngine->GetName(info->mKeywordProviderName);
         info->mKeywordAsSent = keywordW;
         return submission->GetUri(getter_AddRefs(info->mPreferredURI));
       }
     }
   }
-#endif
 
   // out of options
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 // Helper to deal with passing around uri fixup stuff
 nsresult nsDefaultURIFixup::TryKeywordFixupForURIInfo(
     const nsACString& aURIString, nsDefaultURIFixupInfo* aFixupInfo,
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -178,16 +178,17 @@
 #include "nsDOMCID.h"
 #include "nsDOMNavigationTiming.h"
 #include "nsDSURIContentListener.h"
 #include "nsEditingSession.h"
 #include "nsError.h"
 #include "nsEscape.h"
 #include "nsFocusManager.h"
 #include "nsGlobalWindow.h"
+#include "nsISearchService.h"
 #include "nsJSEnvironment.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsObjectLoadingContent.h"
 #include "nsPingListener.h"
 #include "nsPoint.h"
 #include "nsQueryObject.h"
 #include "nsRect.h"
@@ -217,20 +218,16 @@
 #  include "mozIPlacesPendingOperation.h"
 #endif
 
 #if NS_PRINT_PREVIEW
 #  include "nsIDocumentViewerPrint.h"
 #  include "nsIWebBrowserPrint.h"
 #endif
 
-#ifdef MOZ_TOOLKIT_SEARCH
-#  include "nsISearchService.h"
-#endif
-
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::net;
 
 // Threshold value in ms for META refresh based redirects
 #define REFRESH_REDIRECT_TIMER 15000
 
 // Hint for native dispatch of events on how long to delay after
@@ -13224,32 +13221,30 @@ void nsDocShell::MaybeNotifyKeywordSearc
   if (XRE_IsContentProcess()) {
     dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
     if (contentChild) {
       contentChild->SendNotifyKeywordSearchLoading(aProvider, aKeyword);
     }
     return;
   }
 
-#ifdef MOZ_TOOLKIT_SEARCH
   nsCOMPtr<nsISearchService> searchSvc =
       do_GetService("@mozilla.org/browser/search-service;1");
   if (searchSvc) {
     nsCOMPtr<nsISearchEngine> searchEngine;
     searchSvc->GetEngineByName(aProvider, getter_AddRefs(searchEngine));
     if (searchEngine) {
       nsCOMPtr<nsIObserverService> obsSvc = services::GetObserverService();
       if (obsSvc) {
         // Note that "keyword-search" refers to a search via the url
         // bar, not a bookmarks keyword search.
         obsSvc->NotifyObservers(searchEngine, "keyword-search", aKeyword.get());
       }
     }
   }
-#endif
 }
 
 NS_IMETHODIMP
 nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, nsIChannel* aChannel,
                                       bool* aShouldIntercept) {
   return mInterceptController->ShouldPrepareForIntercept(aURI, aChannel,
                                                          aShouldIntercept);
 }
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -158,16 +158,17 @@
 #include "nsIMozBrowserFrame.h"
 #include "nsIMutable.h"
 #include "nsIObserverService.h"
 #include "nsIParentChannel.h"
 #include "nsIPresShell.h"
 #include "nsIRemoteWindowContext.h"
 #include "nsIScriptError.h"
 #include "nsIScriptSecurityManager.h"
+#include "nsISearchService.h"
 #include "nsIServiceWorkerManager.h"
 #include "nsISiteSecurityService.h"
 #include "nsISound.h"
 #include "mozilla/mozSpellChecker.h"
 #include "nsIStringBundle.h"
 #include "nsISupportsPrimitives.h"
 #include "nsITimer.h"
 #include "nsIURIFixup.h"
@@ -269,20 +270,16 @@
 #    include "mozilla/SandboxBroker.h"
 #    include "mozilla/SandboxBrokerPolicyFactory.h"
 #  endif
 #  if defined(XP_MACOSX)
 #    include "mozilla/Sandbox.h"
 #  endif
 #endif
 
-#ifdef MOZ_TOOLKIT_SEARCH
-#  include "nsISearchService.h"
-#endif
-
 #ifdef XP_WIN
 #  include "mozilla/audio/AudioNotificationSender.h"
 #  include "mozilla/widget/AudioSession.h"
 #endif
 
 #ifdef ACCESSIBILITY
 #  include "nsAccessibilityService.h"
 #endif
@@ -4193,33 +4190,31 @@ mozilla::ipc::IPCResult ContentParent::R
   nsCOMPtr<nsIURI> uri;
   info->GetPreferredURI(getter_AddRefs(uri));
   SerializeURI(uri, *aURI);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvNotifyKeywordSearchLoading(
     const nsString& aProvider, const nsString& aKeyword) {
-#ifdef MOZ_TOOLKIT_SEARCH
   nsCOMPtr<nsISearchService> searchSvc =
       do_GetService("@mozilla.org/browser/search-service;1");
   if (searchSvc) {
     nsCOMPtr<nsISearchEngine> searchEngine;
     searchSvc->GetEngineByName(aProvider, getter_AddRefs(searchEngine));
     if (searchEngine) {
       nsCOMPtr<nsIObserverService> obsSvc =
           mozilla::services::GetObserverService();
       if (obsSvc) {
         // Note that "keyword-search" refers to a search via the url
         // bar, not a bookmarks keyword search.
         obsSvc->NotifyObservers(searchEngine, "keyword-search", aKeyword.get());
       }
     }
   }
-#endif
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvCopyFavicon(
     const URIParams& aOldURI, const URIParams& aNewURI,
     const IPC::Principal& aLoadingPrincipal, const bool& aInPrivateBrowsing) {
   nsCOMPtr<nsIURI> oldURI = DeserializeURI(aOldURI);
   if (!oldURI) {
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -191,19 +191,16 @@ if CONFIG['OS_ARCH'] != 'WINNT':
         '/modules/libjar',
     ]
 
 DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     DEFINES['MOZ_ENABLE_FREETYPE'] = True
 
-if CONFIG['MOZ_TOOLKIT_SEARCH']:
-    DEFINES['MOZ_TOOLKIT_SEARCH'] = True
-
 JAR_MANIFESTS += ['jar.mn']
 
 BROWSER_CHROME_MANIFESTS += ['tests/browser.ini']
 MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
 XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini']
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
--- a/old-configure.in
+++ b/old-configure.in
@@ -1617,17 +1617,16 @@ ENABLE_SYSTEM_EXTENSION_DIRS=1
 MOZ_BRANDING_DIRECTORY=
 MOZ_OFFICIAL_BRANDING=
 MOZ_AUTH_EXTENSION=1
 if test "$MOZ_IOS"; then
    MOZ_AUTH_EXTENSION=
 fi
 MOZ_PREF_EXTENSIONS=1
 MOZ_SPELLCHECK=1
-MOZ_TOOLKIT_SEARCH=1
 MOZ_UNIVERSALCHARDET=1
 MOZ_XUL=1
 MOZ_ZIPWRITER=1
 MOZ_NO_SMART_CARDS=
 NECKO_COOKIES=1
 MOZ_USE_NATIVE_POPUP_WINDOWS=
 MOZ_EXCLUDE_HYPHENATION_DICTIONARIES=
 MOZ_SANDBOX=1
@@ -2897,17 +2896,16 @@ AC_SUBST(RCFLAGS)
 AC_SUBST(IMPLIB)
 AC_SUBST(FILTER)
 AC_SUBST(MOZ_AUTH_EXTENSION)
 AC_SUBST(MOZ_PREF_EXTENSIONS)
 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
 AC_SUBST(WARNINGS_AS_ERRORS)
 AC_SUBST_LIST(WARNINGS_CFLAGS)
 AC_SUBST_SET(MOZ_EXTENSIONS)
-AC_SUBST(MOZ_TOOLKIT_SEARCH)
 
 AC_SUBST(MOZ_UNIVERSALCHARDET)
 AC_SUBST(MOZ_SPELLCHECK)
 AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
 AC_SUBST(MOZ_CRASHREPORTER)
 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
 AC_SUBST(MOZ_STUB_INSTALLER)
 AC_SUBST(MOZ_ENABLE_SIGNMAR)
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -57,16 +57,17 @@ DIRS += [
     'prompts',
     'protobuf',
     'reader',
     'remotebrowserutils',
     'remotepagemanager',
     'reflect',
     'reputationservice',
     'resistfingerprinting',
+    'search',
     'securityreporter',
     'sessionstore',
     'shell',
     'startup',
     'statusfilter',
     'telemetry',
     'thumbnails',
     'timermanager',
@@ -90,19 +91,16 @@ if CONFIG['MOZ_BUILD_APP'] != 'mobile/an
         DIRS += ['printing']
 
 if CONFIG['BUILD_CTYPES']:
     DIRS += ['ctypes']
 
 if CONFIG['MOZ_XUL']:
     DIRS += ['autocomplete', 'printingui', 'satchel']
 
-if CONFIG['MOZ_TOOLKIT_SEARCH']:
-    DIRS += ['search']
-
 DIRS += ['captivedetect']
 
 if CONFIG['OS_TARGET'] != 'Android':
     DIRS += ['terminator']
 
 DIRS += ['build']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
--- a/toolkit/components/search/moz.build
+++ b/toolkit/components/search/moz.build
@@ -4,20 +4,19 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPCSHELL_TESTS_MANIFESTS += [
     'tests/xpcshell/searchconfigs/xpcshell.ini',
     'tests/xpcshell/xpcshell.ini',
 ]
 
-if CONFIG['MOZ_TOOLKIT_SEARCH']:
-    XPIDL_SOURCES += [
-        'nsISearchService.idl',
-    ]
+XPIDL_SOURCES += [
+    'nsISearchService.idl',
+]
 
 XPIDL_MODULE = 'toolkit_search'
 
 EXTRA_COMPONENTS += [
 ]
 
 if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
     EXTRA_JS_MODULES += [
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
@@ -270,23 +270,16 @@ this.AppConstants = Object.freeze({
 
   MOZ_ANDROID_HISTORY:
 #ifdef MOZ_ANDROID_HISTORY
   true,
 #else
   false,
 #endif
 
-  MOZ_TOOLKIT_SEARCH:
-#ifdef MOZ_TOOLKIT_SEARCH
-  true,
-#else
-  false,
-#endif
-
   MOZ_GECKO_PROFILER:
 #ifdef MOZ_GECKO_PROFILER
   true,
 #else
   false,
 #endif
 
   MOZ_ANDROID_ACTIVITY_STREAM:
--- a/toolkit/modules/Services.jsm
+++ b/toolkit/modules/Services.jsm
@@ -81,16 +81,17 @@ var initTable = {
   perms: ["@mozilla.org/permissionmanager;1", "nsIPermissionManager"],
   ppmm: ["@mozilla.org/parentprocessmessagemanager;1", "nsISupports"],
   prompt: ["@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService"],
   scriptloader: ["@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader"],
   scriptSecurityManager: ["@mozilla.org/scriptsecuritymanager;1", "nsIScriptSecurityManager"],
   storage: ["@mozilla.org/storage/service;1", "mozIStorageService"],
   domStorageManager: ["@mozilla.org/dom/localStorage-manager;1", "nsIDOMStorageManager"],
   lsm: ["@mozilla.org/dom/localStorage-manager;1", "nsILocalStorageManager"],
+  search: ["@mozilla.org/browser/search-service;1", "nsISearchService"],
   strings: ["@mozilla.org/intl/stringbundle;1", "nsIStringBundleService"],
   telemetry: ["@mozilla.org/base/telemetry;1", "nsITelemetry"],
   textToSubURI: ["@mozilla.org/intl/texttosuburi;1", "nsITextToSubURI"],
   tm: ["@mozilla.org/thread-manager;1", "nsIThreadManager"],
   urlFormatter: ["@mozilla.org/toolkit/URLFormatterService;1", "nsIURLFormatter"],
   vc: ["@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator"],
   wm: ["@mozilla.org/appshell/window-mediator;1", "nsIWindowMediator"],
   ww: ["@mozilla.org/embedcomp/window-watcher;1", "nsIWindowWatcher"],
@@ -104,19 +105,16 @@ var initTable = {
   netUtils: ["@mozilla.org/network/util;1", "nsINetUtil"],
   loadContextInfo: ["@mozilla.org/load-context-info-factory;1", "nsILoadContextInfoFactory"],
   qms: ["@mozilla.org/dom/quota-manager-service;1", "nsIQuotaManagerService"],
 };
 
 if (AppConstants.platform == "android") {
   initTable.androidBridge = ["@mozilla.org/android/bridge;1", "nsIAndroidBridge"];
 }
-if (AppConstants.MOZ_TOOLKIT_SEARCH) {
-  initTable.search = ["@mozilla.org/browser/search-service;1", "nsISearchService"];
-}
 if (AppConstants.MOZ_GECKO_PROFILER) {
   initTable.profiler = ["@mozilla.org/tools/profiler;1", "nsIProfiler"];
 }
 if ("@mozilla.org/browser/enterprisepolicies;1" in Cc) {
   initTable.policies = ["@mozilla.org/browser/enterprisepolicies;1", "nsIEnterprisePolicies"];
 }
 
 XPCOMUtils.defineLazyServiceGetters(Services, initTable);
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -308,18 +308,17 @@ for var in ('ANDROID_PACKAGE_NAME',
             'MOZ_MOZILLA_API_KEY',
             'MOZ_WIDGET_TOOLKIT',
             'DLL_PREFIX',
             'DLL_SUFFIX',
             'DEBUG_JS_MODULES',
             'OMNIJAR_NAME'):
             DEFINES[var] = CONFIG[var]
 
-for var in ('MOZ_TOOLKIT_SEARCH',
-            'MOZ_SYSTEM_NSS',
+for var in ('MOZ_SYSTEM_NSS',
             'MOZ_UNSIGNED_APP_SCOPE',
             'MOZ_UNSIGNED_SYSTEM_SCOPE',
             'MOZ_UPDATER',
             'MOZ_ANDROID_MOZILLA_ONLINE',
             'MOZ_SWITCHBOARD'):
     if CONFIG[var]:
         DEFINES[var] = True