blob: c5a3de8c72131891fcaeaf7394009f41d0483c5f [file] [log] [blame]
[email protected]b1784f42013-06-13 06:48:361// Copyright 2013 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.
4
5#ifndef PPAPI_PROXY_PPB_TCP_SOCKET_PROXY_H_
6#define PPAPI_PROXY_PPB_TCP_SOCKET_PROXY_H_
7
8#include <string>
9
10#include "base/basictypes.h"
11#include "ppapi/c/pp_instance.h"
12#include "ppapi/c/pp_resource.h"
13#include "ppapi/proxy/interface_proxy.h"
14#include "ppapi/proxy/ppapi_proxy_export.h"
15
16struct PP_NetAddress_Private;
17
18namespace ppapi {
19namespace proxy {
20
21class PPB_TCPSocket_Proxy : public InterfaceProxy {
22 public:
23 explicit PPB_TCPSocket_Proxy(Dispatcher* dispatcher);
24 virtual ~PPB_TCPSocket_Proxy();
25
26 static PP_Resource CreateProxyResource(PP_Instance instance);
27
28 // InterfaceProxy implementation.
29 virtual bool OnMessageReceived(const IPC::Message& msg);
30
31 static const ApiID kApiID = API_ID_PPB_TCPSOCKET;
32
33 private:
34 // Browser->plugin message handlers.
35 void OnMsgConnectACK(uint32 plugin_dispatcher_id,
36 uint32 socket_id,
[email protected]d9810432013-06-20 21:24:0837 int32_t result,
[email protected]b1784f42013-06-13 06:48:3638 const PP_NetAddress_Private& local_addr,
39 const PP_NetAddress_Private& remote_addr);
40 void OnMsgReadACK(uint32 plugin_dispatcher_id,
41 uint32 socket_id,
[email protected]d9810432013-06-20 21:24:0842 int32_t result,
[email protected]b1784f42013-06-13 06:48:3643 const std::string& data);
44 void OnMsgWriteACK(uint32 plugin_dispatcher_id,
45 uint32 socket_id,
[email protected]d9810432013-06-20 21:24:0846 int32_t result);
47 void OnMsgSetOptionACK(uint32 plugin_dispatcher_id,
48 uint32 socket_id,
49 int32_t result);
[email protected]b1784f42013-06-13 06:48:3650
51 DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Proxy);
52};
53
54} // namespace proxy
55} // namespace ppapi
56
57#endif // PPAPI_PROXY_PPB_TCP_SOCKET_PROXY_H_