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

Unified Diff: content/ppapi_plugin/ppapi_plugin_main.cc

Issue 11116008: Flapper has some additional environment expectations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: not OS_ANDROID Created 8 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/ppapi_plugin_main.cc
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc
index ed6897788717739452b8da4b550fad28bcaea45a..16dc82b54c1407b6f7b0e35b507eeba002148415 100644
--- a/content/ppapi_plugin/ppapi_plugin_main.cc
+++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -23,6 +23,10 @@
#include "content/public/common/sandbox_init.h"
#endif
+#if defined(OS_POSIX) && !defined(OS_ANDROID)
+#include <stdlib.h>
+#endif
+
#if defined(OS_WIN)
sandbox::TargetServices* g_target_services = NULL;
#else
@@ -53,6 +57,20 @@ int PpapiPluginMain(const content::MainFunctionParams& parameters) {
if (command_line.HasSwitch(switches::kLang)) {
std::string locale = command_line.GetSwitchValueASCII(switches::kLang);
base::i18n::SetICUDefaultLocale(locale);
+
+#if defined(OS_POSIX) && !defined(OS_ANDROID)
+ // TODO(shess): Flash appears to have a POSIX locale dependency
+ // outside of the existing PPAPI ICU support. Certain games hang
+ // while loading, and it seems related to datetime formatting.
+ // http://crbug.com/155396
+ // http://crbug.com/155671
+ //
+ // ICU can accept "en-US" or "en_US", but POSIX wants "en_US".
+ // TODO(shess): "en_US.UTF-8" might be even better.
+ std::replace(locale.begin(), locale.end(), '-', '_');
+ setlocale(LC_ALL, locale.c_str());
+ setenv("LANG", locale.c_str(), 0);
+#endif
}
MessageLoop main_message_loop;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698