Commit 6e2588d7 authored by Alex Catarineu's avatar Alex Catarineu Committed by Pier Angelo Vendrame
Browse files

BB 31740: Remove some unnecessary RemoteSettings instances

More concretely, SearchService.jsm 'hijack-blocklists' and
url-classifier-skip-urls.

Avoid creating instance for 'anti-tracking-url-decoration'.

If prefs are disabling their usage, avoid creating instances for
'cert-revocations' and 'intermediates'.

Do not ship JSON dumps for collections we do not expect to need. For
the ones in the 'main' bucket, this prevents them from being synced
unnecessarily (the code in remote-settings does so for collections
in the main bucket for which a dump or local data exists). For the
collections in the other buckets, we just save some size by not
shipping their dumps.

We also clear the collections database on the v2 -> v3 migration.
parent 43a107d2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -912,6 +912,8 @@ class DomainToCategoriesMap {
   * reuse the store if the version in each record matches the store.
   */
  async #setupClientAndStore() {
    return;
    // eslint-disable-next-line no-unreachable
    if (this.#client && !this.empty) {
      return;
    }
+3 −2
Original line number Diff line number Diff line
@@ -264,7 +264,8 @@ class TelemetryHandler {
   * can be tracked.
   */
  async init() {
    if (this._initialized) {
    // eslint-disable-next-line no-constant-condition
    if (this._initialized || true) {
      return;
    }

@@ -975,7 +976,7 @@ class TelemetryHandler {
   *   Returns a provider or undefined if no provider was found for the url.
   */
  _getProviderInfoForURL(url) {
    return this._searchProviderInfo.find(info =>
    return this._searchProviderInfo?.find(info =>
      info.searchPageRegexp.test(url)
    );
  }
+2 −0
Original line number Diff line number Diff line
@@ -212,8 +212,10 @@ static const RedirEntry kRedirMap[] = {
         nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
         nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
         nsIAboutModule::HIDE_FROM_ABOUTABOUT},
#ifndef BASE_BROWSER_VERSION
    {"url-classifier", "chrome://global/content/aboutUrlClassifier.xhtml",
     nsIAboutModule::ALLOW_SCRIPT},
#endif
#ifdef MOZ_WEBRTC
    {"webrtc", "chrome://global/content/aboutwebrtc/aboutWebrtc.html",
     nsIAboutModule::ALLOW_SCRIPT},
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ void UrlClassifierFeatureBase::InitializePreferences() {

  nsCOMPtr<nsIUrlClassifierExceptionListService> exceptionListService =
      do_GetService("@mozilla.org/url-classifier/exception-list-service;1");
  if (NS_WARN_IF(!exceptionListService)) {
  if (!exceptionListService) {
    return;
  }

+0 −20
Original line number Diff line number Diff line
@@ -13,24 +13,4 @@ Classes = [
        'constructor': 'mozilla::net::ChannelClassifierService::GetSingleton',
        'headers': ['mozilla/net/ChannelClassifierService.h'],
    },
    {
        'cid': '{b9f4fd03-9d87-4bfd-9958-85a821750ddc}',
        'contract_ids': ['@mozilla.org/url-classifier/exception-list-service;1'],
        'esModule': 'resource://gre/modules/UrlClassifierExceptionListService.sys.mjs',
        'constructor': 'UrlClassifierExceptionListService',
    },
    {
        'cid': '{8753A413-3ED6-4A61-A1DC-B31A7E69B796}',
        'interfaces': ['nsIUrlClassifierExceptionListEntry'],
        'headers': ['mozilla/net/UrlClassifierExceptionListEntry.h'],
        'type': 'mozilla::net::UrlClassifierExceptionListEntry',
        'contract_ids': ['@mozilla.org/url-classifier/exception-list-entry;1'],
    },
    {
        'cid': '{807535BF-018E-4300-B8D3-4A6405FB9F65}',
        'interfaces': ['nsIUrlClassifierExceptionList'],
        'headers': ['mozilla/net/UrlClassifierExceptionList.h'],
        'type': 'mozilla::net::UrlClassifierExceptionList',
        'contract_ids': ['@mozilla.org/url-classifier/exception-list;1'],
    },
]
Loading