Verified Commit 64f873f6 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by boklm
Browse files

fixup! TB 42247: Android helpers for the TorProvider

TB 44635: Gather conflux information on circuits.

Update the getCircuit name to getCircuits.
parent 5338ad77
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2768,8 +2768,8 @@ public class GeckoSession {
   * @return The circuit information as a {@link GeckoResult} object.
   */
  @AnyThread
  public @NonNull GeckoResult<GeckoBundle> getTorCircuit() {
    return mEventDispatcher.queryBundle("GeckoView:GetTorCircuit");
  public @NonNull GeckoResult<GeckoBundle> getTorCircuits() {
    return mEventDispatcher.queryBundle("GeckoView:GetTorCircuits");
  }

  /**
+5 −5
Original line number Diff line number Diff line
@@ -301,8 +301,8 @@ export class GeckoViewContent extends GeckoViewModule {
      case "GeckoView:ProcessBackPressed":
        this._processBackPressed(aCallback);
        break;
      case "GeckoView:GetTorCircuit":
        this._getTorCircuit(aCallback);
      case "GeckoView:GetTorCircuits":
        this._getTorCircuits(aCallback);
        break;
      case "GeckoView:NewTorCircuit":
        this._newTorCircuit(aCallback);
@@ -476,15 +476,15 @@ export class GeckoViewContent extends GeckoViewModule {
    }
  }

  _getTorCircuit(aCallback) {
  _getTorCircuits(aCallback) {
    if (this.browser && aCallback) {
      const domain = lazy.TorDomainIsolator.getDomainForBrowser(this.browser);
      const nodes = lazy.TorDomainIsolator.getCircuit(
      const circuits = lazy.TorDomainIsolator.getCircuits(
        this.browser,
        domain,
        this.browser.contentPrincipal.originAttributes.userContextId
      );
      aCallback?.onSuccess({ domain, nodes });
      aCallback?.onSuccess({ domain, circuits });
    } else {
      aCallback?.onSuccess(null);
    }