| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/debug/debugger.h" | 6 #include "base/debug/debugger.h" |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 base::i18n::SetICUDefaultLocale(locale); | 59 base::i18n::SetICUDefaultLocale(locale); |
| 60 | 60 |
| 61 #if defined(OS_POSIX) && !defined(OS_ANDROID) | 61 #if defined(OS_POSIX) && !defined(OS_ANDROID) |
| 62 // TODO(shess): Flash appears to have a POSIX locale dependency | 62 // TODO(shess): Flash appears to have a POSIX locale dependency |
| 63 // outside of the existing PPAPI ICU support. Certain games hang | 63 // outside of the existing PPAPI ICU support. Certain games hang |
| 64 // while loading, and it seems related to datetime formatting. | 64 // while loading, and it seems related to datetime formatting. |
| 65 // http://crbug.com/155396 | 65 // http://crbug.com/155396 |
| 66 // http://crbug.com/155671 | 66 // http://crbug.com/155671 |
| 67 // | 67 // |
| 68 // ICU can accept "en-US" or "en_US", but POSIX wants "en_US". | 68 // ICU can accept "en-US" or "en_US", but POSIX wants "en_US". |
| 69 // TODO(shess): "en_US.UTF-8" might be even better. |
| 69 std::replace(locale.begin(), locale.end(), '-', '_'); | 70 std::replace(locale.begin(), locale.end(), '-', '_'); |
| 70 locale.append(".UTF-8"); | |
| 71 setlocale(LC_ALL, locale.c_str()); | 71 setlocale(LC_ALL, locale.c_str()); |
| 72 setenv("LANG", locale.c_str(), 0); | 72 setenv("LANG", locale.c_str(), 0); |
| 73 #endif | 73 #endif |
| 74 } | 74 } |
| 75 | 75 |
| 76 MessageLoop main_message_loop; | 76 MessageLoop main_message_loop; |
| 77 base::PlatformThread::SetName("CrPPAPIMain"); | 77 base::PlatformThread::SetName("CrPPAPIMain"); |
| 78 | 78 |
| 79 #if defined(OS_LINUX) | 79 #if defined(OS_LINUX) |
| 80 content::InitializeSandbox(); | 80 content::InitializeSandbox(); |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 ChildProcess ppapi_process; | 83 ChildProcess ppapi_process; |
| 84 ppapi_process.set_main_thread( | 84 ppapi_process.set_main_thread( |
| 85 new PpapiThread(parameters.command_line, false)); // Not a broker. | 85 new PpapiThread(parameters.command_line, false)); // Not a broker. |
| 86 | 86 |
| 87 main_message_loop.Run(); | 87 main_message_loop.Run(); |
| 88 return 0; | 88 return 0; |
| 89 } | 89 } |
| OLD | NEW |