[Extensions] Make cannot_dispatch_callback invocation more robust [chromium/src : main]

0 views
Skip to first unread message

Tal Keren (Gerrit)

unread,
Mar 30, 2026, 9:57:35 AM (3 days ago) Mar 30
to Andrea Orru, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Andrea Orru and Devlin Cronin

Tal Keren added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Andrea Orru
  • 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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
Gerrit-Change-Number: 7707363
Gerrit-PatchSet: 2
Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Andrea Orru <andre...@chromium.org>
Gerrit-Comment-Date: Mon, 30 Mar 2026 13:57:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrea Orru (Gerrit)

unread,
Mar 30, 2026, 4:31:39 PM (3 days ago) Mar 30
to Tal Keren, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Devlin Cronin and Tal Keren

Andrea Orru added 3 comments

Patchset-level comments
Tal Keren . resolved

Hey, the context for this fix:
https://issues.chromium.org/issues/467448815#comment34

Andrea Orru

Thank you!

Commit Message
Line 19, Patchset 2 (Latest):
Andrea Orru . unresolved

Reference the bug.

`Bug: 467448815, 484218883`

File extensions/browser/event_router_unittest.cc
Line 1040, Patchset 2 (Latest): event_router()->DispatchEventToExtension(ext1, std::move(event));
Andrea Orru . unresolved

