| 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 "ppapi/proxy/ppb_udp_socket_private_proxy.h" | 5 #include "ppapi/proxy/ppb_udp_socket_private_proxy.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_SendToACK, | 119 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_SendToACK, |
| 120 OnMsgSendToACK) | 120 OnMsgSendToACK) |
| 121 IPC_MESSAGE_UNHANDLED(handled = false) | 121 IPC_MESSAGE_UNHANDLED(handled = false) |
| 122 IPC_END_MESSAGE_MAP() | 122 IPC_END_MESSAGE_MAP() |
| 123 return handled; | 123 return handled; |
| 124 } | 124 } |
| 125 | 125 |
| 126 void PPB_UDPSocket_Private_Proxy::OnMsgBindACK( | 126 void PPB_UDPSocket_Private_Proxy::OnMsgBindACK( |
| 127 uint32 /* plugin_dispatcher_id */, | 127 uint32 /* plugin_dispatcher_id */, |
| 128 uint32 socket_id, | 128 uint32 socket_id, |
| 129 bool succeeded) { | 129 bool succeeded, |
| 130 const PP_NetAddress_Private& bound_addr) { |
| 130 if (!g_id_to_socket) { | 131 if (!g_id_to_socket) { |
| 131 NOTREACHED(); | 132 NOTREACHED(); |
| 132 return; | 133 return; |
| 133 } | 134 } |
| 134 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id); | 135 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id); |
| 135 if (iter == g_id_to_socket->end()) | 136 if (iter == g_id_to_socket->end()) |
| 136 return; | 137 return; |
| 137 iter->second->OnBindCompleted(succeeded); | 138 iter->second->OnBindCompleted(succeeded, bound_addr); |
| 138 } | 139 } |
| 139 | 140 |
| 140 void PPB_UDPSocket_Private_Proxy::OnMsgRecvFromACK( | 141 void PPB_UDPSocket_Private_Proxy::OnMsgRecvFromACK( |
| 141 uint32 /* plugin_dispatcher_id */, | 142 uint32 /* plugin_dispatcher_id */, |
| 142 uint32 socket_id, | 143 uint32 socket_id, |
| 143 bool succeeded, | 144 bool succeeded, |
| 144 const std::string& data, | 145 const std::string& data, |
| 145 const PP_NetAddress_Private& addr) { | 146 const PP_NetAddress_Private& addr) { |
| 146 if (!g_id_to_socket) { | 147 if (!g_id_to_socket) { |
| 147 NOTREACHED(); | 148 NOTREACHED(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 163 return; | 164 return; |
| 164 } | 165 } |
| 165 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id); | 166 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id); |
| 166 if (iter == g_id_to_socket->end()) | 167 if (iter == g_id_to_socket->end()) |
| 167 return; | 168 return; |
| 168 iter->second->OnSendToCompleted(succeeded, bytes_written); | 169 iter->second->OnSendToCompleted(succeeded, bytes_written); |
| 169 } | 170 } |
| 170 | 171 |
| 171 } // namespace proxy | 172 } // namespace proxy |
| 172 } // namespace ppapi | 173 } // namespace ppapi |
| OLD | NEW |