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

Unified Diff: net/base/filename_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 | « ios/web/webui/crw_web_ui_manager_unittest.mm ('k') | net/base/mac/url_conversions.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/filename_util.cc
diff --git a/net/base/filename_util.cc b/net/base/filename_util.cc
index 1e1d51c0e247709b479a2c44095c7ac117bd4176..519255f4e1196ef746d9de8abcd713e851e5a7f8 100644
--- a/net/base/filename_util.cc
+++ b/net/base/filename_util.cc
@@ -73,7 +73,7 @@ bool FileURLToFilePath(const GURL& url, base::FilePath* file_path) {
// URL contains no host, the path is the filename. In this case, the path
// will probably be preceeded with a slash, as in "/C:/foo.txt", so we
// trim out that here.
- path = url.path();
+ path = url.path().as_string();
size_t first_non_slash = path.find_first_not_of("/\\");
if (first_non_slash != std::string::npos && first_non_slash > 0)
path.erase(0, first_non_slash);
@@ -82,7 +82,7 @@ bool FileURLToFilePath(const GURL& url, base::FilePath* file_path) {
// on the path.
path = "\\\\";
path.append(host);
- path.append(url.path());
+ path.append(url.path().as_string());
}
std::replace(path.begin(), path.end(), '/', '\\');
#else // defined(OS_WIN)
@@ -90,7 +90,7 @@ bool FileURLToFilePath(const GURL& url, base::FilePath* file_path) {
// file://foo/bar.txt maps to /bar.txt.
// TODO(dhg): This should probably take into account UNCs which could
// include a hostname other than localhost or blank
- std::string path = url.path();
+ std::string path = url.path().as_string();
#endif // !defined(OS_WIN)
if (path.empty())
« no previous file with comments | « ios/web/webui/crw_web_ui_manager_unittest.mm ('k') | net/base/mac/url_conversions.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698