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

Unified Diff: content/common/service_worker/service_worker_utils.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
« no previous file with comments | « content/common/plugin_list.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/service_worker/service_worker_utils.cc
diff --git a/content/common/service_worker/service_worker_utils.cc b/content/common/service_worker/service_worker_utils.cc
index 9abc85887f4f96efa7262190628d00748468f5a1..ccf39273a06169343032a82ee707c4706b0592c4 100644
--- a/content/common/service_worker/service_worker_utils.cc
+++ b/content/common/service_worker/service_worker_utils.cc
@@ -16,7 +16,7 @@ namespace content {
namespace {
bool PathContainsDisallowedCharacter(const GURL& url) {
- std::string path = url.path();
+ base::StringPiece path = url.path();
DCHECK(base::IsStringUTF8(path));
// We should avoid these escaped characters in the path component because
@@ -65,16 +65,16 @@ bool ServiceWorkerUtils::IsPathRestrictionSatisfied(
error_message->append("') was received when fetching the script.");
return false;
}
- max_scope_string = max_scope.path();
+ max_scope_string = max_scope.path().as_string();
} else {
- max_scope_string = script_url.Resolve(".").path();
+ max_scope_string = script_url.Resolve(".").path().as_string();
}
- std::string scope_string = scope.path();
+ base::StringPiece scope_string = scope.path();
if (!base::StartsWith(scope_string, max_scope_string,
base::CompareCase::SENSITIVE)) {
*error_message = "The path of the provided scope ('";
- error_message->append(scope_string);
+ error_message->append(scope_string.as_string());
error_message->append("') is not under the max scope allowed (");
if (service_worker_allowed_header_value)
error_message->append("set by Service-Worker-Allowed: ");
« no previous file with comments | « content/common/plugin_list.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698