Chromium Code Reviews| Index: content/browser/renderer_host/pepper/pepper_udp_socket_private_host.h |
| diff --git a/content/browser/renderer_host/pepper/pepper_udp_socket_private_host.h b/content/browser/renderer_host/pepper/pepper_udp_socket_private_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..96caf30d4579f6f1c971acfef61ab11f340a03cb |
| --- /dev/null |
| +++ b/content/browser/renderer_host/pepper/pepper_udp_socket_private_host.h |
| @@ -0,0 +1,92 @@ |
| +// Copyright (c) 2012 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_HOST_H_ |
| +#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_PRIVATE_HOST_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/callback.h" |
| +#include "base/compiler_specific.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "content/browser/renderer_host/pepper/pepper_udp_socket_private_shared.h" |
| +#include "content/common/content_export.h" |
| +#include "ppapi/host/resource_host.h" |
| + |
| +struct PP_NetAddress_Private; |
| + |
| +namespace ppapi { |
| +namespace host { |
| +struct ReplyMessageContext; |
| +} |
| +} |
| + |
| +namespace content { |
| + |
| +class BrowserPpapiHostImpl; |
| +struct SocketPermissionRequest; |
| + |
| +class CONTENT_EXPORT PepperUDPSocketPrivateHost |
| + : public ppapi::host::ResourceHost, |
|
dmichael (off chromium)
2012/12/12 23:23:38
would it fit to move this up to the previous line?
ygorshenin1
2012/12/18 12:07:16
No, because the total length of these two lines is
|
| + public PepperUDPSocketPrivateShared { |
| + public: |
| + PepperUDPSocketPrivateHost(BrowserPpapiHostImpl* host, |
| + PP_Instance instance, |
| + PP_Resource resource); |
| + virtual ~PepperUDPSocketPrivateHost(); |
| + |
| + // ppapi::host::ResourceHost implementation. |
| + virtual int32_t OnResourceMessageReceived( |
| + const IPC::Message& msg, |
| + ppapi::host::HostMessageContext* context) OVERRIDE; |
| + |
| + private: |
| + typedef base::Callback<void(bool allowed)> RequestCallback; |
| + |
| + int32_t OnMsgSetBoolSocketFeature( |
| + const ppapi::host::HostMessageContext* context, |
| + int32_t name, |
| + bool value); |
| + int32_t OnMsgBind(const ppapi::host::HostMessageContext* context, |
| + const PP_NetAddress_Private& addr); |
| + int32_t OnMsgRecvFrom(const ppapi::host::HostMessageContext* context, |
| + int32_t num_bytes); |
| + int32_t OnMsgSendTo(const ppapi::host::HostMessageContext* context, |
| + const std::string& data, |
| + const PP_NetAddress_Private& addr); |
| + int32_t OnMsgClose(const ppapi::host::HostMessageContext* context); |
| + |
| + void DoBind(const PP_NetAddress_Private& addr, bool allowed); |
| + void DoSendTo(const std::string& data, |
| + const PP_NetAddress_Private& addr, |
| + bool allowed); |
| + |
| + // PepperUDPSocketPrivateShared implementation. |
| + virtual void SendBindReply(bool succeeded, |
| + const PP_NetAddress_Private& addr) OVERRIDE; |
| + virtual void SendRecvFromReply(bool succeeded, |
| + const std::string& data, |
| + const PP_NetAddress_Private& addr) OVERRIDE; |
| + virtual void SendSendToReply(bool succeeded, int32_t bytes_written) OVERRIDE; |
| + |
| + void CheckSocketPermissionsAndReply( |
| + const SocketPermissionRequest& params, |
|
dmichael (off chromium)
2012/12/12 23:23:38
would this fit on the previous line?
ygorshenin1
2012/12/18 12:07:16
Done.
|
| + const RequestCallback& callback); |
| + |
| + scoped_ptr<ppapi::host::ReplyMessageContext> bind_context_; |
| + scoped_ptr<ppapi::host::ReplyMessageContext> recv_from_context_; |
| + scoped_ptr<ppapi::host::ReplyMessageContext> send_to_context_; |
| + |
| + BrowserPpapiHostImpl* host_; |
| + |
| + base::WeakPtrFactory<PepperUDPSocketPrivateHost> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PepperUDPSocketPrivateHost); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_PRIVATE_HOST_H_ |