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 "extensions/common/matcher/url_matcher.h" | 5 #include "extensions/common/matcher/url_matcher.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 URLMatcherConditionFactory::URLMatcherConditionFactory() : id_counter_(0) {} | 249 URLMatcherConditionFactory::URLMatcherConditionFactory() : id_counter_(0) {} |
250 | 250 |
251 URLMatcherConditionFactory::~URLMatcherConditionFactory() { | 251 URLMatcherConditionFactory::~URLMatcherConditionFactory() { |
252 STLDeleteElements(&substring_pattern_singletons_); | 252 STLDeleteElements(&substring_pattern_singletons_); |
253 STLDeleteElements(®ex_pattern_singletons_); | 253 STLDeleteElements(®ex_pattern_singletons_); |
254 } | 254 } |
255 | 255 |
256 std::string URLMatcherConditionFactory::CanonicalizeURLForComponentSearches( | 256 std::string URLMatcherConditionFactory::CanonicalizeURLForComponentSearches( |
257 const GURL& url) const { | 257 const GURL& url) const { |
258 return kBeginningOfURL + CanonicalizeHostname(url.host()) + kEndOfDomain + | 258 return kBeginningOfURL + CanonicalizeHostname(url.host()) + kEndOfDomain + |
259 url.path() + kEndOfPath + (url.has_query() ? "?" + url.query() : "") + | 259 url.path() + kEndOfPath + |
260 kEndOfURL; | 260 (url.has_query() ? "?" + url.query() : std::string()) + kEndOfURL; |
261 } | 261 } |
262 | 262 |
263 URLMatcherCondition URLMatcherConditionFactory::CreateHostPrefixCondition( | 263 URLMatcherCondition URLMatcherConditionFactory::CreateHostPrefixCondition( |
264 const std::string& prefix) { | 264 const std::string& prefix) { |
265 return CreateCondition(URLMatcherCondition::HOST_PREFIX, | 265 return CreateCondition(URLMatcherCondition::HOST_PREFIX, |
266 kBeginningOfURL + CanonicalizeHostname(prefix)); | 266 kBeginningOfURL + CanonicalizeHostname(prefix)); |
267 } | 267 } |
268 | 268 |
269 URLMatcherCondition URLMatcherConditionFactory::CreateHostSuffixCondition( | 269 URLMatcherCondition URLMatcherConditionFactory::CreateHostSuffixCondition( |
270 const std::string& suffix) { | 270 const std::string& suffix) { |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 | 812 |
813 void URLMatcher::UpdateInternalDatastructures() { | 813 void URLMatcher::UpdateInternalDatastructures() { |
814 UpdateSubstringSetMatcher(false); | 814 UpdateSubstringSetMatcher(false); |
815 UpdateSubstringSetMatcher(true); | 815 UpdateSubstringSetMatcher(true); |
816 UpdateRegexSetMatcher(); | 816 UpdateRegexSetMatcher(); |
817 UpdateTriggers(); | 817 UpdateTriggers(); |
818 UpdateConditionFactory(); | 818 UpdateConditionFactory(); |
819 } | 819 } |
820 | 820 |
821 } // namespace extensions | 821 } // namespace extensions |
OLD | NEW |