Decentralize extension Mojo interface IPC reviews [chromium/src : main]

0 views
Skip to first unread message

Moe Ahmadi (Gerrit)

unread,
Jul 21, 2026, 6:11:47 PM (4 days ago) Jul 21
to Devlin Cronin, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org, orinj...@chromium.org
Attention needed from Devlin Cronin

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie4bd01f0e66e823aacb1d5b22ae9704da0ac2336
Gerrit-Change-Number: 8130317
Gerrit-PatchSet: 5
Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Jul 2026 22:11:26 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Devlin Cronin (Gerrit)

unread,
Jul 22, 2026, 4:29:15 PM (3 days ago) Jul 22
to Devlin Cronin, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org, orinj...@chromium.org
Attention needed from Moe Ahmadi

Devlin Cronin added 7 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Devlin Cronin . resolved

Thanks, Moe! Generally looks good, but a couple comments here

File chrome/browser/ui/webui/omnibox/aim_eligibility_extension/aim_eligibility_extension_binder_provider.h
Line 24, Patchset 5 (Latest):
Devlin Cronin . unresolved

nit: generally, no \n between override methods (possible exception for the dtor)

File extensions/browser/extension_mojo_binder_registry.h
Line 78, Patchset 5 (Latest): // Additions to these overloads require review from IPC_SECURITY_OWNERS.
Devlin Cronin . unresolved

extend:

```
// These effectively allow exposing additional mojo interfaces to
// different renderers. As such, additions to these overloads require
// review from IPC_SECURITY_OWNERS.
// New BinderProvider files must also have a corresponding OWNERS files
// restricting reviews to IPC_SECURITY_OWNERS.
```
Line 68, Patchset 5 (Latest): using PassKey = base::PassKey<ExtensionMojoBinderRegistry>;
Devlin Cronin . unresolved

unused

Line 9, Patchset 5 (Latest):#include <string>
Devlin Cronin . unresolved

I think we can clean up some of these includes

