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

Unified Diff: google_apis/gaia/fake_gaia.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 | « google_apis/drive/test_util.cc ('k') | ios/net/cookies/cookie_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/fake_gaia.cc
diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc
index ce62f1f1703db8c5dd91fcf770e6483c8d8a787e..d4e3cd9af11d2a3b5e639e8613bd550ab3a26659 100644
--- a/google_apis/gaia/fake_gaia.cc
+++ b/google_apis/gaia/fake_gaia.cc
@@ -31,8 +31,9 @@
#include "url/third_party/mozilla/url_parse.h"
#define REGISTER_RESPONSE_HANDLER(url, method) \
- request_handlers_.insert(std::make_pair( \
- url.path(), base::Bind(&FakeGaia::method, base::Unretained(this))))
+ request_handlers_.insert( \
+ std::make_pair(url.path().as_string(), \
+ base::Bind(&FakeGaia::method, base::Unretained(this))))
#define REGISTER_PATH_RESPONSE_HANDLER(path, method) \
request_handlers_.insert(std::make_pair( \
@@ -305,9 +306,10 @@ std::unique_ptr<HttpResponse> FakeGaia::HandleRequest(
// The scheme and host of the URL is actually not important but required to
// get a valid GURL in order to parse |request.relative_url|.
GURL request_url = GURL("http://localhost").Resolve(request.relative_url);
- std::string request_path = request_url.path();
+ base::StringPiece request_path = request_url.path();
std::unique_ptr<BasicHttpResponse> http_response(new BasicHttpResponse());
- RequestHandlerMap::iterator iter = request_handlers_.find(request_path);
+ RequestHandlerMap::iterator iter =
+ request_handlers_.find(request_path.as_string());
if (iter != request_handlers_.end()) {
LOG(WARNING) << "Serving request " << request_path;
iter->second.Run(request, http_response.get());
« no previous file with comments | « google_apis/drive/test_util.cc ('k') | ios/net/cookies/cookie_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698