Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Issue 49693003: Refactor RulesRegistryWithCache to RulesRegistry (Closed)

Created:
7 years, 1 month ago by Fady Samuel
Modified:
7 years, 1 month ago
CC:
chromium-reviews, joi+watch-content_chromium.org, chromium-apps-reviews_chromium.org, darin-cc_chromium.org, jam, extensions-reviews_chromium.org, vabr (Chromium)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Refactor RulesRegistryWithCache to RulesRegistry As a prerequisites to isolating declarative RulesRegistry on a per-webview basis, we need to do some cleanup. 1. Get rid of the abstract class RulesRegistry, RulesRegistryWithCache becomes RulesRegistry. The caching component becomes an optional delegate. 2. Get rid of InitializingRulesRegistry. Move that functionality down into RulesRegistry. This CL accomplishes the above but the RulesCacheDelegate is always installed. It will become optional in a subsequent CL. BUG=312461 R=jyasskin@chromium.org, vabr@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=232124

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : Tests mostly work #

Total comments: 9

Patch Set 4 : Similarity matching #

Total comments: 11

Patch Set 5 : Addressed nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+468 lines, -1678 lines) Patch
D chrome/browser/extensions/api/declarative/initializing_rules_registry.h View 1 1 chunk +0 lines, -91 lines 0 comments Download
D chrome/browser/extensions/api/declarative/initializing_rules_registry.cc View 1 1 chunk +0 lines, -161 lines 0 comments Download
M chrome/browser/extensions/api/declarative/initializing_rules_registry_unittest.cc View 1 2 11 chunks +14 lines, -16 lines 0 comments Download
A + chrome/browser/extensions/api/declarative/rules_cache_delegate.h View 1 2 3 1 chunk +100 lines, -86 lines 0 comments Download
A + chrome/browser/extensions/api/declarative/rules_cache_delegate.cc View 1 2 3 12 chunks +34 lines, -272 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry.h View 1 2 3 4 6 chunks +155 lines, -24 lines 0 comments Download
A + chrome/browser/extensions/api/declarative/rules_registry.cc View 1 2 3 4 13 chunks +102 lines, -232 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_service.h View 1 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_service.cc View 1 3 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_with_cache.h View 1 1 chunk +0 lines, -246 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc View 1 1 chunk +0 lines, -484 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc View 1 2 6 chunks +13 lines, -12 lines 0 comments Download
M chrome/browser/extensions/api/declarative/test_rules_registry.h View 1 3 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/declarative/test_rules_registry.cc View 1 1 chunk +11 lines, -11 lines 0 comments Download
M chrome/browser/extensions/api/declarative_content/content_rules_registry.h View 1 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/declarative_content/content_rules_registry.cc View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h View 1 3 chunks +7 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc View 1 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 2 chunks +3 lines, -5 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Fady Samuel
7 years, 1 month ago (2013-10-28 23:07:59 UTC) #1
Fady Samuel
7 years, 1 month ago (2013-10-29 10:57:19 UTC) #2
vabr (Chromium)
Hi Fady, Thanks for going the systematic way to dropping the rules store for webview! ...
7 years, 1 month ago (2013-10-29 13:08:23 UTC) #3
vabr (Chromium)
Hi Fady, Thanks for clarifying your intents over IM. So now I understand you want ...
7 years, 1 month ago (2013-10-29 16:05:54 UTC) #4
vabr (Chromium)
Hi Fady, Thanks for clarifying your intents over IM. So now I understand you want ...
7 years, 1 month ago (2013-10-29 16:06:48 UTC) #5
Jeffrey Yasskin
lgtm https://codereview.chromium.org/49693003/diff/60001/chrome/browser/extensions/api/declarative/initializing_rules_registry_unittest.cc File chrome/browser/extensions/api/declarative/initializing_rules_registry_unittest.cc (right): https://codereview.chromium.org/49693003/diff/60001/chrome/browser/extensions/api/declarative/initializing_rules_registry_unittest.cc#newcode1 chrome/browser/extensions/api/declarative/initializing_rules_registry_unittest.cc:1: // Copyright (c) 2012 The Chromium Authors. All ...
7 years, 1 month ago (2013-10-30 22:30:48 UTC) #6
Fady Samuel
Addressed nits. CQ'ing. https://codereview.chromium.org/49693003/diff/230001/chrome/browser/extensions/api/declarative/rules_cache_delegate.h File chrome/browser/extensions/api/declarative/rules_cache_delegate.h (right): https://codereview.chromium.org/49693003/diff/230001/chrome/browser/extensions/api/declarative/rules_cache_delegate.h#newcode26 chrome/browser/extensions/api/declarative/rules_cache_delegate.h:26: // RulesRegistryService, and is deleted by ...
7 years, 1 month ago (2013-10-31 14:02:23 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fsamuel@chromium.org/49693003/320001
7 years, 1 month ago (2013-10-31 14:04:29 UTC) #8
Fady Samuel
Committed patchset #5 manually as r232124 (presubmit successful).
7 years, 1 month ago (2013-10-31 15:33:13 UTC) #9
vabr (Chromium)
7 years, 1 month ago (2013-10-31 16:35:05 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/49693003/diff/230001/chrome/browser/extension...
File chrome/browser/extensions/api/declarative/rules_registry.cc (right):

https://codereview.chromium.org/49693003/diff/230001/chrome/browser/extension...
chrome/browser/extensions/api/declarative/rules_registry.cc:108: std::string
error = CheckAndFillInOptionalRules(extension_id, rules);
On 2013/10/31 14:02:24, Fady Samuel wrote:
> On 2013/10/30 22:30:48, Jeffrey Yasskin wrote:
> > This is probably fine, but note that, now that InitializingRulesRegistry and
> > RulesRegistryWithCache are the same, on startup we'll call these FillIn
> methods
> > redundantly when re-adding the rules from the cache.
> 
> OK. This is one time operation on browser startup that hopefully isn't too
> expensive.

Actually, the start-up time is a critical point. We spent some time this Spring
trying to speed that part up. For Declarative Web Request rules we have to deal
with the order of tens of thousands of rules. For that numbers, all the string
processing like in CheckAndFillInOptionalRules could easily sum up to hundreds
of ms. So if there is a way to remove redundant calls (in a follow-up CL), that
would be great.

Powered by Google App Engine
This is Rietveld 408576698