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

Unified Diff: extensions/common/file_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 | « extensions/browser/url_request_util.cc ('k') | extensions/common/url_pattern.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/file_util.cc
diff --git a/extensions/common/file_util.cc b/extensions/common/file_util.cc
index 91d49d0319bebb549d36d938d5d3a51782b9eae1..d7b0deed567e2d0812ce7ca4e0cd54c59f360cf1 100644
--- a/extensions/common/file_util.cc
+++ b/extensions/common/file_util.cc
@@ -436,13 +436,13 @@ void DeleteFile(const base::FilePath& path, bool recursive) {
}
base::FilePath ExtensionURLToRelativeFilePath(const GURL& url) {
- std::string url_path = url.path();
+ base::StringPiece url_path = url.path();
if (url_path.empty() || url_path[0] != '/')
return base::FilePath();
// Drop the leading slashes and convert %-encoded UTF8 to regular UTF8.
std::string file_path = net::UnescapeURLComponent(
- url_path,
+ url_path.as_string(),
net::UnescapeRule::SPACES |
net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS);
size_t skip = file_path.find_first_not_of("/\\");
« no previous file with comments | « extensions/browser/url_request_util.cc ('k') | extensions/common/url_pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698