| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/proxy/dispatcher.h" | 5 #include "ppapi/proxy/dispatcher.h" |
| 6 | 6 |
| 7 #include <string.h> // For memset. | 7 #include <string.h> // For memset. |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 Dispatcher::~Dispatcher() { | 67 Dispatcher::~Dispatcher() { |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool Dispatcher::InitWithChannel(MessageLoop* ipc_message_loop, | 70 bool Dispatcher::InitWithChannel(MessageLoop* ipc_message_loop, |
| 71 const std::string& channel_name, | 71 const std::string& channel_name, |
| 72 bool is_client, | 72 bool is_client, |
| 73 base::WaitableEvent* shutdown_event) { | 73 base::WaitableEvent* shutdown_event) { |
| 74 IPC::Channel::Mode mode = is_client ? IPC::Channel::MODE_CLIENT | 74 IPC::Channel::Mode mode = is_client ? IPC::Channel::MODE_CLIENT |
| 75 : IPC::Channel::MODE_SERVER; | 75 : IPC::Channel::MODE_SERVER; |
| 76 channel_.reset(new IPC::SyncChannel(channel_name, mode, this, NULL, | 76 channel_.reset(new IPC::SyncChannel(channel_name, mode, this, |
| 77 ipc_message_loop, false, shutdown_event)); | 77 ipc_message_loop, false, shutdown_event)); |
| 78 return true; | 78 return true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 void Dispatcher::OnMessageReceived(const IPC::Message& msg) { | 81 void Dispatcher::OnMessageReceived(const IPC::Message& msg) { |
| 82 // Control messages. | 82 // Control messages. |
| 83 if (msg.routing_id() == MSG_ROUTING_CONTROL) { | 83 if (msg.routing_id() == MSG_ROUTING_CONTROL) { |
| 84 IPC_BEGIN_MESSAGE_MAP(Dispatcher, msg) | 84 IPC_BEGIN_MESSAGE_MAP(Dispatcher, msg) |
| 85 IPC_MESSAGE_HANDLER(PpapiMsg_DeclareInterfaces, | 85 IPC_MESSAGE_HANDLER(PpapiMsg_DeclareInterfaces, |
| 86 OnMsgDeclareInterfaces) | 86 OnMsgDeclareInterfaces) |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 return new PPB_Var_Deprecated_Proxy(this, interface_functions); | 248 return new PPB_Var_Deprecated_Proxy(this, interface_functions); |
| 249 if (interface_name == PPP_INSTANCE_INTERFACE) | 249 if (interface_name == PPP_INSTANCE_INTERFACE) |
| 250 return new PPP_Instance_Proxy(this, interface_functions); | 250 return new PPP_Instance_Proxy(this, interface_functions); |
| 251 | 251 |
| 252 return NULL; | 252 return NULL; |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace proxy | 255 } // namespace proxy |
| 256 } // namespace pp | 256 } // namespace pp |
| 257 | 257 |
| OLD | NEW |