Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: ppapi/nacl_irt/irt_ppapi.cc

Issue 2033243003: Use Mojo pipes to signal sync IPC events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #include <stdint.h> 11 #include <stdint.h>
12 12
13 #include "base/threading/thread.h" 13 #include "base/threading/thread.h"
14 #include "ipc/ipc_logging.h" 14 #include "ipc/ipc_logging.h"
15 #include "mojo/edk/embedder/embedder.h"
15 #include "ppapi/nacl_irt/irt_interfaces.h" 16 #include "ppapi/nacl_irt/irt_interfaces.h"
16 #include "ppapi/nacl_irt/irt_ppapi.h" 17 #include "ppapi/nacl_irt/irt_ppapi.h"
17 #include "ppapi/nacl_irt/plugin_startup.h" 18 #include "ppapi/nacl_irt/plugin_startup.h"
18 #include "ppapi/nacl_irt/ppapi_dispatcher.h" 19 #include "ppapi/nacl_irt/ppapi_dispatcher.h"
19 #include "ppapi/nacl_irt/public/irt_ppapi.h" 20 #include "ppapi/nacl_irt/public/irt_ppapi.h"
20 #include "ppapi/proxy/plugin_globals.h" 21 #include "ppapi/proxy/plugin_globals.h"
21 #include "ppapi/shared_impl/ppb_audio_shared.h" 22 #include "ppapi/shared_impl/ppb_audio_shared.h"
22 23
23 static struct PP_StartFunctions g_pp_functions; 24 static struct PP_StartFunctions g_pp_functions;
24 25
25 void PpapiPluginRegisterThreadCreator( 26 void PpapiPluginRegisterThreadCreator(
26 const struct PP_ThreadFunctions* thread_functions) { 27 const struct PP_ThreadFunctions* thread_functions) {
27 // Initialize all classes that need to create threads that call back into 28 // Initialize all classes that need to create threads that call back into
28 // user code. 29 // user code.
29 ppapi::PPB_Audio_Shared::SetThreadFunctions(thread_functions); 30 ppapi::PPB_Audio_Shared::SetThreadFunctions(thread_functions);
30 } 31 }
31 32
32 int irt_ppapi_start(const struct PP_StartFunctions* funcs) { 33 int irt_ppapi_start(const struct PP_StartFunctions* funcs) {
33 g_pp_functions = *funcs; 34 g_pp_functions = *funcs;
34 35
36 mojo::edk::Init();
Mark Seaborn 2016/06/14 19:30:21 It looks like you're doing this twice, once here a
Ken Rockot(use gerrit already) 2016/06/14 20:17:03 Oops, removed from here
37
35 base::MessageLoop loop; 38 base::MessageLoop loop;
36 ppapi::proxy::PluginGlobals plugin_globals( 39 ppapi::proxy::PluginGlobals plugin_globals(
37 scoped_refptr<base::TaskRunner>(ppapi::GetIOThread()->task_runner())); 40 scoped_refptr<base::TaskRunner>(ppapi::GetIOThread()->task_runner()));
38 41
39 ppapi::PpapiDispatcher ppapi_dispatcher( 42 ppapi::PpapiDispatcher ppapi_dispatcher(
40 ppapi::GetIOThread()->task_runner(), ppapi::GetShutdownEvent(), 43 ppapi::GetIOThread()->task_runner(), ppapi::GetShutdownEvent(),
41 ppapi::GetBrowserIPCFileDescriptor(), 44 ppapi::GetBrowserIPCFileDescriptor(),
42 ppapi::GetRendererIPCFileDescriptor()); 45 ppapi::GetRendererIPCFileDescriptor());
43 plugin_globals.SetPluginProxyDelegate(&ppapi_dispatcher); 46 plugin_globals.SetPluginProxyDelegate(&ppapi_dispatcher);
44 47
(...skipping 12 matching lines...) Expand all
57 } 60 }
58 61
59 const void* PPP_GetInterface(const char* interface_name) { 62 const void* PPP_GetInterface(const char* interface_name) {
60 return g_pp_functions.PPP_GetInterface(interface_name); 63 return g_pp_functions.PPP_GetInterface(interface_name);
61 } 64 }
62 65
63 const struct nacl_irt_ppapihook nacl_irt_ppapihook = { 66 const struct nacl_irt_ppapihook nacl_irt_ppapihook = {
64 irt_ppapi_start, 67 irt_ppapi_start,
65 PpapiPluginRegisterThreadCreator, 68 PpapiPluginRegisterThreadCreator,
66 }; 69 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698