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

Side by Side Diff: extensions/common/matcher/url_matcher.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
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/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
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(&regex_pattern_singletons_); 253 STLDeleteElements(&regex_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
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
OLDNEW
« no previous file with comments | « extensions/common/matcher/substring_set_matcher_unittest.cc ('k') | extensions/common/matcher/url_matcher_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698