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

Unified Diff: third_party/WebKit/Source/platform/exported/FilePathConversion.cpp

Issue 2537953003: WebString: makes string16 conversions explicit (part 1: blink, content) (Closed)
Patch Set: fix Created 4 years 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: third_party/WebKit/Source/platform/exported/FilePathConversion.cpp
diff --git a/third_party/WebKit/Source/platform/exported/FilePathConversion.cpp b/third_party/WebKit/Source/platform/exported/FilePathConversion.cpp
index bd394f38940b8b0dcbbc75bb4983eb4404180b6d..cf4efaeac0ce76de591730ad64b5527998ce6c8f 100644
--- a/third_party/WebKit/Source/platform/exported/FilePathConversion.cpp
+++ b/third_party/WebKit/Source/platform/exported/FilePathConversion.cpp
@@ -31,4 +31,15 @@ base::FilePath WebStringToFilePath(const WebString& webString) {
#endif
}
+WebString FilePathToWebString(const base::FilePath& path) {
+ if (path.empty())
+ return WebString();
+
+#if OS(POSIX)
+ return WebString::fromUTF8(path.value());
+#else
+ return WebString::fromUTF16(path.AsUTF16Unsafe());
+#endif
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698