Remove data decoder use in declarative net request ruleset indexing [chromium/src : main]

0 views
Skip to first unread message

Daniel Cheng (Gerrit)

unread,
Jul 30, 2026, 1:31:53 PM (16 hours ago) Jul 30
to Daniel Cheng, Reilly Grant, chromium...@chromium.org, Hans Wennborg, Nate Chapin, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, feature-me...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, mac-r...@chromium.org, sloboda...@chromium.org, tommyw+w...@chromium.org, video-networking...@google.com, zol...@webkit.org, extension...@chromium.org, chromium-a...@chromium.org
Attention needed from Reilly Grant

Daniel Cheng voted and added 3 comments

Votes added by Daniel Cheng

Commit-Queue+1

3 comments

File extensions/browser/api/declarative_net_request/file_backed_ruleset_source.cc
Line 253, Patchset 25 (Parent): base::ElapsedTimer timer;
Daniel Cheng . resolved

I'm not sure if all the timers still measure the exact same thing; in particular, this timer didn't used to include json parsing time...

Line 313, Patchset 25 (Latest): base::ElapsedTimer timer;
Daniel Cheng . resolved

Though I guess it's a bit of a mixed bag, because it did include JSON parsing time previously on the "unsafe" path so you could reasonably argue that it's just unifying things.

Line 380, Patchset 25 (Latest): if (!base::PathExists(json_path_)) {
Daniel Cheng . resolved

This is a little optimization that jetski really really wanted so I didn't try ot fight it :)

Open in Gerrit

Related details

Attention is currently required from:
  • Reilly Grant
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: Ifcec8d56f51e470e277efec46171ecff499efff1
Gerrit-Change-Number: 7907524
Gerrit-PatchSet: 25
Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
Gerrit-CC: Hans Wennborg <ha...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Attention: Reilly Grant <rei...@chromium.org>
Gerrit-Comment-Date: Thu, 30 Jul 2026 17:31:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Reilly Grant (Gerrit)

unread,
Jul 30, 2026, 3:48:08 PM (14 hours ago) Jul 30
to Daniel Cheng, Reilly Grant, chromium...@chromium.org, Hans Wennborg, Nate Chapin, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, feature-me...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, mac-r...@chromium.org, sloboda...@chromium.org, tommyw+w...@chromium.org, video-networking...@google.com, zol...@webkit.org, extension...@chromium.org, chromium-a...@chromium.org
Attention needed from Daniel Cheng

Reilly Grant voted and added 1 comment

Votes added by Reilly Grant

Code-Review+1

1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: Ifcec8d56f51e470e277efec46171ecff499efff1
Gerrit-Change-Number: 7907524
Gerrit-PatchSet: 26
Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
Gerrit-CC: Hans Wennborg <ha...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Thu, 30 Jul 2026 19:47:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Daniel Cheng (Gerrit)

unread,
Jul 30, 2026, 4:47:20 PM (13 hours ago) Jul 30
to Daniel Cheng, Reilly Grant, chromium...@chromium.org, Hans Wennborg, Nate Chapin, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, feature-me...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, mac-r...@chromium.org, sloboda...@chromium.org, tommyw+w...@chromium.org, video-networking...@google.com, zol...@webkit.org, extension...@chromium.org, chromium-a...@chromium.org

Daniel Cheng voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: Ifcec8d56f51e470e277efec46171ecff499efff1
Gerrit-Change-Number: 7907524
Gerrit-PatchSet: 27
Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
Gerrit-CC: Hans Wennborg <ha...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Comment-Date: Thu, 30 Jul 2026 20:47:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Chromium LUCI CQ (Gerrit)

unread,
Jul 30, 2026, 4:51:12 PM (13 hours ago) Jul 30
to Daniel Cheng, Reilly Grant, chromium...@chromium.org, Hans Wennborg, Nate Chapin, android-bu...@system.gserviceaccount.com, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, feature-me...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, mac-r...@chromium.org, sloboda...@chromium.org, tommyw+w...@chromium.org, video-networking...@google.com, zol...@webkit.org, extension...@chromium.org, chromium-a...@chromium.org

Chromium LUCI CQ submitted the change

Unreviewed changes

26 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Change information

Commit message:
Remove data decoder use in declarative net request ruleset indexing

`base::JSONReader` is backed by a memory-safe parser, so using a
sandboxed data decoder process is no longer necessary–in fact, all the
former entry points to the data decoder's JSON parser simply
synchronously parse on the calling thread and then post a task to the
same sequence to report the result.

While converting everything to be synchronous would be straightforward,
this CL preserves the async path where it already exists today: the
95%ile time on Extensions.DeclarativeNetRequest.IndexAndPersistRulesTime
in the seconds range. To avoid blocking a task runner continuously for
seconds at a time, the async paths process rulesets for up to 50
milliseconds before yielding and posting a task to continue where it
left off.

Despite still having some asynchronous control flows, this still
significantly simplifies the code overall, e.g. `RulesetInfo` no longer
needs to persist whether or not the indexing was successful in a field,
as the actual parsing/indexing path for an individual rulset is fully
synchronous.
Bug: 40538050
Bug: 459848478
Change-Id: Ifcec8d56f51e470e277efec46171ecff499efff1
Reviewed-by: Reilly Grant <rei...@chromium.org>
Commit-Queue: Daniel Cheng <dch...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1671388}
Files:
  • M extensions/browser/api/declarative_net_request/constants.h
  • M extensions/browser/api/declarative_net_request/declarative_net_request_api.cc
  • M extensions/browser/api/declarative_net_request/file_backed_ruleset_source.cc
  • M extensions/browser/api/declarative_net_request/file_backed_ruleset_source.h
  • M extensions/browser/api/declarative_net_request/file_sequence_helper.cc
  • M extensions/browser/api/declarative_net_request/file_sequence_helper.h
  • M extensions/browser/api/declarative_net_request/file_sequence_helper_unittest.cc
  • M extensions/browser/api/declarative_net_request/install_index_helper.cc
  • M extensions/browser/api/declarative_net_request/install_index_helper.h
  • M extensions/browser/api/declarative_net_request/test_utils.cc
  • M extensions/browser/unpacked_installer.cc
Change size: L
Delta: 11 files changed, 272 insertions(+), 458 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Reilly Grant
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifcec8d56f51e470e277efec46171ecff499efff1
Gerrit-Change-Number: 7907524
Gerrit-PatchSet: 28
Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages