| 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 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_
registry.h" | 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_
registry.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit
ion.h" | 7 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit
ion.h" |
| 8 #include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h" | 8 #include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h" |
| 9 #include "net/url_request/url_request.h" | 9 #include "net/url_request/url_request.h" |
| 10 | 10 |
| 11 namespace extensions { | 11 namespace extensions { |
| 12 | 12 |
| 13 WebRequestRulesRegistry::WebRequestRulesRegistry() {} | 13 WebRequestRulesRegistry::WebRequestRulesRegistry() {} |
| 14 | 14 |
| 15 WebRequestRulesRegistry::~WebRequestRulesRegistry() {} | |
| 16 | |
| 17 std::set<WebRequestRule::GlobalRuleId> | 15 std::set<WebRequestRule::GlobalRuleId> |
| 18 WebRequestRulesRegistry::GetMatches(net::URLRequest* request, | 16 WebRequestRulesRegistry::GetMatches(net::URLRequest* request, |
| 19 RequestStages request_stage) { | 17 RequestStages request_stage) { |
| 20 std::set<WebRequestRule::GlobalRuleId> result; | 18 std::set<WebRequestRule::GlobalRuleId> result; |
| 21 | 19 |
| 22 // Figure out for which rules the URL match conditions were fulfilled. | 20 // Figure out for which rules the URL match conditions were fulfilled. |
| 23 typedef std::set<URLMatcherConditionSet::ID> URLMatches; | 21 typedef std::set<URLMatcherConditionSet::ID> URLMatches; |
| 24 URLMatches url_matches = url_matcher_.MatchURL(request->url()); | 22 URLMatches url_matches = url_matcher_.MatchURL(request->url()); |
| 25 | 23 |
| 26 // Then we need to check for each of these, whether the other | 24 // Then we need to check for each of these, whether the other |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 166 |
| 169 content::BrowserThread::ID WebRequestRulesRegistry::GetOwnerThread() const { | 167 content::BrowserThread::ID WebRequestRulesRegistry::GetOwnerThread() const { |
| 170 return content::BrowserThread::IO; | 168 return content::BrowserThread::IO; |
| 171 } | 169 } |
| 172 | 170 |
| 173 bool WebRequestRulesRegistry::IsEmpty() const { | 171 bool WebRequestRulesRegistry::IsEmpty() const { |
| 174 return rule_triggers_.empty() && webrequest_rules_.empty() && | 172 return rule_triggers_.empty() && webrequest_rules_.empty() && |
| 175 url_matcher_.IsEmpty(); | 173 url_matcher_.IsEmpty(); |
| 176 } | 174 } |
| 177 | 175 |
| 176 WebRequestRulesRegistry::~WebRequestRulesRegistry() {} |
| 177 |
| 178 } // namespace extensions | 178 } // namespace extensions |
| OLD | NEW |