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

Unified Diff: components/content_settings/core/common/content_settings_pattern.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/content_settings/core/common/content_settings_pattern.cc
diff --git a/components/content_settings/core/common/content_settings_pattern.cc b/components/content_settings/core/common/content_settings_pattern.cc
index c86044ef639783a0e769bf69be8f0cffe5ca2c63..a8d87979e405ca6f5888d852349b57425c758746 100644
--- a/components/content_settings/core/common/content_settings_pattern.cc
+++ b/components/content_settings/core/common/content_settings_pattern.cc
@@ -233,7 +233,7 @@ bool ContentSettingsPattern::Builder::Canonicalize(PatternParts* parts) {
!parts->is_path_wildcard) {
GURL url(std::string(url::kFileScheme) +
std::string(url::kStandardSchemeSeparator) + parts->path);
- parts->path = url.path();
+ parts->path = url.path().as_string();
}
// Canonicalize the host part.
@@ -391,7 +391,8 @@ ContentSettingsPattern ContentSettingsPattern::FromURL(
local_url = url.inner_url();
}
if (local_url->SchemeIsFile()) {
- builder->WithScheme(local_url->scheme())->WithPath(local_url->path());
+ builder->WithScheme(local_url->scheme())
+ ->WithPath(local_url->path().as_string());
} else {
// Please keep the order of the ifs below as URLs with an IP as host can
// also have a "http" scheme.
@@ -429,7 +430,8 @@ ContentSettingsPattern ContentSettingsPattern::FromURLNoWildcard(
local_url = url.inner_url();
}
if (local_url->SchemeIsFile()) {
- builder->WithScheme(local_url->scheme())->WithPath(local_url->path());
+ builder->WithScheme(local_url->scheme())
+ ->WithPath(local_url->path().as_string());
} else {
builder->WithScheme(local_url->scheme())->WithHost(local_url->host());
if (local_url->port().empty()) {
@@ -558,7 +560,7 @@ bool ContentSettingsPattern::Matches(
// inside the filesystem scheme. Investigate and fix.
if (!parts_.is_scheme_wildcard && scheme == url::kFileScheme)
return parts_.is_path_wildcard ||
- parts_.path == std::string(local_url->path());
+ parts_.path == std::string(local_url->path().as_string());
// Match the host part.
const std::string host(net::TrimEndingDot(local_url->host()));
« no previous file with comments | « components/cloud_devices/common/cloud_devices_urls.cc ('k') | components/dom_distiller/core/page_features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698