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

Unified Diff: components/url_matcher/url_matcher.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: components/url_matcher/url_matcher.cc
diff --git a/components/url_matcher/url_matcher.cc b/components/url_matcher/url_matcher.cc
index 41d8c7b13c328ea47a63010063ee818218b36346..103a129880211e97ef11fcbf975b23e278b1c740 100644
--- a/components/url_matcher/url_matcher.cc
+++ b/components/url_matcher/url_matcher.cc
@@ -233,8 +233,8 @@ bool URLMatcherCondition::IsMatch(
return url.host().find(string_pattern_->pattern()) !=
std::string::npos;
case PATH_CONTAINS:
- return url.path().find(string_pattern_->pattern()) !=
- std::string::npos;
+ return url.path().as_string().find(string_pattern_->pattern()) !=
+ std::string::npos;
case QUERY_CONTAINS:
return url.query().find(string_pattern_->pattern()) !=
std::string::npos;
@@ -268,7 +268,7 @@ URLMatcherConditionFactory::~URLMatcherConditionFactory() {
std::string URLMatcherConditionFactory::CanonicalizeURLForComponentSearches(
const GURL& url) const {
return kBeginningOfURL + CanonicalizeHostname(url.host()) + kEndOfDomain +
- url.path() + kEndOfPath +
+ url.path().as_string() + kEndOfPath +
(url.has_query() ? CanonicalizeQuery(url.query(), true, true)
: std::string()) +
kEndOfURL;

Powered by Google App Engine
This is Rietveld 408576698