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

Unified Diff: net/test/embedded_test_server/request_handler_util.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 | « net/test/embedded_test_server/http_request.cc ('k') | net/test/url_request/url_request_mock_http_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/embedded_test_server/request_handler_util.cc
diff --git a/net/test/embedded_test_server/request_handler_util.cc b/net/test/embedded_test_server/request_handler_util.cc
index 8982efb8c0a7645687855e8eff3117f6b3a8fe8a..aa7aabb9934e1127144eb2dbcd4210cafed48155 100644
--- a/net/test/embedded_test_server/request_handler_util.cc
+++ b/net/test/embedded_test_server/request_handler_util.cc
@@ -130,7 +130,7 @@ std::unique_ptr<HttpResponse> HandleFileRequest(
// A proxy request will have an absolute path. Simulate the proxy by stripping
// the scheme, host, and port.
GURL request_url = request.GetURL();
- std::string relative_path(request_url.path());
+ base::StringPiece relative_path(request_url.path());
std::string post_prefix("/post/");
if (base::StartsWith(relative_path, post_prefix,
@@ -167,7 +167,7 @@ std::unique_ptr<HttpResponse> HandleFileRequest(
// Trim the first byte ('/').
DCHECK(base::StartsWith(relative_path, "/", base::CompareCase::SENSITIVE));
- std::string request_path = relative_path.substr(1);
+ base::StringPiece request_path = relative_path.substr(1);
base::FilePath file_path(server_root.AppendASCII(request_path));
std::string file_contents;
if (!base::ReadFileToString(file_path, &file_contents)) {
« no previous file with comments | « net/test/embedded_test_server/http_request.cc ('k') | net/test/url_request/url_request_mock_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698