Uhm... If this case is not properly handling, do you know why [this test](https://crsrc.org/c/chrome/browser/extensions/api/web_request/web_request_apitest.cc;drc=2619b946b249d21cc1f2f1e08edcec3ecb8fdc4e;l=6927) is not failing?

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
  • Tal Keren
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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
    Gerrit-Change-Number: 7707363
    Gerrit-PatchSet: 2
    Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Comment-Date: Mon, 30 Mar 2026 20:31:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Tal Keren <tke...@paloaltonetworks.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrea Orru (Gerrit)

    unread,
    Mar 30, 2026, 4:40:14 PM (3 days ago) Mar 30
    to Tal Keren, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Devlin Cronin and Tal Keren

    Andrea Orru added 1 comment

    File extensions/browser/event_router_unittest.cc
    Line 1040, Patchset 2 (Latest): event_router()->DispatchEventToExtension(ext1, std::move(event));
    Andrea Orru . unresolved

    Uhm... If this case is not properly handling, do you know why [this test](https://crsrc.org/c/chrome/browser/extensions/api/web_request/web_request_apitest.cc;drc=2619b946b249d21cc1f2f1e08edcec3ecb8fdc4e;l=6927) is not failing?

    Andrea Orru

    Oh I see. In the case you're covering, there's no lazy listener either...?

    Gerrit-Comment-Date: Mon, 30 Mar 2026 20:39:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Andrea Orru <andre...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tal Keren (Gerrit)

    unread,
    Mar 30, 2026, 5:21:40 PM (3 days ago) Mar 30
    to Andrea Orru, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Andrea Orru and Devlin Cronin

    Tal Keren added 1 comment

    File extensions/browser/event_router_unittest.cc
    Line 1040, Patchset 2 (Latest): event_router()->DispatchEventToExtension(ext1, std::move(event));
    Andrea Orru . unresolved

    Uhm... If this case is not properly handling, do you know why [this test](https://crsrc.org/c/chrome/browser/extensions/api/web_request/web_request_apitest.cc;drc=2619b946b249d21cc1f2f1e08edcec3ecb8fdc4e;l=6927) is not failing?

    Andrea Orru

    Oh I see. In the case you're covering, there's no lazy listener either...?

    Tal Keren

    Yes, the case that I am covering is when webRequest doesn't have a listener or a lazy listener, but the caller of the API think that there might be (in this case WebRequestEventRouter). This inconsistency might be problematic on its own but is resolved by enabling WebRequestPersistFilteredEventsViaEventRouter. It is a bit hard to fully simulate with webRequest because it is a race (needs to unregister an event listener while profile is marked as shutting down). This issue happened to us frequently because how our service worker is constructed, so this was my solution for it, which I think that should be the expected behavior anyway for callers that call any api that uses DispatchEventImpl with cannot_dispatch_callback even if the specific issue with WebRequestEventRouter won't exists soon.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrea Orru
    • Devlin Cronin
    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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
    Gerrit-Change-Number: 7707363
    Gerrit-PatchSet: 2
    Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Andrea Orru <andre...@chromium.org>
    Gerrit-Comment-Date: Mon, 30 Mar 2026 21:21:34 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tal Keren (Gerrit)

    unread,
    Mar 30, 2026, 5:32:04 PM (3 days ago) Mar 30
    to Andrea Orru, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Andrea Orru and Devlin Cronin

    Tal Keren added 1 comment

    File extensions/browser/event_router_unittest.cc
    Line 1040, Patchset 2 (Latest): event_router()->DispatchEventToExtension(ext1, std::move(event));
    Andrea Orru . unresolved

    Uhm... If this case is not properly handling, do you know why [this test](https://crsrc.org/c/chrome/browser/extensions/api/web_request/web_request_apitest.cc;drc=2619b946b249d21cc1f2f1e08edcec3ecb8fdc4e;l=6927) is not failing?

    Andrea Orru

    Oh I see. In the case you're covering, there's no lazy listener either...?

    Tal Keren

    Yes, the case that I am covering is when webRequest doesn't have a listener or a lazy listener, but the caller of the API think that there might be (in this case WebRequestEventRouter). This inconsistency might be problematic on its own but is resolved by enabling WebRequestPersistFilteredEventsViaEventRouter. It is a bit hard to fully simulate with webRequest because it is a race (needs to unregister an event listener while profile is marked as shutting down). This issue happened to us frequently because how our service worker is constructed, so this was my solution for it, which I think that should be the expected behavior anyway for callers that call any api that uses DispatchEventImpl with cannot_dispatch_callback even if the specific issue with WebRequestEventRouter won't exists soon.

    Tal Keren

    It will behave more like EventRouter::DispatchPendingEvent and will call cannot_dispatch_callback for any failure reason.

    Gerrit-Comment-Date: Mon, 30 Mar 2026 21:31:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Tal Keren <tke...@paloaltonetworks.com>
    Comment-In-Reply-To: Andrea Orru <andre...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tal Keren (Gerrit)

    unread,
    Mar 30, 2026, 5:41:52 PM (3 days ago) Mar 30
    to Andrea Orru, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Andrea Orru and Devlin Cronin

    Tal Keren added 1 comment

    Commit Message
    Line 19, Patchset 2:
    Andrea Orru . resolved

    Reference the bug.

    `Bug: 467448815, 484218883`

    Tal Keren

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrea Orru
    • Devlin Cronin
    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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
    Gerrit-Change-Number: 7707363
    Gerrit-PatchSet: 3
    Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Andrea Orru <andre...@chromium.org>
    Gerrit-Comment-Date: Mon, 30 Mar 2026 21:41:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Andrea Orru <andre...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrea Orru (Gerrit)

    unread,
    Mar 31, 2026, 1:20:13 PM (2 days ago) Mar 31
    to Tal Keren, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Devlin Cronin and Tal Keren

    Andrea Orru voted and added 6 comments

    Votes added by Andrea Orru

    Code-Review+1

    6 comments

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    Andrea Orru . resolved

    Thank you Tal! This is a really good patch. Just a few comments.

    Commit Message
    Line 12, Patchset 3 (Latest):cases where a dispatch is undeliverable for other reasons, such as when
    Andrea Orru . unresolved

    Can you expand on what the reasons are? As far as I can tell:

    • Events with zero or blocked listeners are silently swallowed.
    • During broadcasts, failures in one extension can incorrectly abort successful WebRequest blocking requests from another.
    Line 14, Patchset 3 (Latest):WebRequestEventRouter was one manifestation of this problem.
    Andrea Orru . unresolved

    Can you explain the nature of the inconsistency?

    Line 18, Patchset 3 (Latest):undeliverable-dispatch fallback more robust
    Andrea Orru . unresolved

    Period at the end of the sentence.

    File extensions/browser/event_router_unittest.cc
    Line 1040, Patchset 2: event_router()->DispatchEventToExtension(ext1, std::move(event));
    Andrea Orru . resolved

    Uhm... If this case is not properly handling, do you know why [this test](https://crsrc.org/c/chrome/browser/extensions/api/web_request/web_request_apitest.cc;drc=2619b946b249d21cc1f2f1e08edcec3ecb8fdc4e;l=6927) is not failing?

    Andrea Orru

    Oh I see. In the case you're covering, there's no lazy listener either...?

    Tal Keren

    Yes, the case that I am covering is when webRequest doesn't have a listener or a lazy listener, but the caller of the API think that there might be (in this case WebRequestEventRouter). This inconsistency might be problematic on its own but is resolved by enabling WebRequestPersistFilteredEventsViaEventRouter. It is a bit hard to fully simulate with webRequest because it is a race (needs to unregister an event listener while profile is marked as shutting down). This issue happened to us frequently because how our service worker is constructed, so this was my solution for it, which I think that should be the expected behavior anyway for callers that call any api that uses DispatchEventImpl with cannot_dispatch_callback even if the specific issue with WebRequestEventRouter won't exists soon.

    Tal Keren

    It will behave more like EventRouter::DispatchPendingEvent and will call cannot_dispatch_callback for any failure reason.

    Andrea Orru

    Acknowledged

    File extensions/browser/events/event_dispatch_helper.cc
    Line 330, Patchset 3 (Latest): return false;
    Andrea Orru . unresolved

    nit: newline above this return

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Devlin Cronin
    • Tal Keren
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
    Gerrit-Change-Number: 7707363
    Gerrit-PatchSet: 3
    Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 17:20:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrea Orru (Gerrit)

    unread,
    Mar 31, 2026, 1:22:02 PM (2 days ago) Mar 31
    to Tal Keren, Emilia Paz, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Devlin Cronin, Emilia Paz and Tal Keren

    Andrea Orru added 1 comment

    Patchset-level comments
    Andrea Orru . resolved

    Moving Devlin to cc since he's traveling, adding Emilia.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Devlin Cronin
    • Emilia Paz
    • Tal Keren
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
    Gerrit-Change-Number: 7707363
    Gerrit-PatchSet: 3
    Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
    Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
    Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Attention: Emilia Paz <emil...@chromium.org>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 17:21:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tal Keren (Gerrit)

    unread,
    Mar 31, 2026, 6:26:20 PM (2 days ago) Mar 31
    to Emilia Paz, Devlin Cronin, Andrea Orru, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Andrea Orru, Devlin Cronin and Emilia Paz

    Tal Keren added 4 comments

    Commit Message
    Line 12, Patchset 3:cases where a dispatch is undeliverable for other reasons, such as when
    Andrea Orru . unresolved

    Can you expand on what the reasons are? As far as I can tell:

    • Events with zero or blocked listeners are silently swallowed.
    • During broadcasts, failures in one extension can incorrectly abort successful WebRequest blocking requests from another.
    Tal Keren

    I have updated the message.
    But about the second point - it is a good point, didn't think about it, but it is actually divergent from EventRouter::DispatchPendingEvent. With broadcast and cannot_dispatch_callback - if any context is inactive at time of dispatch, EventRouter::DispatchPendingEvent is not aware about other potential listeners.
    so I don't think that this callback can work properly with broadcast anyway.

    it also made me look up how this callback is documenteed:

      // Called if the event cannot be dispatched to a lazy listener. This happens
    // if e.g. the extension registers an event listener from a lazy context
    // asynchronously, which results in the active listener not being registered
    // at the time the lazy context is spun back up.
    CannotDispatchCallback cannot_dispatch_callback;

    I wonder if it should be updated in any way.
    Line 14, Patchset 3:WebRequestEventRouter was one manifestation of this problem.
    Andrea Orru . resolved

    Can you explain the nature of the inconsistency?

    Tal Keren

    Done

    Line 18, Patchset 3:undeliverable-dispatch fallback more robust
    Andrea Orru . resolved

    Period at the end of the sentence.

    Tal Keren

    Done

    File extensions/browser/events/event_dispatch_helper.cc
    Line 330, Patchset 3: return false;
    Andrea Orru . resolved

    nit: newline above this return

    Tal Keren

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrea Orru
    • Devlin Cronin
    • Emilia Paz
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
    Gerrit-Change-Number: 7707363
    Gerrit-PatchSet: 5
    Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
    Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
    Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Andrea Orru <andre...@chromium.org>
    Gerrit-Attention: Emilia Paz <emil...@chromium.org>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 22:26:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Andrea Orru <andre...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrea Orru (Gerrit)

    unread,
    Mar 31, 2026, 6:50:12 PM (2 days ago) Mar 31
    to Tal Keren, Emilia Paz, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Devlin Cronin, Emilia Paz and Tal Keren

    Andrea Orru voted and added 2 comments

    Votes added by Andrea Orru

    Code-Review+1

    2 comments

    Commit Message
    Line 12, Patchset 3:cases where a dispatch is undeliverable for other reasons, such as when
    Andrea Orru . unresolved

    Can you expand on what the reasons are? As far as I can tell:

    • Events with zero or blocked listeners are silently swallowed.
    • During broadcasts, failures in one extension can incorrectly abort successful WebRequest blocking requests from another.
    Tal Keren

    I have updated the message.
    But about the second point - it is a good point, didn't think about it, but it is actually divergent from EventRouter::DispatchPendingEvent. With broadcast and cannot_dispatch_callback - if any context is inactive at time of dispatch, EventRouter::DispatchPendingEvent is not aware about other potential listeners.
    so I don't think that this callback can work properly with broadcast anyway.

    it also made me look up how this callback is documenteed:

      // Called if the event cannot be dispatched to a lazy listener. This happens
    // if e.g. the extension registers an event listener from a lazy context
    // asynchronously, which results in the active listener not being registered
    // at the time the lazy context is spun back up.
    CannotDispatchCallback cannot_dispatch_callback;

    I wonder if it should be updated in any way.
    Andrea Orru

    I was talking about the scenario you are testing in the second unit test.

    File extensions/browser/events/event_dispatch_helper.cc
    Line 330, Patchset 3: return false;
    Andrea Orru . resolved

    nit: newline above this return

    Andrea Orru

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Devlin Cronin
    • Emilia Paz
    • Tal Keren
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
    Gerrit-Change-Number: 7707363
    Gerrit-PatchSet: 5
    Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
    Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
    Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Attention: Emilia Paz <emil...@chromium.org>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 22:50:01 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tal Keren (Gerrit)

    unread,
    Mar 31, 2026, 7:00:28 PM (2 days ago) Mar 31
    to Andrea Orru, Emilia Paz, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Andrea Orru, Devlin Cronin and Emilia Paz

    Tal Keren added 1 comment

    Commit Message
    Line 12, Patchset 3:cases where a dispatch is undeliverable for other reasons, such as when
    Andrea Orru . unresolved

    Can you expand on what the reasons are? As far as I can tell:

    • Events with zero or blocked listeners are silently swallowed.
    • During broadcasts, failures in one extension can incorrectly abort successful WebRequest blocking requests from another.
    Tal Keren

    I have updated the message.
    But about the second point - it is a good point, didn't think about it, but it is actually divergent from EventRouter::DispatchPendingEvent. With broadcast and cannot_dispatch_callback - if any context is inactive at time of dispatch, EventRouter::DispatchPendingEvent is not aware about other potential listeners.
    so I don't think that this callback can work properly with broadcast anyway.

    it also made me look up how this callback is documenteed:

      // Called if the event cannot be dispatched to a lazy listener. This happens
    // if e.g. the extension registers an event listener from a lazy context
    // asynchronously, which results in the active listener not being registered
    // at the time the lazy context is spun back up.
    CannotDispatchCallback cannot_dispatch_callback;

    I wonder if it should be updated in any way.
    Andrea Orru

    I was talking about the scenario you are testing in the second unit test.

    Tal Keren

    Oh, I thought about BroadastEvent for a moment, but the helper doesn't even have that functionality. so nvm.
    About the second scenario, I think that "when all candidate listeners are filtered out by the target extension." should cover it.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrea Orru
    • Devlin Cronin
    • Emilia Paz
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
    Gerrit-Change-Number: 7707363
    Gerrit-PatchSet: 5
    Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
    Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
    Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Andrea Orru <andre...@chromium.org>
    Gerrit-Attention: Emilia Paz <emil...@chromium.org>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 23:00:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrea Orru (Gerrit)

    unread,
    Mar 31, 2026, 7:00:54 PM (2 days ago) Mar 31
    to Tal Keren, Emilia Paz, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Devlin Cronin, Emilia Paz and Tal Keren

    Andrea Orru added 1 comment

    Commit Message
    Line 12, Patchset 3:cases where a dispatch is undeliverable for other reasons, such as when
    Andrea Orru . unresolved

    Can you expand on what the reasons are? As far as I can tell:

    • Events with zero or blocked listeners are silently swallowed.
    • During broadcasts, failures in one extension can incorrectly abort successful WebRequest blocking requests from another.
    Tal Keren

    I have updated the message.
    But about the second point - it is a good point, didn't think about it, but it is actually divergent from EventRouter::DispatchPendingEvent. With broadcast and cannot_dispatch_callback - if any context is inactive at time of dispatch, EventRouter::DispatchPendingEvent is not aware about other potential listeners.
    so I don't think that this callback can work properly with broadcast anyway.

    it also made me look up how this callback is documenteed:

      // Called if the event cannot be dispatched to a lazy listener. This happens
    // if e.g. the extension registers an event listener from a lazy context
    // asynchronously, which results in the active listener not being registered
    // at the time the lazy context is spun back up.
    CannotDispatchCallback cannot_dispatch_callback;

    I wonder if it should be updated in any way.
    Andrea Orru

    I was talking about the scenario you are testing in the second unit test.

    Tal Keren

    Oh, I thought about BroadastEvent for a moment, but the helper doesn't even have that functionality. so nvm.
    About the second scenario, I think that "when all candidate listeners are filtered out by the target extension." should cover it.

    Andrea Orru

    Sounds good to me.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Devlin Cronin
    • Emilia Paz
    • Tal Keren
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
    Gerrit-Change-Number: 7707363
    Gerrit-PatchSet: 5
    Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
    Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
    Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Tal Keren <tke...@paloaltonetworks.com>
    Gerrit-Attention: Emilia Paz <emil...@chromium.org>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 23:00:43 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrea Orru (Gerrit)

    unread,
    Mar 31, 2026, 8:23:06 PM (2 days ago) Mar 31
    to Tal Keren, Emilia Paz, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Commit Message
    Andrea Orru

    ```
    CannotDispatchCallback cannot_dispatch_callback;
    ```

    As you mentioned would be good to list the reasons that we know when this is called in the documentation comment.

    Everything else looks good to me.

    Gerrit-Comment-Date: Wed, 01 Apr 2026 00:22:53 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Emilia Paz (Gerrit)

    unread,
    Mar 31, 2026, 8:36:47 PM (2 days ago) Mar 31
    to Tal Keren, Andrea Orru, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Devlin Cronin and Tal Keren

    Emilia Paz voted and added 1 comment

    Votes added by Emilia Paz

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 5 (Latest):
    Emilia Paz . resolved

    Overall lgtm, thanks Tal! Leaving the open comments to Andrea

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Devlin Cronin
    • Tal Keren
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
      Gerrit-Change-Number: 7707363
      Gerrit-PatchSet: 5
      Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
      Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
      Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
      Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
      Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Tal Keren <tke...@paloaltonetworks.com>
      Gerrit-Comment-Date: Wed, 01 Apr 2026 00:36:34 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tal Keren (Gerrit)

      unread,
      2:37 AM (12 hours ago) 2:37 AM
      to Emilia Paz, Andrea Orru, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
      Attention needed from Andrea Orru, Devlin Cronin and Emilia Paz

      Tal Keren added 1 comment

      Commit Message
      Line 12, Patchset 3:cases where a dispatch is undeliverable for other reasons, such as when
      Andrea Orru . resolved
      Tal Keren

      Updated the comment to reflect the current behavior

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrea Orru
      • Devlin Cronin
      • Emilia Paz
      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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
      Gerrit-Change-Number: 7707363
      Gerrit-PatchSet: 6
      Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
      Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
      Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
      Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
      Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Emilia Paz <emil...@chromium.org>
      Gerrit-Attention: Andrea Orru <andre...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 06:37:36 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andrea Orru (Gerrit)

      unread,
      1:09 PM (2 hours ago) 1:09 PM
      to Tal Keren, Emilia Paz, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
      Attention needed from Devlin Cronin, Emilia Paz and Tal Keren

      Andrea Orru voted and added 1 comment

      Votes added by Andrea Orru

      Code-Review+1

      1 comment

      Patchset-level comments
      File-level comment, Patchset 6 (Latest):
      Andrea Orru . resolved

      slgtm

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Devlin Cronin
      • Emilia Paz
      • Tal Keren
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: Ie31c8ae8c76ed9092003510917800d15e0d1ebcb
      Gerrit-Change-Number: 7707363
      Gerrit-PatchSet: 6
      Gerrit-Owner: Tal Keren <tke...@paloaltonetworks.com>
      Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
      Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
      Gerrit-Reviewer: Tal Keren <tke...@paloaltonetworks.com>
      Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Attention: Tal Keren <tke...@paloaltonetworks.com>
      Gerrit-Attention: Emilia Paz <emil...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 17:09:25 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages