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

Unified Diff: chrome/browser/chrome_content_browser_client.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 | « chrome/browser/browser_about_handler.cc ('k') | chrome/browser/chrome_switches_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 065057e7ea6ccc998d2e63b341e8fd9f2cbf0e31..33f8dc04212bdd2ddc0dce915c31da946fb40887 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -463,16 +463,16 @@ bool RemoveUberHost(GURL* url) {
if (url->path().empty() || url->path() == "/")
return false;
- const std::string old_path = url->path();
+ const base::StringPiece old_path = url->path();
const std::string::size_type separator = old_path.find('/', 1);
std::string new_host;
std::string new_path;
if (separator == std::string::npos) {
- new_host = old_path.substr(1);
+ new_host = old_path.substr(1).as_string();
} else {
- new_host = old_path.substr(1, separator - 1);
- new_path = old_path.substr(separator);
+ new_host = old_path.substr(1, separator - 1).as_string();
+ new_path = old_path.substr(separator).as_string();
}
// Do not allow URLs with paths empty before the first slash since we can't
« no previous file with comments | « chrome/browser/browser_about_handler.cc ('k') | chrome/browser/chrome_switches_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698