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 |
11 // IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the | 11 // IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the |
12 // ViewMsgLog et al. functions. | 12 // ViewMsgLog et al. functions. |
13 | 13 |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "content/components/tracing/child_trace_message_filter.h" | 17 #include "components/tracing/child_trace_message_filter.h" |
18 #include "ipc/ipc_channel_handle.h" | 18 #include "ipc/ipc_channel_handle.h" |
19 #include "ipc/ipc_logging.h" | 19 #include "ipc/ipc_logging.h" |
20 #include "ipc/ipc_message.h" | 20 #include "ipc/ipc_message.h" |
21 #include "native_client/src/shared/ppapi_proxy/ppruntime.h" | 21 #include "native_client/src/shared/ppapi_proxy/ppruntime.h" |
22 #include "native_client/src/shared/srpc/nacl_srpc.h" | 22 #include "native_client/src/shared/srpc/nacl_srpc.h" |
23 #include "native_client/src/untrusted/irt/irt_ppapi.h" | 23 #include "native_client/src/untrusted/irt/irt_ppapi.h" |
24 #include "ppapi/c/ppp.h" | 24 #include "ppapi/c/ppp.h" |
25 #include "ppapi/c/ppp_instance.h" | 25 #include "ppapi/c/ppp_instance.h" |
26 #include "ppapi/proxy/plugin_dispatcher.h" | 26 #include "ppapi/proxy/plugin_dispatcher.h" |
27 #include "ppapi/proxy/plugin_globals.h" | 27 #include "ppapi/proxy/plugin_globals.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 }; | 99 }; |
100 | 100 |
101 PpapiDispatcher::PpapiDispatcher(scoped_refptr<base::MessageLoopProxy> io_loop) | 101 PpapiDispatcher::PpapiDispatcher(scoped_refptr<base::MessageLoopProxy> io_loop) |
102 : next_plugin_dispatcher_id_(0), | 102 : next_plugin_dispatcher_id_(0), |
103 message_loop_(io_loop), | 103 message_loop_(io_loop), |
104 shutdown_event_(true, false) { | 104 shutdown_event_(true, false) { |
105 IPC::ChannelHandle channel_handle( | 105 IPC::ChannelHandle channel_handle( |
106 "NaCl IPC", base::FileDescriptor(NACL_IPC_FD, false)); | 106 "NaCl IPC", base::FileDescriptor(NACL_IPC_FD, false)); |
107 InitWithChannel(this, channel_handle, false); // Channel is server. | 107 InitWithChannel(this, channel_handle, false); // Channel is server. |
108 channel()->AddFilter( | 108 channel()->AddFilter( |
109 new content::ChildTraceMessageFilter(message_loop_)); | 109 new components::ChildTraceMessageFilter(message_loop_)); |
110 } | 110 } |
111 | 111 |
112 base::MessageLoopProxy* PpapiDispatcher::GetIPCMessageLoop() { | 112 base::MessageLoopProxy* PpapiDispatcher::GetIPCMessageLoop() { |
113 return message_loop_.get(); | 113 return message_loop_.get(); |
114 } | 114 } |
115 | 115 |
116 base::WaitableEvent* PpapiDispatcher::GetShutdownEvent() { | 116 base::WaitableEvent* PpapiDispatcher::GetShutdownEvent() { |
117 return &shutdown_event_; | 117 return &shutdown_event_; |
118 } | 118 } |
119 | 119 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy()); | 273 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy()); |
274 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); | 274 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); |
275 | 275 |
276 loop.Run(); | 276 loop.Run(); |
277 | 277 |
278 NaClSrpcModuleFini(); | 278 NaClSrpcModuleFini(); |
279 | 279 |
280 return 0; | 280 return 0; |
281 } | 281 } |
OLD | NEW |