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

Unified Diff: content/renderer/render_view_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: 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
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index dc176876650a155d6f13fea9fa24958b43c2b4b1..5af2c47439d225f932b25ca475f351f9f6d30485 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -111,6 +111,7 @@
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/http/http_util.h"
#include "skia/ext/platform_canvas.h"
+#include "third_party/WebKit/public/platform/FilePathConversion.h"
#include "third_party/WebKit/public/platform/URLConversion.h"
#include "third_party/WebKit/public/platform/WebCString.h"
#include "third_party/WebKit/public/platform/WebConnectionType.h"
@@ -1742,7 +1743,7 @@ bool RenderViewImpl::enumerateChosenDirectory(
int id = enumeration_completion_id_++;
enumeration_completions_[id] = chooser_completion;
return Send(new ViewHostMsg_EnumerateDirectory(
- routing_id(), id, base::FilePath::FromUTF16Unsafe(path)));
+ routing_id(), id, blink::WebStringToFilePath(path)));
}
void RenderViewImpl::FrameDidStartLoading(WebFrame* frame) {
@@ -1822,7 +1823,7 @@ bool RenderViewImpl::runFileChooser(
ipc_params.mode = FileChooserParams::Open;
ipc_params.title = params.title;
ipc_params.default_file_name =
- base::FilePath::FromUTF16Unsafe(params.initialValue).BaseName();
+ blink::WebStringToFilePath(params.initialValue).BaseName();
ipc_params.accept_types.reserve(params.acceptTypes.size());
for (size_t i = 0; i < params.acceptTypes.size(); ++i)
ipc_params.accept_types.push_back(params.acceptTypes[i]);

Powered by Google App Engine
This is Rietveld 408576698