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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 // Need to include this before most other files because it defines | 9 // Need to include this before most other files because it defines |
10 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define | 10 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 return 0; | 221 return 0; |
222 } | 222 } |
223 if (!NaClSrpcModuleInit()) { | 223 if (!NaClSrpcModuleInit()) { |
224 return 1; | 224 return 1; |
225 } | 225 } |
226 initialized = 1; | 226 initialized = 1; |
227 return 0; | 227 return 0; |
228 } | 228 } |
229 | 229 |
230 int PpapiPluginMain() { | 230 int PpapiPluginMain() { |
231 IrtInit(); | |
dmichael (off chromium)
2012/12/01 14:48:47
I assume you verified that it's okay to call it tw
bbudge
2012/12/01 16:12:39
Yes. It's idempotent.
| |
232 | |
231 // Though it isn't referenced here, we must instantiate an AtExitManager. | 233 // Though it isn't referenced here, we must instantiate an AtExitManager. |
232 base::AtExitManager exit_manager; | 234 base::AtExitManager exit_manager; |
233 MessageLoop loop; | 235 MessageLoop loop; |
234 IPC::Logging::set_log_function_map(&g_log_function_mapping); | 236 IPC::Logging::set_log_function_map(&g_log_function_mapping); |
235 ppapi::proxy::PluginGlobals plugin_globals; | 237 ppapi::proxy::PluginGlobals plugin_globals; |
236 base::Thread io_thread("Chrome_NaClIOThread"); | 238 base::Thread io_thread("Chrome_NaClIOThread"); |
237 base::Thread::Options options; | 239 base::Thread::Options options; |
238 options.message_loop_type = MessageLoop::TYPE_IO; | 240 options.message_loop_type = MessageLoop::TYPE_IO; |
239 io_thread.StartWithOptions(options); | 241 io_thread.StartWithOptions(options); |
240 | 242 |
(...skipping 15 matching lines...) Expand all Loading... | |
256 | 258 |
257 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy()); | 259 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy()); |
258 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); | 260 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); |
259 | 261 |
260 loop.Run(); | 262 loop.Run(); |
261 | 263 |
262 NaClSrpcModuleFini(); | 264 NaClSrpcModuleFini(); |
263 | 265 |
264 return 0; | 266 return 0; |
265 } | 267 } |
OLD | NEW |