| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ppapi/nacl_irt/plugin_main.h" | 5 #include "ppapi/nacl_irt/plugin_main.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 // Need to include this before most other files because it defines | 8 // Need to include this before most other files because it defines |
| 9 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define | 9 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define |
| 10 // IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the | 10 // IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the |
| 11 // ViewMsgLog et al. functions. | 11 // ViewMsgLog et al. functions. |
| 12 | 12 |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "ipc/ipc_logging.h" | 15 #include "ipc/ipc_logging.h" |
| 16 #include "ppapi/nacl_irt/plugin_startup.h" | 16 #include "ppapi/nacl_irt/plugin_startup.h" |
| 17 #include "ppapi/nacl_irt/ppapi_dispatcher.h" | 17 #include "ppapi/nacl_irt/ppapi_dispatcher.h" |
| 18 #include "ppapi/proxy/plugin_globals.h" | 18 #include "ppapi/proxy/plugin_globals.h" |
| 19 #include "ppapi/shared_impl/ppb_audio_shared.h" | 19 #include "ppapi/shared_impl/ppb_audio_shared.h" |
| 20 | 20 |
| 21 #if defined(__native_client__) | 21 #if defined(__native_client__) |
| 22 #include "native_client/src/shared/srpc/nacl_srpc.h" | 22 #include "native_client/src/shared/srpc/nacl_srpc.h" |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 void PpapiPluginRegisterThreadCreator( | 25 void PpapiPluginRegisterThreadCreator( |
| 26 const struct PP_ThreadFunctions* thread_functions) { | 26 const struct PP_ThreadFunctions* thread_functions) { |
| 27 #if defined(__native_client__) | |
| 28 // TODO(hidehiko): The thread creation for the PPB_Audio is not yet | |
| 29 // implemented on non-SFI mode. Support this. Now, this function invocation | |
| 30 // is just ignored. | |
| 31 | |
| 32 // Initialize all classes that need to create threads that call back into | 27 // Initialize all classes that need to create threads that call back into |
| 33 // user code. | 28 // user code. |
| 34 ppapi::PPB_Audio_Shared::SetThreadFunctions(thread_functions); | 29 ppapi::PPB_Audio_Shared::SetThreadFunctions(thread_functions); |
| 35 #endif | |
| 36 } | 30 } |
| 37 | 31 |
| 38 int PpapiPluginMain() { | 32 int PpapiPluginMain() { |
| 39 base::MessageLoop loop; | 33 base::MessageLoop loop; |
| 40 ppapi::proxy::PluginGlobals plugin_globals; | 34 ppapi::proxy::PluginGlobals plugin_globals; |
| 41 | 35 |
| 42 #if defined(__native_client__) | 36 #if defined(__native_client__) |
| 43 // Currently on non-SFI mode, we don't use SRPC server on plugin. | 37 // Currently on non-SFI mode, we don't use SRPC server on plugin. |
| 44 // TODO(hidehiko): Make sure this SRPC is actually used on SFI-mode. | 38 // TODO(hidehiko): Make sure this SRPC is actually used on SFI-mode. |
| 45 | 39 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 57 ppapi::GetIOThread()->message_loop_proxy(), | 51 ppapi::GetIOThread()->message_loop_proxy(), |
| 58 ppapi::GetShutdownEvent(), | 52 ppapi::GetShutdownEvent(), |
| 59 ppapi::GetBrowserIPCFileDescriptor(), | 53 ppapi::GetBrowserIPCFileDescriptor(), |
| 60 ppapi::GetRendererIPCFileDescriptor()); | 54 ppapi::GetRendererIPCFileDescriptor()); |
| 61 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); | 55 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); |
| 62 | 56 |
| 63 loop.Run(); | 57 loop.Run(); |
| 64 | 58 |
| 65 return 0; | 59 return 0; |
| 66 } | 60 } |
| OLD | NEW |