| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // We don't have/need a PID since handle sharing happens outside of the | 107 // We don't have/need a PID since handle sharing happens outside of the |
| 108 // NaCl sandbox. | 108 // NaCl sandbox. |
| 109 InitWithChannel(this, base::kNullProcessId, channel_handle, | 109 InitWithChannel(this, base::kNullProcessId, channel_handle, |
| 110 false); // Channel is server. | 110 false); // Channel is server. |
| 111 channel()->AddFilter(new tracing::ChildTraceMessageFilter(message_loop_)); | 111 channel()->AddFilter( |
| 112 new tracing::ChildTraceMessageFilter(message_loop_.get())); |
| 112 } | 113 } |
| 113 | 114 |
| 114 base::MessageLoopProxy* PpapiDispatcher::GetIPCMessageLoop() { | 115 base::MessageLoopProxy* PpapiDispatcher::GetIPCMessageLoop() { |
| 115 return message_loop_.get(); | 116 return message_loop_.get(); |
| 116 } | 117 } |
| 117 | 118 |
| 118 base::WaitableEvent* PpapiDispatcher::GetShutdownEvent() { | 119 base::WaitableEvent* PpapiDispatcher::GetShutdownEvent() { |
| 119 return &shutdown_event_; | 120 return &shutdown_event_; |
| 120 } | 121 } |
| 121 | 122 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 289 |
| 289 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy()); | 290 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy()); |
| 290 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); | 291 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); |
| 291 | 292 |
| 292 loop.Run(); | 293 loop.Run(); |
| 293 | 294 |
| 294 NaClSrpcModuleFini(); | 295 NaClSrpcModuleFini(); |
| 295 | 296 |
| 296 return 0; | 297 return 0; |
| 297 } | 298 } |
| OLD | NEW |