| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 // Need to include this before most other files because it defines | 6 // Need to include this before most other files because it defines |
| 7 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define | 7 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define |
| 8 // IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the | 8 // IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the |
| 9 // ViewMsgLog et al. functions. | 9 // ViewMsgLog et al. functions. |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 int irt_ppapi_start(const struct PP_StartFunctions* funcs) { | 32 int irt_ppapi_start(const struct PP_StartFunctions* funcs) { |
| 33 g_pp_functions = *funcs; | 33 g_pp_functions = *funcs; |
| 34 | 34 |
| 35 base::MessageLoop loop; | 35 base::MessageLoop loop; |
| 36 ppapi::proxy::PluginGlobals plugin_globals( | 36 ppapi::proxy::PluginGlobals plugin_globals( |
| 37 scoped_refptr<base::TaskRunner>(ppapi::GetIOThread()->task_runner())); | 37 scoped_refptr<base::TaskRunner>(ppapi::GetIOThread()->task_runner())); |
| 38 | 38 |
| 39 ppapi::PpapiDispatcher ppapi_dispatcher( | 39 ppapi::PpapiDispatcher ppapi_dispatcher( |
| 40 ppapi::GetIOThread()->task_runner(), ppapi::GetShutdownEvent(), | 40 ppapi::GetIOThread()->task_runner(), ppapi::GetShutdownEvent(), |
| 41 ppapi::GetBrowserIPCFileDescriptor(), | 41 ppapi::GetBrowserIPCChannelHandle(), |
| 42 ppapi::GetRendererIPCFileDescriptor()); | 42 ppapi::GetRendererIPCChannelHandle()); |
| 43 plugin_globals.SetPluginProxyDelegate(&ppapi_dispatcher); | 43 plugin_globals.SetPluginProxyDelegate(&ppapi_dispatcher); |
| 44 | 44 |
| 45 loop.Run(); | 45 loop.Run(); |
| 46 | 46 |
| 47 return 0; | 47 return 0; |
| 48 } | 48 } |
| 49 | 49 |
| 50 int32_t PPP_InitializeModule(PP_Module module_id, | 50 int32_t PPP_InitializeModule(PP_Module module_id, |
| 51 PPB_GetInterface get_browser_interface) { | 51 PPB_GetInterface get_browser_interface) { |
| 52 return g_pp_functions.PPP_InitializeModule(module_id, get_browser_interface); | 52 return g_pp_functions.PPP_InitializeModule(module_id, get_browser_interface); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void PPP_ShutdownModule(void) { | 55 void PPP_ShutdownModule(void) { |
| 56 g_pp_functions.PPP_ShutdownModule(); | 56 g_pp_functions.PPP_ShutdownModule(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 const void* PPP_GetInterface(const char* interface_name) { | 59 const void* PPP_GetInterface(const char* interface_name) { |
| 60 return g_pp_functions.PPP_GetInterface(interface_name); | 60 return g_pp_functions.PPP_GetInterface(interface_name); |
| 61 } | 61 } |
| 62 | 62 |
| 63 const struct nacl_irt_ppapihook nacl_irt_ppapihook = { | 63 const struct nacl_irt_ppapihook nacl_irt_ppapihook = { |
| 64 irt_ppapi_start, | 64 irt_ppapi_start, |
| 65 PpapiPluginRegisterThreadCreator, | 65 PpapiPluginRegisterThreadCreator, |
| 66 }; | 66 }; |
| OLD | NEW |