| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 NEVER_PROCESS, | 189 NEVER_PROCESS, |
| 190 // A task to call ProcessChangedRules is scheduled for future execution. | 190 // A task to call ProcessChangedRules is scheduled for future execution. |
| 191 SCHEDULED_FOR_PROCESSING, | 191 SCHEDULED_FOR_PROCESSING, |
| 192 // No task to call ProcessChangedRules is scheduled yet, but it is possible | 192 // No task to call ProcessChangedRules is scheduled yet, but it is possible |
| 193 // to schedule one. | 193 // to schedule one. |
| 194 NOT_SCHEDULED_FOR_PROCESSING | 194 NOT_SCHEDULED_FOR_PROCESSING |
| 195 }; | 195 }; |
| 196 typedef std::map<ExtensionId, ProcessChangedRulesState> ProcessStateMap; | 196 typedef std::map<ExtensionId, ProcessChangedRulesState> ProcessStateMap; |
| 197 | 197 |
| 198 base::WeakPtr<RulesRegistry> GetWeakPtr() { | 198 base::WeakPtr<RulesRegistry> GetWeakPtr() { |
| 199 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 199 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 200 return weak_ptr_factory_.GetWeakPtr(); | 200 return weak_ptr_factory_.GetWeakPtr(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 // Common processing after extension's rules have changed. | 203 // Common processing after extension's rules have changed. |
| 204 void ProcessChangedRules(const std::string& extension_id); | 204 void ProcessChangedRules(const std::string& extension_id); |
| 205 | 205 |
| 206 // Calls ProcessChangedRules if | 206 // Calls ProcessChangedRules if |
| 207 // |process_changed_rules_requested_(extension_id)| == | 207 // |process_changed_rules_requested_(extension_id)| == |
| 208 // NOT_SCHEDULED_FOR_PROCESSING. | 208 // NOT_SCHEDULED_FOR_PROCESSING. |
| 209 void MaybeProcessChangedRules(const std::string& extension_id); | 209 void MaybeProcessChangedRules(const std::string& extension_id); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 typedef std::map<ExtensionId, std::set<RuleIdentifier> > RuleIdentifiersMap; | 285 typedef std::map<ExtensionId, std::set<RuleIdentifier> > RuleIdentifiersMap; |
| 286 RuleIdentifiersMap used_rule_identifiers_; | 286 RuleIdentifiersMap used_rule_identifiers_; |
| 287 int last_generated_rule_identifier_id_; | 287 int last_generated_rule_identifier_id_; |
| 288 | 288 |
| 289 DISALLOW_COPY_AND_ASSIGN(RulesRegistry); | 289 DISALLOW_COPY_AND_ASSIGN(RulesRegistry); |
| 290 }; | 290 }; |
| 291 | 291 |
| 292 } // namespace extensions | 292 } // namespace extensions |
| 293 | 293 |
| 294 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_H__ | 294 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_H__ |
| OLD | NEW |