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

Unified Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 9379002: Move socket API restriction check to browser process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index 9c7d225e771e64fa996147772a26be75a9d12963..f689abff92c418580b8946b870520f97241dbc4d 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -1649,9 +1649,6 @@ void PepperPluginDelegateImpl::OnConnectTcpACK(
}
uint32 PepperPluginDelegateImpl::TCPSocketCreate() {
- if (!CanUseSocketAPIs())
- return 0;
-
uint32 socket_id = 0;
render_view_->Send(new PpapiHostMsg_PPBTCPSocket_Create(
render_view_->routing_id(), 0, &socket_id));
@@ -1708,9 +1705,6 @@ void PepperPluginDelegateImpl::TCPSocketDisconnect(uint32 socket_id) {
}
uint32 PepperPluginDelegateImpl::UDPSocketCreate() {
- if (!CanUseSocketAPIs())
- return 0;
-
uint32 socket_id = 0;
render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Create(
render_view_->routing_id(), 0, &socket_id));
@@ -2082,16 +2076,6 @@ PepperPluginDelegateImpl::GetParentContextForPlatformContext3D() {
return parent_context;
}
-bool PepperPluginDelegateImpl::CanUseSocketAPIs() {
- WebView* webview = render_view_->webview();
- WebFrame* main_frame = webview ? webview->mainFrame() : NULL;
- GURL url(main_frame ? GURL(main_frame->document().url()) : GURL());
- if (!url.is_valid())
- return false;
-
- return content::GetContentClient()->renderer()->AllowSocketAPI(url);
-}
-
MouseLockDispatcher::LockTarget*
PepperPluginDelegateImpl::GetOrCreateLockTargetAdapter(
webkit::ppapi::PluginInstance* instance) {

Powered by Google App Engine
This is Rietveld 408576698