Index: content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h |
diff --git a/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.h b/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h |
similarity index 76% |
rename from content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.h |
rename to content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h |
index 90f433f133cb5e5a5ec2fe9904101d550626f1ad..6caa22c18811b11958cd4e6bee78b60adc0af6a4 100644 |
--- a/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.h |
+++ b/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h |
@@ -1,9 +1,9 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_PRIVATE_MESSAGE_FILTER_H_ |
-#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_PRIVATE_MESSAGE_FILTER_H_ |
+#ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_MESSAGE_FILTER_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_MESSAGE_FILTER_H_ |
#include <string> |
@@ -16,12 +16,17 @@ |
#include "content/public/common/process_type.h" |
#include "net/base/completion_callback.h" |
#include "net/base/ip_endpoint.h" |
+#include "ppapi/c/dev/ppb_udp_socket_dev.h" |
#include "ppapi/c/pp_instance.h" |
#include "ppapi/c/pp_stdint.h" |
#include "ppapi/host/resource_message_filter.h" |
struct PP_NetAddress_Private; |
+namespace base { |
+class ListValue; |
+} |
+ |
namespace net { |
class IOBuffer; |
class IOBufferWithSize; |
@@ -29,6 +34,9 @@ class UDPServerSocket; |
} |
namespace ppapi { |
+ |
+class SocketOptionData; |
+ |
namespace host { |
struct ReplyMessageContext; |
} |
@@ -39,14 +47,15 @@ namespace content { |
class BrowserPpapiHostImpl; |
struct SocketPermissionRequest; |
-class CONTENT_EXPORT PepperUDPSocketPrivateMessageFilter |
+class CONTENT_EXPORT PepperUDPSocketMessageFilter |
: public ppapi::host::ResourceMessageFilter { |
public: |
- PepperUDPSocketPrivateMessageFilter(BrowserPpapiHostImpl* host, |
- PP_Instance instance); |
+ PepperUDPSocketMessageFilter(BrowserPpapiHostImpl* host, |
+ PP_Instance instance, |
+ bool private_api); |
protected: |
- virtual ~PepperUDPSocketPrivateMessageFilter(); |
+ virtual ~PepperUDPSocketMessageFilter(); |
private: |
// ppapi::host::ResourceMessageFilter overrides. |
@@ -56,10 +65,10 @@ class CONTENT_EXPORT PepperUDPSocketPrivateMessageFilter |
const IPC::Message& msg, |
ppapi::host::HostMessageContext* context) OVERRIDE; |
- int32_t OnMsgSetBoolSocketFeature( |
+ int32_t OnMsgSetOption( |
const ppapi::host::HostMessageContext* context, |
- int32_t name, |
- bool value); |
+ PP_UDPSocket_Option_Dev name, |
+ const ppapi::SocketOptionData& value); |
int32_t OnMsgBind(const ppapi::host::HostMessageContext* context, |
const PP_NetAddress_Private& addr); |
int32_t OnMsgRecvFrom(const ppapi::host::HostMessageContext* context, |
@@ -77,9 +86,9 @@ class CONTENT_EXPORT PepperUDPSocketPrivateMessageFilter |
void Close(); |
void OnRecvFromCompleted(const ppapi::host::ReplyMessageContext& context, |
- int32_t result); |
+ int net_result); |
void OnSendToCompleted(const ppapi::host::ReplyMessageContext& context, |
- int32_t result); |
+ int net_result); |
void SendBindReply(const ppapi::host::ReplyMessageContext& context, |
int32_t result, |
@@ -99,6 +108,9 @@ class CONTENT_EXPORT PepperUDPSocketPrivateMessageFilter |
void SendSendToError(const ppapi::host::ReplyMessageContext& context, |
int32_t result); |
+ // We may receive requests to set options before the underlying socket is |
+ // created. In that case, these two boolean members store the option requests |
+ // so that they can be applied when the socket is created. |
bool allow_address_reuse_; |
bool allow_broadcast_; |
@@ -111,12 +123,14 @@ class CONTENT_EXPORT PepperUDPSocketPrivateMessageFilter |
net::IPEndPoint recvfrom_address_; |
bool external_plugin_; |
+ bool private_api_; |
+ |
int render_process_id_; |
int render_view_id_; |
- DISALLOW_COPY_AND_ASSIGN(PepperUDPSocketPrivateMessageFilter); |
+ DISALLOW_COPY_AND_ASSIGN(PepperUDPSocketMessageFilter); |
}; |
} // namespace content |
-#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_PRIVATE_MESSAGE_FILTER_H_ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_MESSAGE_FILTER_H_ |