| 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_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 const std::vector<std::string>& rule_identifiers) OVERRIDE; | 87 const std::vector<std::string>& rule_identifiers) OVERRIDE; |
| 88 virtual std::string RemoveAllRulesImpl( | 88 virtual std::string RemoveAllRulesImpl( |
| 89 const std::string& extension_id) OVERRIDE; | 89 const std::string& extension_id) OVERRIDE; |
| 90 virtual content::BrowserThread::ID GetOwnerThread() const OVERRIDE; | 90 virtual content::BrowserThread::ID GetOwnerThread() const OVERRIDE; |
| 91 | 91 |
| 92 // Returns true if this object retains no allocated data. Only for debugging. | 92 // Returns true if this object retains no allocated data. Only for debugging. |
| 93 bool IsEmpty() const; | 93 bool IsEmpty() const; |
| 94 | 94 |
| 95 protected: | 95 protected: |
| 96 virtual ~WebRequestRulesRegistry(); | 96 virtual ~WebRequestRulesRegistry(); |
| 97 |
| 98 // Virtual for testing: |
| 97 virtual base::Time GetExtensionInstallationTime( | 99 virtual base::Time GetExtensionInstallationTime( |
| 98 const std::string& extension_id) const; | 100 const std::string& extension_id) const; |
| 101 virtual void ClearCacheOnNavigation(); |
| 99 | 102 |
| 100 private: | 103 private: |
| 101 typedef std::map<URLMatcherConditionSet::ID, WebRequestRule*> RuleTriggers; | 104 typedef std::map<URLMatcherConditionSet::ID, WebRequestRule*> RuleTriggers; |
| 102 typedef std::map<WebRequestRule::GlobalRuleId, linked_ptr<WebRequestRule> > | 105 typedef std::map<WebRequestRule::GlobalRuleId, linked_ptr<WebRequestRule> > |
| 103 RulesMap; | 106 RulesMap; |
| 104 | 107 |
| 105 // Map that tells us which WebRequestRule may match under the condition that | 108 // Map that tells us which WebRequestRule may match under the condition that |
| 106 // the URLMatcherConditionSet::ID was returned by the |url_matcher_|. | 109 // the URLMatcherConditionSet::ID was returned by the |url_matcher_|. |
| 107 RuleTriggers rule_triggers_; | 110 RuleTriggers rule_triggers_; |
| 108 | 111 |
| 109 RulesMap webrequest_rules_; | 112 RulesMap webrequest_rules_; |
| 110 | 113 |
| 111 URLMatcher url_matcher_; | 114 URLMatcher url_matcher_; |
| 112 | 115 |
| 113 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 116 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 114 }; | 117 }; |
| 115 | 118 |
| 116 } // namespace extensions | 119 } // namespace extensions |
| 117 | 120 |
| 118 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ | 121 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ |
| OLD | NEW |