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

Unified Diff: chrome/browser/search/iframe_source.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: chrome/browser/search/iframe_source.cc
diff --git a/chrome/browser/search/iframe_source.cc b/chrome/browser/search/iframe_source.cc
index 925c97ed2c84107cfccc2c2ce7f9cf48c03f2730..b3682b8c1ff607b3b077ef0cfdf0f15b8d9950fe 100644
--- a/chrome/browser/search/iframe_source.cc
+++ b/chrome/browser/search/iframe_source.cc
@@ -24,7 +24,8 @@ IframeSource::~IframeSource() {
std::string IframeSource::GetMimeType(
const std::string& path_and_query) const {
- std::string path(GURL("chrome-search://host/" + path_and_query).path());
+ GURL url(GURL("chrome-search://host/" + path_and_query));
+ base::StringPiece path = url.path();
if (base::EndsWith(path, ".js", base::CompareCase::INSENSITIVE_ASCII))
return "application/javascript";
if (base::EndsWith(path, ".png", base::CompareCase::INSENSITIVE_ASCII))
@@ -38,7 +39,7 @@ std::string IframeSource::GetMimeType(
bool IframeSource::ShouldServiceRequest(
const net::URLRequest* request) const {
- const std::string& path = request->url().path();
+ const std::string& path = request->url().path().as_string();
return InstantIOContext::ShouldServiceRequest(request) &&
request->url().SchemeIs(chrome::kChromeSearchScheme) &&
request->url().host_piece() == GetSource() && ServesPath(path);
« no previous file with comments | « chrome/browser/profiles/profile_avatar_icon_util.cc ('k') | chrome/browser/search/most_visited_iframe_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698