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

Unified Diff: chrome/browser/extensions/api/declarative/rules_registry_with_cache.h

Issue 14851011: RulesRegistryWithCache::ProcessChangedRules speed-up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative/rules_registry_with_cache.h
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.h b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.h
index 3bbf8e87db1b9d7367ce8299b5aef945bfa03f6f..c95a8033e62e2aac1aa6b87c7eecaf7f91bf3cf8 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.h
+++ b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.h
@@ -29,6 +29,7 @@ namespace extensions {
// in the RuleStorageOnUI object.
class RulesRegistryWithCache : public RulesRegistry {
public:
+ typedef std::vector<linked_ptr<RulesRegistry::Rule> > RulesVector;
// RuleStorageOnUI implements the part of the RulesRegistry which works on
// the UI thread. It should only be used on the UI thread. It gets created
// by the RulesRegistry, but right after that it changes owner to the
@@ -49,7 +50,7 @@ class RulesRegistryWithCache : public RulesRegistry {
void Init();
void WriteToStorage(const std::string& extension_id,
- scoped_ptr<base::Value> value);
+ scoped_ptr<RulesVector> new_rules);
base::WeakPtr<RuleStorageOnUI> GetWeakPtr() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
@@ -162,9 +163,7 @@ class RulesRegistryWithCache : public RulesRegistry {
private:
typedef std::string ExtensionId;
typedef std::string RuleId;
- typedef std::pair<ExtensionId, RuleId> RulesDictionaryKey;
- typedef std::map<RulesDictionaryKey, linked_ptr<RulesRegistry::Rule> >
- RulesDictionary;
+ typedef std::map<RuleId, linked_ptr<RulesRegistry::Rule> > RulesDictionary;
// Common processing after extension's rules have changed.
void ProcessChangedRules(const std::string& extension_id);
@@ -178,7 +177,7 @@ class RulesRegistryWithCache : public RulesRegistry {
scoped_ptr<base::Value> rules);
- RulesDictionary rules_;
+ std::map<ExtensionId, RulesDictionary> rules_;
battre 2013/05/07 16:22:09 This variable is going to be deleted with my CL. I
std::vector<base::Closure> ready_callbacks_;
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698