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

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

Issue 10993078: Use extensions socket permission for TCP/UDP socket APIs in Pepper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed Android build Created 8 years, 1 month 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
« no previous file with comments | « ppapi/proxy/ppapi_messages.h ('k') | ppapi/shared_impl/private/net_address_private_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/c/private/ppb_udp_socket_private.h" 10 #include "ppapi/c/private/ppb_udp_socket_private.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 SendToBrowser(new PpapiHostMsg_PPBUDPSocket_Bind( 64 SendToBrowser(new PpapiHostMsg_PPBUDPSocket_Bind(
65 API_ID_PPB_UDPSOCKET_PRIVATE, socket_id_, addr)); 65 API_ID_PPB_UDPSOCKET_PRIVATE, socket_id_, addr));
66 } 66 }
67 67
68 void UDPSocket::SendRecvFrom(int32_t num_bytes) { 68 void UDPSocket::SendRecvFrom(int32_t num_bytes) {
69 SendToBrowser(new PpapiHostMsg_PPBUDPSocket_RecvFrom(socket_id_, num_bytes)); 69 SendToBrowser(new PpapiHostMsg_PPBUDPSocket_RecvFrom(socket_id_, num_bytes));
70 } 70 }
71 71
72 void UDPSocket::SendSendTo(const std::string& data, 72 void UDPSocket::SendSendTo(const std::string& data,
73 const PP_NetAddress_Private& addr) { 73 const PP_NetAddress_Private& addr) {
74 SendToBrowser(new PpapiHostMsg_PPBUDPSocket_SendTo(socket_id_, data, addr)); 74 SendToBrowser(new PpapiHostMsg_PPBUDPSocket_SendTo(
75 API_ID_PPB_UDPSOCKET_PRIVATE, socket_id_, data, addr));
75 } 76 }
76 77
77 void UDPSocket::SendClose() { 78 void UDPSocket::SendClose() {
78 // After removed from the mapping, this object won't receive any notifications 79 // After removed from the mapping, this object won't receive any notifications
79 // from the proxy. 80 // from the proxy.
80 DCHECK(g_id_to_socket->find(socket_id_) != g_id_to_socket->end()); 81 DCHECK(g_id_to_socket->find(socket_id_) != g_id_to_socket->end());
81 g_id_to_socket->erase(socket_id_); 82 g_id_to_socket->erase(socket_id_);
82 SendToBrowser(new PpapiHostMsg_PPBUDPSocket_Close(socket_id_)); 83 SendToBrowser(new PpapiHostMsg_PPBUDPSocket_Close(socket_id_));
83 } 84 }
84 85
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 return; 172 return;
172 } 173 }
173 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id); 174 IDToSocketMap::iterator iter = g_id_to_socket->find(socket_id);
174 if (iter == g_id_to_socket->end()) 175 if (iter == g_id_to_socket->end())
175 return; 176 return;
176 iter->second->OnSendToCompleted(succeeded, bytes_written); 177 iter->second->OnSendToCompleted(succeeded, bytes_written);
177 } 178 }
178 179
179 } // namespace proxy 180 } // namespace proxy
180 } // namespace ppapi 181 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_messages.h ('k') | ppapi/shared_impl/private/net_address_private_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698