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

Unified Diff: content/child/webfileutilities_impl.cc

Issue 1686263008: Add utility method for WebString to base::FilePath conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase! Created 4 years, 10 months 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 | « content/child/webblobregistry_impl.cc ('k') | content/renderer/drop_data_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webfileutilities_impl.cc
diff --git a/content/child/webfileutilities_impl.cc b/content/child/webfileutilities_impl.cc
index 72ddc73d9d6d7ae808dc1b7bb530f3c3fb00483e..268ed0910607d3ca5f21787238c13ab5ee7b0e8f 100644
--- a/content/child/webfileutilities_impl.cc
+++ b/content/child/webfileutilities_impl.cc
@@ -10,6 +10,7 @@
#include "content/child/file_info_util.h"
#include "net/base/file_stream.h"
#include "net/base/filename_util.h"
+#include "third_party/WebKit/public/platform/FilePathConversion.h"
#include "third_party/WebKit/public/platform/WebFileInfo.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h"
@@ -32,7 +33,7 @@ bool WebFileUtilitiesImpl::getFileInfo(const WebString& path,
return false;
}
base::File::Info file_info;
- if (!base::GetFileInfo(base::FilePath::FromUTF16Unsafe(path),
+ if (!base::GetFileInfo(blink::WebStringToFilePath(path),
reinterpret_cast<base::File::Info*>(&file_info)))
return false;
@@ -42,15 +43,15 @@ bool WebFileUtilitiesImpl::getFileInfo(const WebString& path,
}
WebString WebFileUtilitiesImpl::directoryName(const WebString& path) {
- return base::FilePath::FromUTF16Unsafe(path).DirName().AsUTF16Unsafe();
+ return blink::WebStringToFilePath(path).DirName().AsUTF16Unsafe();
}
WebString WebFileUtilitiesImpl::baseName(const WebString& path) {
- return base::FilePath::FromUTF16Unsafe(path).BaseName().AsUTF16Unsafe();
+ return blink::WebStringToFilePath(path).BaseName().AsUTF16Unsafe();
}
blink::WebURL WebFileUtilitiesImpl::filePathToURL(const WebString& path) {
- return net::FilePathToFileURL(base::FilePath::FromUTF16Unsafe(path));
+ return net::FilePathToFileURL(blink::WebStringToFilePath(path));
}
} // namespace content
« no previous file with comments | « content/child/webblobregistry_impl.cc ('k') | content/renderer/drop_data_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698