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

Side by Side Diff: content/renderer/pepper/pepper_plugin_delegate_impl.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: Created 8 years, 2 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) 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 "content/renderer/pepper/pepper_plugin_delegate_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 render_view_->Send( 1245 render_view_->Send(
1246 new PpapiHostMsg_PPBUDPSocket_RecvFrom(socket_id, num_bytes)); 1246 new PpapiHostMsg_PPBUDPSocket_RecvFrom(socket_id, num_bytes));
1247 } 1247 }
1248 1248
1249 void PepperPluginDelegateImpl::UDPSocketSendTo( 1249 void PepperPluginDelegateImpl::UDPSocketSendTo(
1250 uint32 socket_id, 1250 uint32 socket_id,
1251 const std::string& buffer, 1251 const std::string& buffer,
1252 const PP_NetAddress_Private& net_addr) { 1252 const PP_NetAddress_Private& net_addr) {
1253 DCHECK(udp_sockets_.Lookup(socket_id)); 1253 DCHECK(udp_sockets_.Lookup(socket_id));
1254 render_view_->Send( 1254 render_view_->Send(
1255 new PpapiHostMsg_PPBUDPSocket_SendTo(socket_id, buffer, net_addr)); 1255 new PpapiHostMsg_PPBUDPSocket_SendTo(render_view_->routing_id(),
1256 socket_id, buffer, net_addr));
1256 } 1257 }
1257 1258
1258 void PepperPluginDelegateImpl::UDPSocketClose(uint32 socket_id) { 1259 void PepperPluginDelegateImpl::UDPSocketClose(uint32 socket_id) {
1259 // There are no DCHECK(udp_sockets_.Lookup(socket_id)) because it 1260 // There are no DCHECK(udp_sockets_.Lookup(socket_id)) because it
1260 // can be called before UDPSocketBind is called. 1261 // can be called before UDPSocketBind is called.
1261 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Close(socket_id)); 1262 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Close(socket_id));
1262 if (udp_sockets_.Lookup(socket_id)) 1263 if (udp_sockets_.Lookup(socket_id))
1263 udp_sockets_.Remove(socket_id); 1264 udp_sockets_.Remove(socket_id);
1264 } 1265 }
1265 1266
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 else 1873 else
1873 return render_view_->mouse_lock_dispatcher(); 1874 return render_view_->mouse_lock_dispatcher();
1874 } 1875 }
1875 1876
1876 webkit_glue::ClipboardClient* 1877 webkit_glue::ClipboardClient*
1877 PepperPluginDelegateImpl::CreateClipboardClient() const { 1878 PepperPluginDelegateImpl::CreateClipboardClient() const {
1878 return new RendererClipboardClient; 1879 return new RendererClipboardClient;
1879 } 1880 }
1880 1881
1881 } // namespace content 1882 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698