File extensions/browser/extension_mojo_binder_registry.cc
Line 64, Patchset 5 (Latest): if (!extension || !Manifest::IsComponentLocation(extension->location())) {
Devlin Cronin . unresolved

semi-related to the comment below, can we also add a call to IsMojoJsEnabledForExtension() here? (Unless the intention is to remove that and fold it into this class)

I know right now it's superfluous, but I'd like to make sure they stay in sync

Line 64, Patchset 5 (Latest): if (!extension || !Manifest::IsComponentLocation(extension->location())) {
return;
}
if (render_frame_host &&
util::GetExtensionIdForSiteInstance(
*render_frame_host->GetSiteInstance()) != extension->id()) {
return;
}
auto it = providers_.find(extension->id());
if (it == providers_.end()) {
return;
}
Devlin Cronin . unresolved

these checks are quite similar between this method and PopulateServiceWorkerBinders. Can we extract (the non-RFH-based) checks to a helper method?

Open in Gerrit

Related details

Attention is currently required from:
  • Moe Ahmadi
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie4bd01f0e66e823aacb1d5b22ae9704da0ac2336
    Gerrit-Change-Number: 8130317
    Gerrit-PatchSet: 5
    Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
    Gerrit-Attention: Moe Ahmadi <mah...@chromium.org>
    Gerrit-Comment-Date: Wed, 22 Jul 2026 20:29:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Moe Ahmadi (Gerrit)

    unread,
    Jul 23, 2026, 3:11:05 AM (3 days ago) Jul 23
    to Chromium IPC Reviews, Josiah Kiehl, Devlin Cronin, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org, orinj...@chromium.org
    Attention needed from Chromium IPC Reviews and Devlin Cronin

    Moe Ahmadi voted and added 7 comments

    Votes added by Moe Ahmadi

    Commit-Queue+1

    7 comments

    Patchset-level comments
    Devlin Cronin . resolved

    Thanks, Moe! Generally looks good, but a couple comments here

    Moe Ahmadi

    Thanks for the comments!

    File chrome/browser/ui/webui/omnibox/aim_eligibility_extension/aim_eligibility_extension_binder_provider.h
    Line 24, Patchset 5:
    Devlin Cronin . resolved

    nit: generally, no \n between override methods (possible exception for the dtor)

    Moe Ahmadi

    Done

    File extensions/browser/extension_mojo_binder_registry.h
    Line 78, Patchset 5: // Additions to these overloads require review from IPC_SECURITY_OWNERS.
    Devlin Cronin . resolved

    extend:

    ```
    // These effectively allow exposing additional mojo interfaces to
    // different renderers. As such, additions to these overloads require
    // review from IPC_SECURITY_OWNERS.
    // New BinderProvider files must also have a corresponding OWNERS files
    // restricting reviews to IPC_SECURITY_OWNERS.
    ```
    Moe Ahmadi

    Done. Added your suggested comment.

    Line 68, Patchset 5: using PassKey = base::PassKey<ExtensionMojoBinderRegistry>;
    Devlin Cronin . resolved

    unused

    Moe Ahmadi

    Done

    Line 9, Patchset 5:#include <string>
    Devlin Cronin . resolved

    I think we can clean up some of these includes

    Moe Ahmadi

    Done. Removed unused headers

    File extensions/browser/extension_mojo_binder_registry.cc
    Line 64, Patchset 5: if (!extension || !Manifest::IsComponentLocation(extension->location())) {
    Devlin Cronin . resolved

    semi-related to the comment below, can we also add a call to IsMojoJsEnabledForExtension() here? (Unless the intention is to remove that and fold it into this class)

    I know right now it's superfluous, but I'd like to make sure they stay in sync

    Moe Ahmadi

    Excellent point. Folded `IsMojoJsEnabledForExtension()` into the registry and updated extension_util.cc to delegate to it. lmk what you think!

    Line 64, Patchset 5: if (!extension || !Manifest::IsComponentLocation(extension->location())) {

    return;
    }
    if (render_frame_host &&
    util::GetExtensionIdForSiteInstance(
    *render_frame_host->GetSiteInstance()) != extension->id()) {
    return;
    }
    auto it = providers_.find(extension->id());
    if (it == providers_.end()) {
    return;
    }
    Devlin Cronin . resolved

    these checks are quite similar between this method and PopulateServiceWorkerBinders. Can we extract (the non-RFH-based) checks to a helper method?

    Moe Ahmadi

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Chromium IPC Reviews
    • Devlin Cronin
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ie4bd01f0e66e823aacb1d5b22ae9704da0ac2336
      Gerrit-Change-Number: 8130317
      Gerrit-PatchSet: 6
      Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
      Gerrit-Reviewer: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
      Gerrit-CC: Josiah Kiehl <ki...@google.com>
      Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-Comment-Date: Thu, 23 Jul 2026 07:10:44 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Devlin Cronin <rdevlin...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      gwsq (Gerrit)

      unread,
      Jul 23, 2026, 3:16:06 AM (3 days ago) Jul 23
      to Chromium IPC Reviews, Giovanni Ortuno Urquidi, Josiah Kiehl, Devlin Cronin, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org, orinj...@chromium.org
      Attention needed from Devlin Cronin and Giovanni Ortuno Urquidi

      Message from gwsq

      From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
      IPC: ort...@chromium.org

      📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

      IPC reviewer(s): ort...@chromium.org


      Reviewer source(s):
      ort...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Devlin Cronin
      • Giovanni Ortuno Urquidi
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ie4bd01f0e66e823aacb1d5b22ae9704da0ac2336
      Gerrit-Change-Number: 8130317
      Gerrit-PatchSet: 6
      Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
      Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Reviewer: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: gwsq
      Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Gerrit-Comment-Date: Thu, 23 Jul 2026 07:15:32 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Giovanni Ortuno Urquidi (Gerrit)

      unread,
      Jul 23, 2026, 11:30:25 AM (2 days ago) Jul 23
      to Chromium IPC Reviews, Giovanni Ortuno Urquidi, Josiah Kiehl, Devlin Cronin, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org, orinj...@chromium.org
      Attention needed from Devlin Cronin and Moe Ahmadi

      Giovanni Ortuno Urquidi added 1 comment

      Patchset-level comments
      File-level comment, Patchset 6 (Latest):
      Giovanni Ortuno Urquidi . resolved

      Is there anyone from IPC reviewers that is more familiar with this effort that would be more appropriate to review this CL? Looks like Nasko might have reviewed the precursor CL? If not, any design docs or previous discussions?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Devlin Cronin
      • Moe Ahmadi
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ie4bd01f0e66e823aacb1d5b22ae9704da0ac2336
      Gerrit-Change-Number: 8130317
      Gerrit-PatchSet: 6
      Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
      Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Reviewer: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Josiah Kiehl <ki...@google.com>
      Gerrit-CC: gwsq
      Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Moe Ahmadi <mah...@chromium.org>
      Gerrit-Comment-Date: Thu, 23 Jul 2026 15:30:01 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Moe Ahmadi (Gerrit)

      unread,
      Jul 23, 2026, 5:09:45 PM (2 days ago) Jul 23
      to Chromium IPC Reviews, Giovanni Ortuno Urquidi, Josiah Kiehl, Devlin Cronin, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org, orinj...@chromium.org
      Attention needed from Devlin Cronin and Giovanni Ortuno Urquidi

      Moe Ahmadi added 1 comment

      Patchset-level comments
      Giovanni Ortuno Urquidi . resolved

      Is there anyone from IPC reviewers that is more familiar with this effort that would be more appropriate to review this CL? Looks like Nasko might have reviewed the precursor CL? If not, any design docs or previous discussions?

      Moe Ahmadi

      Hey Giovanni! Nasko has more context on what we are doing here but is OOO. Please see:

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Devlin Cronin
      • Giovanni Ortuno Urquidi
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ie4bd01f0e66e823aacb1d5b22ae9704da0ac2336
      Gerrit-Change-Number: 8130317
      Gerrit-PatchSet: 6
      Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
      Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Reviewer: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Josiah Kiehl <ki...@google.com>
      Gerrit-CC: gwsq
      Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Gerrit-Comment-Date: Thu, 23 Jul 2026 21:09:29 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Giovanni Ortuno Urquidi <ort...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Devlin Cronin (Gerrit)

      unread,
      Jul 23, 2026, 6:59:01 PM (2 days ago) Jul 23
      to Devlin Cronin, Chromium IPC Reviews, Giovanni Ortuno Urquidi, Josiah Kiehl, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org, orinj...@chromium.org
      Attention needed from Giovanni Ortuno Urquidi and Moe Ahmadi

      Devlin Cronin voted and added 1 comment

      Votes added by Devlin Cronin

      Code-Review+1

      1 comment

      Patchset-level comments
      Devlin Cronin . resolved

      LGTM; thanks, Moe!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Giovanni Ortuno Urquidi
      • Moe Ahmadi
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ie4bd01f0e66e823aacb1d5b22ae9704da0ac2336
        Gerrit-Change-Number: 8130317
        Gerrit-PatchSet: 6
        Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
        Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
        Gerrit-Reviewer: Giovanni Ortuno Urquidi <ort...@chromium.org>
        Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Josiah Kiehl <ki...@google.com>
        Gerrit-CC: gwsq
        Gerrit-Attention: Moe Ahmadi <mah...@chromium.org>
        Gerrit-Attention: Giovanni Ortuno Urquidi <ort...@chromium.org>
        Gerrit-Comment-Date: Thu, 23 Jul 2026 22:58:35 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Giovanni Ortuno Urquidi (Gerrit)

        unread,
        Jul 24, 2026, 2:12:04 PM (yesterday) Jul 24
        to Devlin Cronin, Chromium IPC Reviews, Giovanni Ortuno Urquidi, Josiah Kiehl, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org, orinj...@chromium.org
        Attention needed from Moe Ahmadi

        Giovanni Ortuno Urquidi added 8 comments

        File chrome/browser/ui/webui/omnibox/aim_eligibility_extension/OWNERS
        Line 1, Patchset 6 (Latest):per-file *binder_provider*.*=set noparent
        per-file *binder_provider*.*=file://ipc/SECURITY_OWNERS
        Giovanni Ortuno Urquidi . unresolved

        I think it's too easy to forget to add this. Can we add `_extension_binder_provider.h/.cc` to https://source.chromium.org/chromium/chromium/src/+/main:PRESUBMIT.py;l=4720;drc=01c9ad7fe24638f468ec728736fd4cd74abcd9b4 ?

        File chrome/browser/ui/webui/omnibox/aim_eligibility_extension/aim_eligibility_extension_binder_provider.cc
        Line 42, Patchset 6 (Latest): base::BindRepeating(
        Giovanni Ortuno Urquidi . unresolved

        optional: Can you add a static method to AimEligibilityExtensionBridge to avoid the big inlined lambda?

        Line 46, Patchset 6 (Latest): auto* bridge = AimEligibilityExtensionBridge::Get(
        Giovanni Ortuno Urquidi . unresolved

        When would there be an interface request for this interface where `bridge` is nullptr? I feel like we should crash the renderer in that case, but I could be missing a case?

        Actually, can we avoid registering the provider if there's no AimEligibilityExtensionBridge? Then we can CHECK here.

        File extensions/browser/extension_mojo_binder_registry.h
        Line 73, Patchset 6 (Latest): void RegisterProvider(
        base::PassKey<AimEligibilityExtensionBinderProvider> passkey,
        std::unique_ptr<ExtensionMojoBinderProvider> provider);
        void RegisterProvider(base::PassKey<ExtensionMojoBinderRegistryTest> passkey,
        std::unique_ptr<ExtensionMojoBinderProvider> provider);
        Giovanni Ortuno Urquidi . unresolved
        I *think* you could do the following here:
        ```
        template <typename T>
        void RegisterProvider(base::PassKey<T> passkey,
        std::unique_ptr<ExtensionMojoBinderProvider> provider)
        ```
        And then in the .cc:
        ```
        template <>
        void ExtensionMojoBinderRegistry::RegisterProvider(
        base::PassKey<AimEligibilityExtensionBinderProvider>,
        std::unique_ptr<ExtensionMojoBinderProvider> provider) {
        ...
        }
        ```

        That way developers only need to modify one file. If this works, maybe worth moving the comment to the .cc.

        Line 71, Patchset 6 (Latest): // New BinderProvider files must also have a corresponding OWNERS files

        // restricting reviews to IPC_SECURITY_OWNERS.
        Giovanni Ortuno Urquidi . unresolved

        If we add _extension_binder_provider to the presubmit, then that would enforce this. Maybe we can change this to mention that the provider should end with _extension_binder_provider.h/cc?

        File extensions/browser/extension_mojo_binder_registry.cc
        Line 59, Patchset 6 (Latest): DCHECK(binder_map);
        Giovanni Ortuno Urquidi . unresolved

        nit: Prefer CHECKs over DCHECKs.

        Line 78, Patchset 6 (Latest): DCHECK(binder_map);
        Giovanni Ortuno Urquidi . unresolved
        File extensions/browser/extension_mojo_binder_registry_unittest.cc
        Line 204, Patchset 6 (Latest): EXPECT_FALSE(registry()->IsMojoJsEnabled(component_extension.get()));
        Giovanni Ortuno Urquidi . unresolved

        nit: `IsMojoEnabled(nullptr)`

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Moe Ahmadi
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ie4bd01f0e66e823aacb1d5b22ae9704da0ac2336
          Gerrit-Change-Number: 8130317
          Gerrit-PatchSet: 6
          Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
          Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
          Gerrit-Reviewer: Giovanni Ortuno Urquidi <ort...@chromium.org>
          Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
          Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
          Gerrit-CC: Josiah Kiehl <ki...@google.com>
          Gerrit-CC: gwsq
          Gerrit-Attention: Moe Ahmadi <mah...@chromium.org>
          Gerrit-Comment-Date: Fri, 24 Jul 2026 18:11:57 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Moe Ahmadi (Gerrit)

          unread,
          6:56 AM (9 hours ago) 6:56 AM
          to Devlin Cronin, Chromium IPC Reviews, Giovanni Ortuno Urquidi, Josiah Kiehl, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org, orinj...@chromium.org
          Attention needed from Devlin Cronin and Giovanni Ortuno Urquidi

          Moe Ahmadi added 8 comments

          File chrome/browser/ui/webui/omnibox/aim_eligibility_extension/OWNERS
          Line 1, Patchset 6:per-file *binder_provider*.*=set noparent
          per-file *binder_provider*.*=file://ipc/SECURITY_OWNERS
          Giovanni Ortuno Urquidi . resolved

          I think it's too easy to forget to add this. Can we add `_extension_binder_provider.h/.cc` to https://source.chromium.org/chromium/chromium/src/+/main:PRESUBMIT.py;l=4720;drc=01c9ad7fe24638f468ec728736fd4cd74abcd9b4 ?

          Moe Ahmadi

          Good idea! Done.

          File chrome/browser/ui/webui/omnibox/aim_eligibility_extension/aim_eligibility_extension_binder_provider.cc
          Line 42, Patchset 6: base::BindRepeating(
          Giovanni Ortuno Urquidi . resolved

          optional: Can you add a static method to AimEligibilityExtensionBridge to avoid the big inlined lambda?

          Moe Ahmadi

          Added helpers to the anonymous namespace inside aim_eligibility_extension_binder_provider.cc instead of static methods on `AimEligibilityExtensionBridge` given that's the file reviewed by IPC_SECURITY_OWNERS

          Line 46, Patchset 6: auto* bridge = AimEligibilityExtensionBridge::Get(
          Giovanni Ortuno Urquidi . resolved

          When would there be an interface request for this interface where `bridge` is nullptr? I feel like we should crash the renderer in that case, but I could be missing a case?

          Actually, can we avoid registering the provider if there's no AimEligibilityExtensionBridge? Then we can CHECK here.

          Moe Ahmadi

          We can't avoid conditional registration or add a CHECK here.

          `ExtensionMojoBinderRegistry` is a singleton, whereas `AimEligibilityExtensionBridge` is a ProfileKeyedService and can be nullptr. For example, if the connection comes from an OTR profile. `ExtensionMojoBinderProvider` instances are also global singletons and owned by the registry. Both the registry and the provider need to remain global singletons and can't be per-profile instances because `PopulateChromeFrameBindersForExtension()` and `PopulateChromeServiceWorkerBindersForExtension()` are called globally by ChromeContentBrowserClient whenever any extension document or service worker connects across the entire browser process.

          Dropping the receiver seems like the right way to handle those cases to me. Please reopen if you disagree.

          File extensions/browser/extension_mojo_binder_registry.h
          Line 73, Patchset 6: void RegisterProvider(

          base::PassKey<AimEligibilityExtensionBinderProvider> passkey,
          std::unique_ptr<ExtensionMojoBinderProvider> provider);
          void RegisterProvider(base::PassKey<ExtensionMojoBinderRegistryTest> passkey,
          std::unique_ptr<ExtensionMojoBinderProvider> provider);
          Giovanni Ortuno Urquidi . resolved
          I *think* you could do the following here:
          ```
          template <typename T>
          void RegisterProvider(base::PassKey<T> passkey,
          std::unique_ptr<ExtensionMojoBinderProvider> provider)
          ```
          And then in the .cc:
          ```
          template <>
          void ExtensionMojoBinderRegistry::RegisterProvider(
          base::PassKey<AimEligibilityExtensionBinderProvider>,
          std::unique_ptr<ExtensionMojoBinderProvider> provider) {
          ...
          }
          ```

          That way developers only need to modify one file. If this works, maybe worth moving the comment to the .cc.

          Moe Ahmadi

          It could work and would reduce the edits to one file. However, I lean towards keeping explicit overloads because (1) it matches the pattern in `services/metrics/public/cpp/ukm_recorder.h` which Devlin pointed to as the precedent for his suggestion to use passkeys; and (2) it's easier to see the allowlist of approved providers at one glance looking at either file.

          touching both files when adding a new provider seems like a minor trade-off for better visibility. We can revisit that if this pattern proliferates and becomes cumbersome. Please reopen if you still prefer moving it to the .cc!

          Line 71, Patchset 6: // New BinderProvider files must also have a corresponding OWNERS files

          // restricting reviews to IPC_SECURITY_OWNERS.
          Giovanni Ortuno Urquidi . resolved

          If we add _extension_binder_provider to the presubmit, then that would enforce this. Maybe we can change this to mention that the provider should end with _extension_binder_provider.h/cc?

          Moe Ahmadi

          good idea! adjusted the comment here to reflect the naming convention.

          File extensions/browser/extension_mojo_binder_registry.cc
          Line 59, Patchset 6: DCHECK(binder_map);
          Giovanni Ortuno Urquidi . resolved

          nit: Prefer CHECKs over DCHECKs.

          Moe Ahmadi

          Done

          Line 78, Patchset 6: DCHECK(binder_map);
          Giovanni Ortuno Urquidi . resolved
          Moe Ahmadi

          Done

          File extensions/browser/extension_mojo_binder_registry_unittest.cc
          Line 204, Patchset 6: EXPECT_FALSE(registry()->IsMojoJsEnabled(component_extension.get()));
          Giovanni Ortuno Urquidi . resolved

          nit: `IsMojoEnabled(nullptr)`

          Moe Ahmadi

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Devlin Cronin
          • Giovanni Ortuno Urquidi
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ie4bd01f0e66e823aacb1d5b22ae9704da0ac2336
            Gerrit-Change-Number: 8130317
            Gerrit-PatchSet: 7
            Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
            Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
            Gerrit-Reviewer: Giovanni Ortuno Urquidi <ort...@chromium.org>
            Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-CC: Josiah Kiehl <ki...@google.com>
            Gerrit-CC: gwsq
            Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
            Gerrit-Attention: Giovanni Ortuno Urquidi <ort...@chromium.org>
            Gerrit-Comment-Date: Sat, 25 Jul 2026 10:56:07 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages