Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: ppapi/proxy/ppb_udp_socket_private_proxy.cc

Issue 9212047: Add GetBoundAddress to PPB_UDPSocket_Private (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: add backward compatability to interface, fix other review comments Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_SendToACK, 118 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_SendToACK,
119 OnMsgSendToACK) 119 OnMsgSendToACK)
120 IPC_MESSAGE_UNHANDLED(handled = false) 120 IPC_MESSAGE_UNHANDLED(handled = false)
121 IPC_END_MESSAGE_MAP() 121 IPC_END_MESSAGE_MAP()
122 return handled; 122 return handled;
123 } 123 }
124 124
125 void PPB_UDPSocket_Private_Proxy::OnMsgBindACK( 125 void PPB_UDPSocket_Private_Proxy::OnMsgBindACK(
126 uint32 /* plugin_dispatcher_id */, 126 uint32 /* plugin_dispatcher_id */,
127 uint32 socket_id, 127 uint32 socket_id,
128 bool succeeded) { 128 bool succeeded,
129 const PP_NetAddress_Private& bound_addr) {
129 if (!g_id_to_socket) { 130 if (!g_id_to_socket) {
130 NOTREACHED(); 131 NOTREACHED();
131 return; 132 return;
132 } 133 }
133 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id); 134 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id);
134 if (iter == g_id_to_socket->end()) 135 if (iter == g_id_to_socket->end())
135 return; 136 return;
136 iter->second->OnBindCompleted(succeeded); 137 iter->second->OnBindCompleted(succeeded, bound_addr);
137 } 138 }
138 139
139 void PPB_UDPSocket_Private_Proxy::OnMsgRecvFromACK( 140 void PPB_UDPSocket_Private_Proxy::OnMsgRecvFromACK(
140 uint32 /* plugin_dispatcher_id */, 141 uint32 /* plugin_dispatcher_id */,
141 uint32 socket_id, 142 uint32 socket_id,
142 bool succeeded, 143 bool succeeded,
143 const std::string& data, 144 const std::string& data,
144 const PP_NetAddress_Private& addr) { 145 const PP_NetAddress_Private& addr) {
145 if (!g_id_to_socket) { 146 if (!g_id_to_socket) {
146 NOTREACHED(); 147 NOTREACHED();
(...skipping 15 matching lines...) Expand all
162 return; 163 return;
163 } 164 }
164 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id); 165 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id);
165 if (iter == g_id_to_socket->end()) 166 if (iter == g_id_to_socket->end())
166 return; 167 return;
167 iter->second->OnSendToCompleted(succeeded, bytes_written); 168 iter->second->OnSendToCompleted(succeeded, bytes_written);
168 } 169 }
169 170
170 } // namespace proxy 171 } // namespace proxy
171 } // namespace ppapi 172 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698