| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/ppapi_plugin/ppapi_thread.h" | 5 #include "content/ppapi_plugin/ppapi_thread.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // | 67 // |
| 68 // Note that this function is called only for messages from the channel to the | 68 // Note that this function is called only for messages from the channel to the |
| 69 // browser process. Messages from the renderer process are sent via a different | 69 // browser process. Messages from the renderer process are sent via a different |
| 70 // channel that ends up at Dispatcher::OnMessageReceived. | 70 // channel that ends up at Dispatcher::OnMessageReceived. |
| 71 bool PpapiThread::OnMessageReceived(const IPC::Message& msg) { | 71 bool PpapiThread::OnMessageReceived(const IPC::Message& msg) { |
| 72 IPC_BEGIN_MESSAGE_MAP(PpapiThread, msg) | 72 IPC_BEGIN_MESSAGE_MAP(PpapiThread, msg) |
| 73 IPC_MESSAGE_HANDLER(PpapiMsg_LoadPlugin, OnMsgLoadPlugin) | 73 IPC_MESSAGE_HANDLER(PpapiMsg_LoadPlugin, OnMsgLoadPlugin) |
| 74 IPC_MESSAGE_HANDLER(PpapiMsg_CreateChannel, OnMsgCreateChannel) | 74 IPC_MESSAGE_HANDLER(PpapiMsg_CreateChannel, OnMsgCreateChannel) |
| 75 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBFlashTCPSocket_ConnectACK, | 75 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBFlashTCPSocket_ConnectACK, |
| 76 OnPluginDispatcherMessageReceived(msg)) | 76 OnPluginDispatcherMessageReceived(msg)) |
| 77 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBFlashTCPSocket_InitiateSSLACK, |
| 78 OnPluginDispatcherMessageReceived(msg)) |
| 77 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBFlashTCPSocket_ReadACK, | 79 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBFlashTCPSocket_ReadACK, |
| 78 OnPluginDispatcherMessageReceived(msg)) | 80 OnPluginDispatcherMessageReceived(msg)) |
| 79 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBFlashTCPSocket_WriteACK, | 81 IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBFlashTCPSocket_WriteACK, |
| 80 OnPluginDispatcherMessageReceived(msg)) | 82 OnPluginDispatcherMessageReceived(msg)) |
| 81 IPC_MESSAGE_HANDLER(PpapiMsg_SetNetworkState, OnMsgSetNetworkState) | 83 IPC_MESSAGE_HANDLER(PpapiMsg_SetNetworkState, OnMsgSetNetworkState) |
| 82 IPC_END_MESSAGE_MAP() | 84 IPC_END_MESSAGE_MAP() |
| 83 return true; | 85 return true; |
| 84 } | 86 } |
| 85 | 87 |
| 86 base::MessageLoopProxy* PpapiThread::GetIPCMessageLoop() { | 88 base::MessageLoopProxy* PpapiThread::GetIPCMessageLoop() { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 #if defined(OS_POSIX) | 284 #if defined(OS_POSIX) |
| 283 // On POSIX, pass the renderer-side FD. | 285 // On POSIX, pass the renderer-side FD. |
| 284 handle->socket = base::FileDescriptor(::dup(dispatcher->GetRendererFD()), | 286 handle->socket = base::FileDescriptor(::dup(dispatcher->GetRendererFD()), |
| 285 true); | 287 true); |
| 286 #endif | 288 #endif |
| 287 | 289 |
| 288 // From here, the dispatcher will manage its own lifetime according to the | 290 // From here, the dispatcher will manage its own lifetime according to the |
| 289 // lifetime of the attached channel. | 291 // lifetime of the attached channel. |
| 290 return true; | 292 return true; |
| 291 } | 293 } |
| OLD | NEW |