Index: content/renderer/render_view_impl.h |
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h |
index b6db69feeb1a6690e28e3649e22b447c209c875e..508c2aa66e72d2dd2d95c8f5582a0583ddfa892b 100644 |
--- a/content/renderer/render_view_impl.h |
+++ b/content/renderer/render_view_impl.h |
@@ -27,6 +27,7 @@ |
#include "content/common/edit_command.h" |
#include "content/common/navigation_gesture.h" |
#include "content/public/common/page_zoom.h" |
+#include "content/public/common/referrer.h" |
#include "content/public/common/renderer_preferences.h" |
#include "content/public/common/stop_find_action.h" |
#include "content/public/renderer/render_view.h" |
@@ -293,6 +294,14 @@ class RenderViewImpl : public RenderWidget, |
webkit::WebPluginInfo* plugin_info, |
std::string* actual_mime_type); |
+ // Helper function to check that TCP/UDP private APIs are allowed for current |
+ // page. This check actually allows socket usage for NativeClient code only. |
+ // It is better to move this check to browser process but Pepper message |
+ // filters in browser process have no context about page that sent |
+ // the request. Doing this check in render process is safe because NaCl code |
+ // is executed in separate NaCl process. |
+ bool CanUseSocketAPIs(); |
+ |
// IPC::Channel::Listener implementation ------------------------------------- |
virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
@@ -714,7 +723,7 @@ class RenderViewImpl : public RenderWidget, |
void OpenURL(WebKit::WebFrame* frame, |
const GURL& url, |
- const GURL& referrer, |
+ const content::Referrer& referrer, |
WebKit::WebNavigationPolicy policy); |
bool RunJavaScriptMessage(int type, |
@@ -751,6 +760,35 @@ class RenderViewImpl : public RenderWidget, |
const PP_NetAddress_Private& local_addr, |
const PP_NetAddress_Private& remote_addr); |
#endif |
+ void OnTCPSocketConnectACK(uint32 plugin_dispatcher_id, |
+ uint32 socket_id, |
+ bool succeeded, |
+ const PP_NetAddress_Private& local_addr, |
+ const PP_NetAddress_Private& remote_addr); |
+ void OnTCPSocketSSLHandshakeACK(uint32 plugin_dispatcher_id, |
+ uint32 socket_id, |
+ bool succeeded); |
+ void OnTCPSocketReadACK(uint32 plugin_dispatcher_id, |
+ uint32 socket_id, |
+ bool succeeded, |
+ const std::string& data); |
+ void OnTCPSocketWriteACK(uint32 plugin_dispatcher_id, |
+ uint32 socket_id, |
+ bool succeeded, |
+ int32_t bytes_written); |
+ void OnUDPSocketBindACK(uint32 plugin_dispatcher_id, |
+ uint32 socket_id, |
+ bool succeeded); |
+ void OnUDPSocketSendToACK(uint32 plugin_dispatcher_id, |
+ uint32 socket_id, |
+ bool succeeded, |
+ int32_t bytes_written); |
+ void OnUDPSocketRecvFromACK(uint32 plugin_dispatcher_id, |
+ uint32 socket_id, |
+ bool succeeded, |
+ const std::string& data, |
+ const PP_NetAddress_Private& addr); |
+ |
void OnContextMenuClosed( |
const webkit_glue::CustomContextMenuContext& custom_context); |
void OnCopy(); |
@@ -1002,7 +1040,7 @@ class RenderViewImpl : public RenderWidget, |
// of the page that initiated it. Specifically, when a load is committed this |
// is used to determine if that load originated from a client-side redirect. |
// It is empty if there is no top-level client-side redirect. |
- GURL completed_client_redirect_src_; |
+ content::Referrer completed_client_redirect_src_; |
// Holds state pertaining to a navigation that we initiated. This is held by |
// the WebDataSource::ExtraData attribute. We use pending_navigation_state_ |
@@ -1219,6 +1257,9 @@ class RenderViewImpl : public RenderWidget, |
// of handling a ViewMsg_SelectRange IPC. |
bool handling_select_range_; |
+ // Set of origins that can use TCP/UDP private APIs from NaCl. |
+ std::set<std::string> allowed_socket_origins_; |
+ |
// --------------------------------------------------------------------------- |
// ADDING NEW DATA? Please see if it fits appropriately in one of the above |
// sections rather than throwing it randomly at the end. If you're adding a |