Fix iOS build for XCode 4.6.
[chromium-blink-merge.git] / ppapi / proxy / ppb_tcp_socket_private_proxy.h
blob46672160cdac921310f84b1d5c217462d216e80f
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
3 // found in the LICENSE file.
5 #ifndef PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_
6 #define PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "ppapi/c/pp_instance.h"
12 #include "ppapi/c/pp_resource.h"
13 #include "ppapi/c/private/ppb_tcp_socket_private.h"
14 #include "ppapi/proxy/interface_proxy.h"
15 #include "ppapi/proxy/ppapi_proxy_export.h"
17 namespace ppapi {
19 class PPB_X509Certificate_Fields;
21 namespace proxy {
23 class PPB_TCPSocket_Private_Proxy : public InterfaceProxy {
24 public:
25 PPB_TCPSocket_Private_Proxy(Dispatcher* dispatcher);
26 virtual ~PPB_TCPSocket_Private_Proxy();
28 static PP_Resource CreateProxyResource(PP_Instance instance);
29 static PP_Resource CreateProxyResourceForConnectedSocket(
30 PP_Instance instance,
31 uint32 socket_id,
32 const PP_NetAddress_Private& local_addr,
33 const PP_NetAddress_Private& remote_addr);
35 // InterfaceProxy implementation.
36 virtual bool OnMessageReceived(const IPC::Message& msg);
38 static const ApiID kApiID = API_ID_PPB_TCPSOCKET_PRIVATE;
40 private:
41 // Browser->plugin message handlers.
42 void OnMsgConnectACK(uint32 plugin_dispatcher_id,
43 uint32 socket_id,
44 bool succeeded,
45 const PP_NetAddress_Private& local_addr,
46 const PP_NetAddress_Private& remote_addr);
47 void OnMsgSSLHandshakeACK(
48 uint32 plugin_dispatcher_id,
49 uint32 socket_id,
50 bool succeeded,
51 const PPB_X509Certificate_Fields& certificate_fields);
52 void OnMsgReadACK(uint32 plugin_dispatcher_id,
53 uint32 socket_id,
54 bool succeeded,
55 const std::string& data);
56 void OnMsgWriteACK(uint32 plugin_dispatcher_id,
57 uint32 socket_id,
58 bool succeeded,
59 int32_t bytes_written);
61 DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Proxy);
64 } // namespace proxy
65 } // namespace ppapi
67 #endif // PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_