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

Side by Side Diff: extensions/browser/api/declarative/rules_registry.cc

Issue 1158693006: Create a mechanism define declarative rules via the extension manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a manifest handler Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/api/declarative/rules_registry.h" 5 #include "extensions/browser/api/declarative/rules_registry.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/notification_details.h" 18 #include "content/public/browser/notification_details.h"
19 #include "content/public/browser/notification_source.h" 19 #include "content/public/browser/notification_source.h"
20 #include "extensions/browser/api/declarative/rules_cache_delegate.h" 20 #include "extensions/browser/api/declarative/rules_cache_delegate.h"
21 #include "extensions/browser/extension_prefs.h" 21 #include "extensions/browser/extension_prefs.h"
22 #include "extensions/browser/extension_system.h" 22 #include "extensions/browser/extension_system.h"
23 #include "extensions/browser/state_store.h" 23 #include "extensions/browser/state_store.h"
24 #include "extensions/common/api/declarative/declarative_manifest_data.h"
24 #include "extensions/common/extension.h" 25 #include "extensions/common/extension.h"
26 #include "extensions/common/manifest_constants.h"
27
28 namespace extensions {
25 29
26 namespace { 30 namespace {
27 31
28 const char kSuccess[] = ""; 32 const char kSuccess[] = "";
29 const char kDuplicateRuleId[] = "Duplicate rule ID: %s"; 33 const char kDuplicateRuleId[] = "Duplicate rule ID: %s";
34 const char kErrorCannotRemoveManifestRules[] =
35 "Rules declared in the 'event_rules' manifest field cannot be removed";
30 36
31 scoped_ptr<base::Value> RulesToValue( 37 scoped_ptr<base::Value> RulesToValue(
32 const std::vector<linked_ptr<extensions::RulesRegistry::Rule> >& rules) { 38 const std::vector<linked_ptr<RulesRegistry::Rule>>& rules) {
33 scoped_ptr<base::ListValue> list(new base::ListValue()); 39 scoped_ptr<base::ListValue> list(new base::ListValue());
34 for (size_t i = 0; i < rules.size(); ++i) 40 for (size_t i = 0; i < rules.size(); ++i)
35 list->Append(rules[i]->ToValue().release()); 41 list->Append(rules[i]->ToValue().release());
36 return list.Pass(); 42 return list.Pass();
37 } 43 }
38 44
39 std::vector<linked_ptr<extensions::RulesRegistry::Rule> > RulesFromValue( 45 std::vector<linked_ptr<RulesRegistry::Rule>> RulesFromValue(
40 const base::Value* value) { 46 const base::Value* value) {
41 std::vector<linked_ptr<extensions::RulesRegistry::Rule> > rules; 47 std::vector<linked_ptr<RulesRegistry::Rule>> rules;
42 48
43 const base::ListValue* list = NULL; 49 const base::ListValue* list = NULL;
44 if (!value || !value->GetAsList(&list)) 50 if (!value || !value->GetAsList(&list))
45 return rules; 51 return rules;
46 52
47 rules.reserve(list->GetSize()); 53 rules.reserve(list->GetSize());
48 for (size_t i = 0; i < list->GetSize(); ++i) { 54 for (size_t i = 0; i < list->GetSize(); ++i) {
49 const base::DictionaryValue* dict = NULL; 55 const base::DictionaryValue* dict = NULL;
50 if (!list->GetDictionary(i, &dict)) 56 if (!list->GetDictionary(i, &dict))
51 continue; 57 continue;
52 linked_ptr<extensions::RulesRegistry::Rule> rule( 58 linked_ptr<RulesRegistry::Rule> rule(new RulesRegistry::Rule());
53 new extensions::RulesRegistry::Rule()); 59 if (RulesRegistry::Rule::Populate(*dict, rule.get()))
54 if (extensions::RulesRegistry::Rule::Populate(*dict, rule.get()))
55 rules.push_back(rule); 60 rules.push_back(rule);
56 } 61 }
57 62
58 return rules; 63 return rules;
59 } 64 }
60 65
61 std::string ToId(int identifier) { 66 std::string ToId(int identifier) {
62 return base::StringPrintf("_%d_", identifier); 67 return base::StringPrintf("_%d_", identifier);
63 } 68 }
64 69
65 } // namespace 70 } // namespace
66 71
67 72
68 namespace extensions {
69
70 // RulesRegistry 73 // RulesRegistry
71 74
72 RulesRegistry::RulesRegistry(content::BrowserContext* browser_context, 75 RulesRegistry::RulesRegistry(content::BrowserContext* browser_context,
73 const std::string& event_name, 76 const std::string& event_name,
74 content::BrowserThread::ID owner_thread, 77 content::BrowserThread::ID owner_thread,
75 RulesCacheDelegate* cache_delegate, 78 RulesCacheDelegate* cache_delegate,
76 int id) 79 int id)
77 : browser_context_(browser_context), 80 : browser_context_(browser_context),
78 owner_thread_(owner_thread), 81 owner_thread_(owner_thread),
79 event_name_(event_name), 82 event_name_(event_name),
80 id_(id), 83 id_(id),
81 ready_(/*signaled=*/!cache_delegate), // Immediately ready if no cache 84 ready_(/*signaled=*/!cache_delegate), // Immediately ready if no cache
82 // delegate to wait for. 85 // delegate to wait for.
83 last_generated_rule_identifier_id_(0), 86 last_generated_rule_identifier_id_(0),
84 weak_ptr_factory_(browser_context_ ? this : NULL) { 87 weak_ptr_factory_(browser_context_ ? this : NULL) {
85 if (cache_delegate) { 88 if (cache_delegate) {
86 cache_delegate_ = cache_delegate->GetWeakPtr(); 89 cache_delegate_ = cache_delegate->GetWeakPtr();
87 cache_delegate->Init(this); 90 cache_delegate->Init(this);
88 } 91 }
89 } 92 }
90 93
91 std::string RulesRegistry::AddRulesNoFill( 94 std::string RulesRegistry::AddRulesNoFill(
92 const std::string& extension_id, 95 const std::string& extension_id,
93 const std::vector<linked_ptr<Rule> >& rules) { 96 const std::vector<linked_ptr<Rule>>& rules,
97 RulesDictionary& out) {
94 DCHECK_CURRENTLY_ON(owner_thread()); 98 DCHECK_CURRENTLY_ON(owner_thread());
95 99
96 // Verify that all rule IDs are new. 100 // Verify that all rule IDs are new.
97 for (std::vector<linked_ptr<Rule> >::const_iterator i = 101 for (std::vector<linked_ptr<Rule> >::const_iterator i =
98 rules.begin(); i != rules.end(); ++i) { 102 rules.begin(); i != rules.end(); ++i) {
99 const RuleId& rule_id = *((*i)->id); 103 const RuleId& rule_id = *((*i)->id);
100 // Every rule should have a priority assigned. 104 // Every rule should have a priority assigned.
101 DCHECK((*i)->priority); 105 DCHECK((*i)->priority);
102 RulesDictionaryKey key(extension_id, rule_id); 106 RulesDictionaryKey key(extension_id, rule_id);
103 if (rules_.find(key) != rules_.end()) 107 if (rules_.find(key) != rules_.end() ||
108 manifest_rules_.find(key) != manifest_rules_.end())
104 return base::StringPrintf(kDuplicateRuleId, rule_id.c_str()); 109 return base::StringPrintf(kDuplicateRuleId, rule_id.c_str());
105 } 110 }
106 111
107 std::string error = AddRulesImpl(extension_id, rules); 112 std::string error = AddRulesImpl(extension_id, rules);
108 113
109 if (!error.empty()) 114 if (!error.empty())
110 return error; 115 return error;
111 116
112 // Commit all rules into |rules_| on success. 117 // Commit all rules into |rules_| on success.
113 for (std::vector<linked_ptr<Rule> >::const_iterator i = 118 for (std::vector<linked_ptr<Rule> >::const_iterator i =
114 rules.begin(); i != rules.end(); ++i) { 119 rules.begin(); i != rules.end(); ++i) {
115 const RuleId& rule_id = *((*i)->id); 120 const RuleId& rule_id = *((*i)->id);
116 RulesDictionaryKey key(extension_id, rule_id); 121 RulesDictionaryKey key(extension_id, rule_id);
117 rules_[key] = *i; 122 out[key] = *i;
118 } 123 }
119 124
120 MaybeProcessChangedRules(extension_id); 125 MaybeProcessChangedRules(extension_id);
121 return kSuccess; 126 return kSuccess;
122 } 127 }
123 128
124 std::string RulesRegistry::AddRules( 129 std::string RulesRegistry::AddRules(
125 const std::string& extension_id, 130 const std::string& extension_id,
126 const std::vector<linked_ptr<Rule> >& rules) { 131 const std::vector<linked_ptr<Rule>>& rules) {
132 return AddRulesInternal(extension_id, rules, rules_);
133 }
134
135 std::string RulesRegistry::AddRulesInternal(
136 const std::string& extension_id,
137 const std::vector<linked_ptr<Rule>>& rules,
138 RulesDictionary& out) {
127 DCHECK_CURRENTLY_ON(owner_thread()); 139 DCHECK_CURRENTLY_ON(owner_thread());
128 140
129 std::string error = CheckAndFillInOptionalRules(extension_id, rules); 141 std::string error = CheckAndFillInOptionalRules(extension_id, rules);
130 if (!error.empty()) 142 if (!error.empty())
131 return error; 143 return error;
132 FillInOptionalPriorities(rules); 144 FillInOptionalPriorities(rules);
133 145
134 return AddRulesNoFill(extension_id, rules); 146 return AddRulesNoFill(extension_id, rules, out);
135 } 147 }
136 148
137 std::string RulesRegistry::RemoveRules( 149 std::string RulesRegistry::RemoveRules(
138 const std::string& extension_id, 150 const std::string& extension_id,
139 const std::vector<std::string>& rule_identifiers) { 151 const std::vector<std::string>& rule_identifiers) {
140 DCHECK_CURRENTLY_ON(owner_thread()); 152 DCHECK_CURRENTLY_ON(owner_thread());
141 153
154 // Check if any of the rules are non-removable.
155 for (RuleId rule_id : rule_identifiers) {
156 RulesDictionaryKey lookup_key(extension_id, rule_id);
157 RulesDictionary::iterator itr = manifest_rules_.find(lookup_key);
158 if (itr != manifest_rules_.end())
159 return kErrorCannotRemoveManifestRules;
160 }
161
142 std::string error = RemoveRulesImpl(extension_id, rule_identifiers); 162 std::string error = RemoveRulesImpl(extension_id, rule_identifiers);
143 163
144 if (!error.empty()) 164 if (!error.empty())
145 return error; 165 return error;
146 166
147 for (std::vector<std::string>::const_iterator i = rule_identifiers.begin(); 167 for (std::vector<std::string>::const_iterator i = rule_identifiers.begin();
148 i != rule_identifiers.end(); 168 i != rule_identifiers.end();
149 ++i) { 169 ++i) {
150 RulesDictionaryKey lookup_key(extension_id, *i); 170 RulesDictionaryKey lookup_key(extension_id, *i);
151 rules_.erase(lookup_key); 171 rules_.erase(lookup_key);
152 } 172 }
153 173
154 MaybeProcessChangedRules(extension_id); 174 MaybeProcessChangedRules(extension_id);
155 RemoveUsedRuleIdentifiers(extension_id, rule_identifiers); 175 RemoveUsedRuleIdentifiers(extension_id, rule_identifiers);
156 return kSuccess; 176 return kSuccess;
157 } 177 }
158 178
159 std::string RulesRegistry::RemoveAllRules(const std::string& extension_id) { 179 std::string RulesRegistry::RemoveAllRules(const std::string& extension_id) {
160 std::string result = RulesRegistry::RemoveAllRulesNoStoreUpdate(extension_id); 180 std::string result =
181 RulesRegistry::RemoveAllRulesNoStoreUpdate(extension_id, false);
161 MaybeProcessChangedRules(extension_id); // Now update the prefs and store. 182 MaybeProcessChangedRules(extension_id); // Now update the prefs and store.
162 return result; 183 return result;
163 } 184 }
164 185
165 std::string RulesRegistry::RemoveAllRulesNoStoreUpdate( 186 std::string RulesRegistry::RemoveAllRulesNoStoreUpdate(
166 const std::string& extension_id) { 187 const std::string& extension_id,
188 bool uninstall) {
not at google - send to devlin 2015/06/08 21:44:58 I'm not sure what "uninstall" means in this contex
danduong 2015/06/09 01:21:26 Done.
167 DCHECK_CURRENTLY_ON(owner_thread()); 189 DCHECK_CURRENTLY_ON(owner_thread());
168 190
169 std::string error = RemoveAllRulesImpl(extension_id); 191 std::string error = RemoveAllRulesImpl(extension_id);
170 192
171 if (!error.empty()) 193 if (!error.empty())
172 return error; 194 return error;
173 195
174 for (RulesDictionary::const_iterator i = rules_.begin(); 196 auto remove_rules = [&extension_id](RulesDictionary& dictionary) {
175 i != rules_.end();) { 197 for (auto it = dictionary.begin(); it != dictionary.end();) {
176 const RulesDictionaryKey& key = i->first; 198 if (it->first.first == extension_id)
177 ++i; 199 dictionary.erase(it++);
178 if (key.first == extension_id) 200 else
179 rules_.erase(key); 201 ++it;
180 } 202 }
203 };
204 remove_rules(rules_);
205 if (uninstall)
206 remove_rules(manifest_rules_);
181 207
182 RemoveAllUsedRuleIdentifiers(extension_id); 208 RemoveAllUsedRuleIdentifiers(extension_id);
183 return kSuccess; 209 return kSuccess;
184 } 210 }
185 211
186 void RulesRegistry::GetRules(const std::string& extension_id, 212 void RulesRegistry::GetRules(const std::string& extension_id,
187 const std::vector<std::string>& rule_identifiers, 213 const std::vector<std::string>& rule_identifiers,
188 std::vector<linked_ptr<Rule> >* out) { 214 std::vector<linked_ptr<Rule> >* out) {
189 DCHECK_CURRENTLY_ON(owner_thread()); 215 DCHECK_CURRENTLY_ON(owner_thread());
190 216
191 for (std::vector<std::string>::const_iterator i = rule_identifiers.begin(); 217 for (const auto& i : rule_identifiers) {
192 i != rule_identifiers.end(); ++i) { 218 RulesDictionaryKey lookup_key(extension_id, i);
193 RulesDictionaryKey lookup_key(extension_id, *i);
194 RulesDictionary::iterator entry = rules_.find(lookup_key); 219 RulesDictionary::iterator entry = rules_.find(lookup_key);
220 if (entry == rules_.end())
221 entry = manifest_rules_.find(lookup_key);
195 if (entry != rules_.end()) 222 if (entry != rules_.end())
196 out->push_back(entry->second); 223 out->push_back(entry->second);
197 } 224 }
198 } 225 }
199 226
227 void RulesRegistry::GetRules(
228 const std::string& extension_id,
229 RulesDictionary& rules,
230 std::vector<linked_ptr<RulesRegistry::Rule>>* out) {
231 for (const auto& i : rules) {
232 const RulesDictionaryKey& key = i.first;
233 if (key.first == extension_id)
234 out->push_back(i.second);
235 }
236 }
237
200 void RulesRegistry::GetAllRules(const std::string& extension_id, 238 void RulesRegistry::GetAllRules(const std::string& extension_id,
201 std::vector<linked_ptr<Rule> >* out) { 239 std::vector<linked_ptr<Rule> >* out) {
202 DCHECK_CURRENTLY_ON(owner_thread()); 240 DCHECK_CURRENTLY_ON(owner_thread());
203 for (RulesDictionary::const_iterator i = rules_.begin(); 241 GetRules(extension_id, manifest_rules_, out);
204 i != rules_.end(); ++i) { 242 GetRules(extension_id, rules_, out);
205 const RulesDictionaryKey& key = i->first;
206 if (key.first == extension_id)
207 out->push_back(i->second);
208 }
209 } 243 }
210 244
211 void RulesRegistry::OnExtensionUnloaded(const std::string& extension_id) { 245 void RulesRegistry::OnExtensionUnloaded(const Extension* extension) {
212 DCHECK_CURRENTLY_ON(owner_thread()); 246 DCHECK_CURRENTLY_ON(owner_thread());
213 std::string error = RemoveAllRulesImpl(extension_id); 247 std::string error = RemoveAllRulesImpl(extension->id());
214 if (!error.empty()) 248 if (!error.empty())
215 LOG(ERROR) << error; 249 LOG(ERROR) << error;
216 } 250 }
217 251
218 void RulesRegistry::OnExtensionUninstalled(const std::string& extension_id) { 252 void RulesRegistry::OnExtensionUninstalled(const Extension* extension) {
219 DCHECK_CURRENTLY_ON(owner_thread()); 253 DCHECK_CURRENTLY_ON(owner_thread());
220 std::string error = RemoveAllRulesNoStoreUpdate(extension_id); 254 std::string error = RemoveAllRulesNoStoreUpdate(extension->id(), true);
221 if (!error.empty()) 255 if (!error.empty())
222 LOG(ERROR) << error; 256 LOG(ERROR) << error;
223 } 257 }
224 258
225 void RulesRegistry::OnExtensionLoaded(const std::string& extension_id) { 259 void RulesRegistry::OnExtensionLoaded(const Extension* extension) {
226 DCHECK_CURRENTLY_ON(owner_thread()); 260 DCHECK_CURRENTLY_ON(owner_thread());
227 std::vector<linked_ptr<Rule> > rules; 261 std::vector<linked_ptr<Rule>> rules;
228 GetAllRules(extension_id, &rules); 262 GetAllRules(extension->id(), &rules);
229 std::string error = AddRulesImpl(extension_id, rules); 263 std::vector<linked_ptr<Rule>>& manifest_rules =
264 DeclarativeManifestData::Get(extension)->RulesForEvent(event_name_);
265 if (manifest_rules.size()) {
266 std::string error =
267 AddRulesInternal(extension->id(), manifest_rules, manifest_rules_);
268 if (!error.empty())
269 LOG(ERROR) << error;
270 }
271 std::string error = AddRulesImpl(extension->id(), rules);
230 if (!error.empty()) 272 if (!error.empty())
231 LOG(ERROR) << error; 273 LOG(ERROR) << error;
232 } 274 }
233 275
234 size_t RulesRegistry::GetNumberOfUsedRuleIdentifiersForTesting() const { 276 size_t RulesRegistry::GetNumberOfUsedRuleIdentifiersForTesting() const {
235 size_t entry_count = 0u; 277 size_t entry_count = 0u;
236 for (RuleIdentifiersMap::const_iterator extension = 278 for (RuleIdentifiersMap::const_iterator extension =
237 used_rule_identifiers_.begin(); 279 used_rule_identifiers_.begin();
238 extension != used_rule_identifiers_.end(); 280 extension != used_rule_identifiers_.end();
239 ++extension) { 281 ++extension) {
240 // Each extension is counted as 1 just for being there. Otherwise we miss 282 // Each extension is counted as 1 just for being there. Otherwise we miss
241 // keys with empty values. 283 // keys with empty values.
242 entry_count += 1u + extension->second.size(); 284 entry_count += 1u + extension->second.size();
243 } 285 }
244 return entry_count; 286 return entry_count;
245 } 287 }
246 288
247 void RulesRegistry::DeserializeAndAddRules( 289 void RulesRegistry::DeserializeAndAddRules(
248 const std::string& extension_id, 290 const std::string& extension_id,
249 scoped_ptr<base::Value> rules) { 291 scoped_ptr<base::Value> rules) {
250 DCHECK_CURRENTLY_ON(owner_thread()); 292 DCHECK_CURRENTLY_ON(owner_thread());
251 293
252 AddRulesNoFill(extension_id, RulesFromValue(rules.get())); 294 AddRulesNoFill(extension_id, RulesFromValue(rules.get()), rules_);
253 } 295 }
254 296
255 RulesRegistry::~RulesRegistry() { 297 RulesRegistry::~RulesRegistry() {
256 } 298 }
257 299
258 void RulesRegistry::MarkReady(base::Time storage_init_time) { 300 void RulesRegistry::MarkReady(base::Time storage_init_time) {
259 DCHECK_CURRENTLY_ON(owner_thread()); 301 DCHECK_CURRENTLY_ON(owner_thread());
260 302
261 if (!storage_init_time.is_null()) { 303 if (!storage_init_time.is_null()) {
262 UMA_HISTOGRAM_TIMES("Extensions.DeclarativeRulesStorageInitialization", 304 UMA_HISTOGRAM_TIMES("Extensions.DeclarativeRulesStorageInitialization",
263 base::Time::Now() - storage_init_time); 305 base::Time::Now() - storage_init_time);
264 } 306 }
265 307
266 ready_.Signal(); 308 ready_.Signal();
267 } 309 }
268 310
269 void RulesRegistry::ProcessChangedRules(const std::string& extension_id) { 311 void RulesRegistry::ProcessChangedRules(const std::string& extension_id) {
270 DCHECK_CURRENTLY_ON(owner_thread()); 312 DCHECK_CURRENTLY_ON(owner_thread());
271 313
272 DCHECK(ContainsKey(process_changed_rules_requested_, extension_id)); 314 DCHECK(ContainsKey(process_changed_rules_requested_, extension_id));
273 process_changed_rules_requested_[extension_id] = NOT_SCHEDULED_FOR_PROCESSING; 315 process_changed_rules_requested_[extension_id] = NOT_SCHEDULED_FOR_PROCESSING;
274 316
275 std::vector<linked_ptr<Rule> > new_rules; 317 std::vector<linked_ptr<Rule> > new_rules;
276 GetAllRules(extension_id, &new_rules); 318 GetRules(extension_id, rules_, &new_rules);
277 content::BrowserThread::PostTask( 319 content::BrowserThread::PostTask(
278 content::BrowserThread::UI, 320 content::BrowserThread::UI, FROM_HERE,
279 FROM_HERE, 321 base::Bind(&RulesCacheDelegate::WriteToStorage, cache_delegate_,
280 base::Bind(&RulesCacheDelegate::WriteToStorage, 322 extension_id, base::Passed(RulesToValue(new_rules))));
281 cache_delegate_,
282 extension_id,
283 base::Passed(RulesToValue(new_rules))));
284 } 323 }
285 324
286 void RulesRegistry::MaybeProcessChangedRules(const std::string& extension_id) { 325 void RulesRegistry::MaybeProcessChangedRules(const std::string& extension_id) {
287 // Read and initialize |process_changed_rules_requested_[extension_id]| if 326 // Read and initialize |process_changed_rules_requested_[extension_id]| if
288 // necessary. (Note that the insertion below will not overwrite 327 // necessary. (Note that the insertion below will not overwrite
289 // |process_changed_rules_requested_[extension_id]| if that already exists. 328 // |process_changed_rules_requested_[extension_id]| if that already exists.
290 std::pair<ProcessStateMap::iterator, bool> insertion = 329 std::pair<ProcessStateMap::iterator, bool> insertion =
291 process_changed_rules_requested_.insert(std::make_pair( 330 process_changed_rules_requested_.insert(std::make_pair(
292 extension_id, 331 extension_id,
293 browser_context_ ? NOT_SCHEDULED_FOR_PROCESSING : NEVER_PROCESS)); 332 browser_context_ ? NOT_SCHEDULED_FOR_PROCESSING : NEVER_PROCESS));
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 for (i = identifiers.begin(); i != identifiers.end(); ++i) 406 for (i = identifiers.begin(); i != identifiers.end(); ++i)
368 used_rule_identifiers_[extension_id].erase(*i); 407 used_rule_identifiers_[extension_id].erase(*i);
369 } 408 }
370 409
371 void RulesRegistry::RemoveAllUsedRuleIdentifiers( 410 void RulesRegistry::RemoveAllUsedRuleIdentifiers(
372 const std::string& extension_id) { 411 const std::string& extension_id) {
373 used_rule_identifiers_.erase(extension_id); 412 used_rule_identifiers_.erase(extension_id);
374 } 413 }
375 414
376 } // namespace extensions 415 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698