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

Unified Diff: chrome/plugin/chrome_plugin_host.cc

Issue 6246036: FilePath: Remove most of ToWStringHack, adding a LossyDisplayName() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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: chrome/plugin/chrome_plugin_host.cc
diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc
index 690bf05f18e6805f6e6c8349b8014220ad89772e..bb9fbee7531059cdb7ff005e5e1b1f2d5e7e68bb 100644
--- a/chrome/plugin/chrome_plugin_host.cc
+++ b/chrome/plugin/chrome_plugin_host.cc
@@ -436,8 +436,10 @@ int STDCALL CPB_GetBrowsingContextInfo(
FilePath path = CommandLine::ForCurrentProcess()->
GetSwitchValuePath(switches::kPluginDataDir);
DCHECK(!path.empty());
- std::string retval = WideToUTF8(
- path.Append(chrome::kChromePluginDataDirname).ToWStringHack());
+ // TODO(evan): this is wrong. We can't stuff a path through a UTF-8 string.
+ // But this code is only used by Gears, which will be removed eventually.
+ std::string retval = UTF16ToUTF8(
+ path.Append(chrome::kChromePluginDataDirname).LossyDisplayName());
*static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, retval);
return CPERR_SUCCESS;

Powered by Google App Engine
This is Rietveld 408576698