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/ppapi_dispatcher.h" | 5 #include "ppapi/nacl_irt/ppapi_dispatcher.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #if defined(IPC_MESSAGE_LOG_ENABLED) | 56 #if defined(IPC_MESSAGE_LOG_ENABLED) |
57 IPC::Logging::set_log_function_map(&g_log_function_mapping); | 57 IPC::Logging::set_log_function_map(&g_log_function_mapping); |
58 #endif | 58 #endif |
59 | 59 |
60 IPC::ChannelHandle channel_handle( | 60 IPC::ChannelHandle channel_handle( |
61 "NaCl IPC", base::FileDescriptor(browser_ipc_fd, false)); | 61 "NaCl IPC", base::FileDescriptor(browser_ipc_fd, false)); |
62 | 62 |
63 // Delay initializing the SyncChannel until after we add filters. This | 63 // Delay initializing the SyncChannel until after we add filters. This |
64 // ensures that the filters won't miss any messages received by | 64 // ensures that the filters won't miss any messages received by |
65 // the channel. | 65 // the channel. |
66 channel_.reset(new IPC::SyncChannel( | 66 channel_ =IPC::SyncChannel::Create( |
67 this, GetIPCMessageLoop(), GetShutdownEvent())); | 67 this, GetIPCMessageLoop(), GetShutdownEvent()); |
68 channel_->AddFilter(new proxy::PluginMessageFilter( | 68 channel_->AddFilter(new proxy::PluginMessageFilter( |
69 NULL, proxy::PluginGlobals::Get()->resource_reply_thread_registrar())); | 69 NULL, proxy::PluginGlobals::Get()->resource_reply_thread_registrar())); |
70 channel_->AddFilter( | 70 channel_->AddFilter( |
71 new tracing::ChildTraceMessageFilter(message_loop_.get())); | 71 new tracing::ChildTraceMessageFilter(message_loop_.get())); |
72 channel_->Init(channel_handle, IPC::Channel::MODE_SERVER, true); | 72 channel_->InitServer(channel_handle, true); |
73 } | 73 } |
74 | 74 |
75 base::MessageLoopProxy* PpapiDispatcher::GetIPCMessageLoop() { | 75 base::MessageLoopProxy* PpapiDispatcher::GetIPCMessageLoop() { |
76 return message_loop_.get(); | 76 return message_loop_.get(); |
77 } | 77 } |
78 | 78 |
79 base::WaitableEvent* PpapiDispatcher::GetShutdownEvent() { | 79 base::WaitableEvent* PpapiDispatcher::GetShutdownEvent() { |
80 return shutdown_event_; | 80 return shutdown_event_; |
81 } | 81 } |
82 | 82 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 NOTREACHED(); | 217 NOTREACHED(); |
218 return; | 218 return; |
219 } | 219 } |
220 std::map<uint32, proxy::PluginDispatcher*>::iterator dispatcher = | 220 std::map<uint32, proxy::PluginDispatcher*>::iterator dispatcher = |
221 plugin_dispatchers_.find(id); | 221 plugin_dispatchers_.find(id); |
222 if (dispatcher != plugin_dispatchers_.end()) | 222 if (dispatcher != plugin_dispatchers_.end()) |
223 dispatcher->second->OnMessageReceived(msg); | 223 dispatcher->second->OnMessageReceived(msg); |
224 } | 224 } |
225 | 225 |
226 } // namespace ppapi | 226 } // namespace ppapi |
OLD | NEW |