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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // http://crbug.com/155671 | 72 // http://crbug.com/155671 |
73 // | 73 // |
74 // ICU can accept "en-US" or "en_US", but POSIX wants "en_US". | 74 // ICU can accept "en-US" or "en_US", but POSIX wants "en_US". |
75 std::replace(locale.begin(), locale.end(), '-', '_'); | 75 std::replace(locale.begin(), locale.end(), '-', '_'); |
76 locale.append(".UTF-8"); | 76 locale.append(".UTF-8"); |
77 setlocale(LC_ALL, locale.c_str()); | 77 setlocale(LC_ALL, locale.c_str()); |
78 setenv("LANG", locale.c_str(), 0); | 78 setenv("LANG", locale.c_str(), 0); |
79 #endif | 79 #endif |
80 } | 80 } |
81 | 81 |
82 MessageLoop main_message_loop; | 82 base::MessageLoop main_message_loop; |
83 base::PlatformThread::SetName("CrPPAPIMain"); | 83 base::PlatformThread::SetName("CrPPAPIMain"); |
84 | 84 |
85 #if defined(OS_LINUX) && defined(USE_NSS) | 85 #if defined(OS_LINUX) && defined(USE_NSS) |
86 // Some out-of-process PPAPI plugins use NSS. | 86 // Some out-of-process PPAPI plugins use NSS. |
87 // NSS must be initialized before enabling the sandbox below. | 87 // NSS must be initialized before enabling the sandbox below. |
88 crypto::InitNSSSafely(); | 88 crypto::InitNSSSafely(); |
89 #endif | 89 #endif |
90 | 90 |
91 // Allow the embedder to perform any necessary per-process initialization | 91 // Allow the embedder to perform any necessary per-process initialization |
92 // before the sandbox is initialized. | 92 // before the sandbox is initialized. |
93 if (GetContentClient()->plugin()) | 93 if (GetContentClient()->plugin()) |
94 GetContentClient()->plugin()->PreSandboxInitialization(); | 94 GetContentClient()->plugin()->PreSandboxInitialization(); |
95 | 95 |
96 #if defined(OS_LINUX) | 96 #if defined(OS_LINUX) |
97 LinuxSandbox::InitializeSandbox(); | 97 LinuxSandbox::InitializeSandbox(); |
98 #endif | 98 #endif |
99 | 99 |
100 ChildProcess ppapi_process; | 100 ChildProcess ppapi_process; |
101 ppapi_process.set_main_thread( | 101 ppapi_process.set_main_thread( |
102 new PpapiThread(parameters.command_line, false)); // Not a broker. | 102 new PpapiThread(parameters.command_line, false)); // Not a broker. |
103 | 103 |
104 main_message_loop.Run(); | 104 main_message_loop.Run(); |
105 return 0; | 105 return 0; |
106 } | 106 } |
107 | 107 |
108 } // namespace content | 108 } // namespace content |
OLD | NEW |