| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 NOTIMPLEMENTED(); | 154 NOTIMPLEMENTED(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void PpapiDispatcher::SetActiveURL(const std::string& url) { | 157 void PpapiDispatcher::SetActiveURL(const std::string& url) { |
| 158 NOTIMPLEMENTED(); | 158 NOTIMPLEMENTED(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 bool PpapiDispatcher::OnMessageReceived(const IPC::Message& msg) { | 161 bool PpapiDispatcher::OnMessageReceived(const IPC::Message& msg) { |
| 162 IPC_BEGIN_MESSAGE_MAP(PpapiDispatcher, msg) | 162 IPC_BEGIN_MESSAGE_MAP(PpapiDispatcher, msg) |
| 163 IPC_MESSAGE_HANDLER(PpapiMsg_CreateNaClChannel, OnMsgCreateNaClChannel) | 163 IPC_MESSAGE_HANDLER(PpapiMsg_CreateNaClChannel, OnMsgCreateNaClChannel) |
| 164 | 164 // All other messages are simply forwarded to a PluginDispatcher. |
| 165 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBTCPServerSocket_ListenACK, | 165 IPC_MESSAGE_UNHANDLED(OnPluginDispatcherMessageReceived(msg)) |
| 166 OnPluginDispatcherMessageReceived(msg)) | |
| 167 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBTCPServerSocket_AcceptACK, | |
| 168 OnPluginDispatcherMessageReceived(msg)) | |
| 169 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBTCPSocket_ConnectACK, | |
| 170 OnPluginDispatcherMessageReceived(msg)) | |
| 171 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, | |
| 172 OnPluginDispatcherMessageReceived(msg)) | |
| 173 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBTCPSocket_ReadACK, | |
| 174 OnPluginDispatcherMessageReceived(msg)) | |
| 175 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBTCPSocket_WriteACK, | |
| 176 OnPluginDispatcherMessageReceived(msg)) | |
| 177 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBUDPSocket_RecvFromACK, | |
| 178 OnPluginDispatcherMessageReceived(msg)) | |
| 179 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBUDPSocket_SendToACK, | |
| 180 OnPluginDispatcherMessageReceived(msg)) | |
| 181 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBUDPSocket_BindACK, | |
| 182 OnPluginDispatcherMessageReceived(msg)) | |
| 183 IPC_END_MESSAGE_MAP() | 166 IPC_END_MESSAGE_MAP() |
| 184 return true; | 167 return true; |
| 185 } | 168 } |
| 186 | 169 |
| 187 void PpapiDispatcher::OnMsgCreateNaClChannel( | 170 void PpapiDispatcher::OnMsgCreateNaClChannel( |
| 188 int renderer_id, | 171 int renderer_id, |
| 189 const ppapi::PpapiPermissions& permissions, | 172 const ppapi::PpapiPermissions& permissions, |
| 190 bool incognito, | 173 bool incognito, |
| 191 SerializedHandle handle) { | 174 SerializedHandle handle) { |
| 192 // Tell the process-global GetInterface which interfaces it can return to the | 175 // Tell the process-global GetInterface which interfaces it can return to the |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 253 |
| 271 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy()); | 254 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy()); |
| 272 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); | 255 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); |
| 273 | 256 |
| 274 loop.Run(); | 257 loop.Run(); |
| 275 | 258 |
| 276 NaClSrpcModuleFini(); | 259 NaClSrpcModuleFini(); |
| 277 | 260 |
| 278 return 0; | 261 return 0; |
| 279 } | 262 } |
| OLD | NEW |