[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-152.0a1-16.0-2] 2 commits: fixup! TB 42247: Android helpers for the TorProvider



Title: GitLab

Pier Angelo Vendrame pushed to branch tor-browser-152.0a1-16.0-2 at The Tor Project / Applications / Tor Browser

Commits:

  • e62750ca
    by Henry Wilkes at 2026-06-25T11:46:27+00:00
    fixup! TB 42247: Android helpers for the TorProvider
    
    TB 45052: Initialise Tor modules on android in the same order as
    desktop.
    
  • be028307
    by Henry Wilkes at 2026-06-25T11:46:27+00:00
    fixup! TB 3455: Add DomainIsolator, for isolating circuit by domain.
    
    TB 45052: Move the initialisation of TorDomainIsolator into
    TorAndroidIntegration.
    

2 changed files:

Changes:

  • mobile/shared/components/geckoview/GeckoViewStartup.sys.mjs
    ... ... @@ -18,8 +18,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
    18 18
       RFPHelper: "resource://gre/modules/RFPHelper.sys.mjs",
    
    19 19
       TorAndroidIntegration:
    
    20 20
         "moz-src:///toolkit/modules/TorAndroidIntegration.sys.mjs",
    
    21
    -  TorDomainIsolator:
    
    22
    -    "moz-src:///toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs",
    
    23 21
     });
    
    24 22
     
    
    25 23
     const { debug, warn } = GeckoViewUtils.initLogging("Startup");
    
    ... ... @@ -330,8 +328,6 @@ export class GeckoViewStartup {
    330 328
             this.#migratePreferences();
    
    331 329
     
    
    332 330
             lazy.TorAndroidIntegration.init();
    
    333
    -        lazy.TorDomainIsolator.init();
    
    334
    -
    
    335 331
             Services.obs.addObserver(this, "browser-idle-startup-tasks-finished");
    
    336 332
             Services.obs.addObserver(this, "handlersvc-store-initialized");
    
    337 333
     
    

  • toolkit/modules/TorAndroidIntegration.sys.mjs
    ... ... @@ -7,6 +7,8 @@ ChromeUtils.defineESModuleGetters(lazy, {
    7 7
       EventDispatcher: "resource://gre/modules/Messaging.sys.mjs",
    
    8 8
       TorConnect: "moz-src:///toolkit/modules/TorConnect.sys.mjs",
    
    9 9
       TorConnectTopics: "moz-src:///toolkit/modules/TorConnect.sys.mjs",
    
    10
    +  TorDomainIsolator:
    
    11
    +    "moz-src:///toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs",
    
    10 12
       TorSettingsTopics: "moz-src:///toolkit/modules/TorSettings.sys.mjs",
    
    11 13
       TorProviderBuilder:
    
    12 14
         "moz-src:///toolkit/components/tor-launcher/TorProviderBuilder.sys.mjs",
    
    ... ... @@ -62,7 +64,7 @@ class TorAndroidIntegrationImpl {
    62 64
       /**
    
    63 65
        * Register our listeners.
    
    64 66
        * We want this function to block GeckoView initialization, so it should not be
    
    65
    -   * async. Any async task should be moved to #deferredInit, instead.
    
    67
    +   * async.
    
    66 68
        */
    
    67 69
       init() {
    
    68 70
         if (this.#initialized) {
    
    ... ... @@ -86,26 +88,21 @@ class TorAndroidIntegrationImpl {
    86 88
           Services.obs.addObserver(this, lazy.TorSettingsTopics[topic]);
    
    87 89
         }
    
    88 90
     
    
    91
    +    // Match the initialisation order from desktop's TorStartupService.
    
    92
    +    lazy.TorSettings.init().catch(error => {
    
    93
    +      logger.error("Cannot initailize TorSettings", error);
    
    94
    +    });
    
    95
    +
    
    89 96
         lazy.TorProviderBuilder.init();
    
    97
    +
    
    98
    +    lazy.TorConnect.init();
    
    99
    +
    
    100
    +    lazy.TorDomainIsolator.init();
    
    101
    +
    
    90 102
         // On Android immediately call firstWindowLoaded. This should be safe to
    
    91 103
         // call since it will await the initialisation of the TorProvider set up
    
    92 104
         // by TorProviderBuilder.init.
    
    93 105
         lazy.TorProviderBuilder.firstWindowLoaded();
    
    94
    -
    
    95
    -    this.#deferredInit();
    
    96
    -  }
    
    97
    -
    
    98
    -  /**
    
    99
    -   * Perform our init tasks that should not block the initialization of
    
    100
    -   * GeckoView. This function will not be awaited, so errors can only be logged.
    
    101
    -   */
    
    102
    -  async #deferredInit() {
    
    103
    -    try {
    
    104
    -      await lazy.TorSettings.init();
    
    105
    -      await lazy.TorConnect.init();
    
    106
    -    } catch (e) {
    
    107
    -      logger.error("Cannot initialize TorSettings or TorConnect", e);
    
    108
    -    }
    
    109 106
       }
    
    110 107
     
    
    111 108
       observe(subj, topic) {
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx