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

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: remove duplication 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 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 render_view_->Send( 1272 render_view_->Send(
1273 new PpapiHostMsg_PPBUDPSocket_RecvFrom(socket_id, num_bytes)); 1273 new PpapiHostMsg_PPBUDPSocket_RecvFrom(socket_id, num_bytes));
1274 } 1274 }
1275 1275
1276 void PepperPluginDelegateImpl::UDPSocketSendTo( 1276 void PepperPluginDelegateImpl::UDPSocketSendTo(
1277 uint32 socket_id, 1277 uint32 socket_id,
1278 const std::string& buffer, 1278 const std::string& buffer,
1279 const PP_NetAddress_Private& net_addr) { 1279 const PP_NetAddress_Private& net_addr) {
1280 DCHECK(udp_sockets_.Lookup(socket_id)); 1280 DCHECK(udp_sockets_.Lookup(socket_id));
1281 render_view_->Send( 1281 render_view_->Send(
1282 new PpapiHostMsg_PPBUDPSocket_SendTo(socket_id, buffer, net_addr)); 1282 new PpapiHostMsg_PPBUDPSocket_SendTo(render_view_->routing_id(),
1283 socket_id, buffer, net_addr));
1283 } 1284 }
1284 1285
1285 void PepperPluginDelegateImpl::UDPSocketClose(uint32 socket_id) { 1286 void PepperPluginDelegateImpl::UDPSocketClose(uint32 socket_id) {
1286 // There are no DCHECK(udp_sockets_.Lookup(socket_id)) because it 1287 // There are no DCHECK(udp_sockets_.Lookup(socket_id)) because it
1287 // can be called before UDPSocketBind is called. 1288 // can be called before UDPSocketBind is called.
1288 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Close(socket_id)); 1289 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Close(socket_id));
1289 if (udp_sockets_.Lookup(socket_id)) 1290 if (udp_sockets_.Lookup(socket_id))
1290 udp_sockets_.Remove(socket_id); 1291 udp_sockets_.Remove(socket_id);
1291 } 1292 }
1292 1293
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 else 1861 else
1861 return render_view_->mouse_lock_dispatcher(); 1862 return render_view_->mouse_lock_dispatcher();
1862 } 1863 }
1863 1864
1864 webkit_glue::ClipboardClient* 1865 webkit_glue::ClipboardClient*
1865 PepperPluginDelegateImpl::CreateClipboardClient() const { 1866 PepperPluginDelegateImpl::CreateClipboardClient() const {
1866 return new RendererClipboardClient; 1867 return new RendererClipboardClient;
1867 } 1868 }
1868 1869
1869 } // namespace content 1870 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698