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

Unified Diff: chrome/browser/profiles/profile_avatar_icon_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 | « chrome/browser/plugins/plugin_info_message_filter.cc ('k') | chrome/browser/search/iframe_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_avatar_icon_util.cc
diff --git a/chrome/browser/profiles/profile_avatar_icon_util.cc b/chrome/browser/profiles/profile_avatar_icon_util.cc
index 146bd75a0882246e186aa4bc6a60d1bfa83fca39..ab7b83d23f91983c022499078b258d6fbd02f0eb 100644
--- a/chrome/browser/profiles/profile_avatar_icon_util.cc
+++ b/chrome/browser/profiles/profile_avatar_icon_util.cc
@@ -514,7 +514,7 @@ bool GetImageURLWithThumbnailSize(
if (components.empty())
return false;
- const std::string& old_path = old_url.path();
+ const base::StringPiece& old_path = old_url.path();
std::string default_size_component(
base::StringPrintf(kThumbnailSizeFormat, kDefaultThumbnailSize));
std::string new_size_component(
@@ -537,8 +537,9 @@ bool GetImageURLWithThumbnailSize(
}
if (pos != std::string::npos) {
- std::string new_path = old_path.substr(0, pos) + new_size_component +
- old_path.substr(end);
+ std::string new_path = old_path.substr(0, pos).as_string() +
+ new_size_component +
+ old_path.substr(end).as_string();
GURL::Replacements replacement;
replacement.SetPathStr(new_path.c_str());
*new_url = old_url.ReplaceComponents(replacement);
« no previous file with comments | « chrome/browser/plugins/plugin_info_message_filter.cc ('k') | chrome/browser/search/iframe_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698