blob: e7ba86d61256d598fdf0ec30ef7eb6129e8f0b50 [file] [log] [blame]
[email protected]31cb1472013-06-13 22:43:391// 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_UDP_SOCKET_RESOURCE_H_
6#define PPAPI_PROXY_UDP_SOCKET_RESOURCE_H_
7
avie029c4132015-12-23 06:45:228#include <stdint.h>
9
[email protected]31cb1472013-06-13 22:43:3910#include "base/compiler_specific.h"
avie029c4132015-12-23 06:45:2211#include "base/macros.h"
[email protected]31cb1472013-06-13 22:43:3912#include "ppapi/proxy/ppapi_proxy_export.h"
13#include "ppapi/proxy/udp_socket_resource_base.h"
14#include "ppapi/thunk/ppb_udp_socket_api.h"
15
16namespace ppapi {
17namespace proxy {
18
19class PPAPI_PROXY_EXPORT UDPSocketResource : public UDPSocketResourceBase,
20 public thunk::PPB_UDPSocket_API {
21 public:
22 UDPSocketResource(Connection connection, PP_Instance instance);
nicke4784432015-04-23 14:01:4823 ~UDPSocketResource() override;
[email protected]31cb1472013-06-13 22:43:3924
25 // PluginResource implementation.
nicke4784432015-04-23 14:01:4826 thunk::PPB_UDPSocket_API* AsPPB_UDPSocket_API() override;
[email protected]31cb1472013-06-13 22:43:3927
28 // thunk::PPB_UDPSocket_API implementation.
nicke4784432015-04-23 14:01:4829 int32_t Bind(PP_Resource addr,
30 scoped_refptr<TrackedCallback> callback) override;
31 PP_Resource GetBoundAddress() override;
32 int32_t RecvFrom(char* buffer,
33 int32_t num_bytes,
34 PP_Resource* addr,
35 scoped_refptr<TrackedCallback> callback) override;
36 int32_t SendTo(const char* buffer,
37 int32_t num_bytes,
38 PP_Resource addr,
39 scoped_refptr<TrackedCallback> callback) override;
40 void Close() override;
41 int32_t SetOption1_0(
hidehikofd305c122014-12-11 06:01:4742 PP_UDPSocket_Option name,
43 const PP_Var& value,
44 scoped_refptr<TrackedCallback> callback) override;
nicke4784432015-04-23 14:01:4845 int32_t SetOption1_1(
eduardo.lima8171d462015-03-13 15:40:2146 PP_UDPSocket_Option name,
47 const PP_Var& value,
48 scoped_refptr<TrackedCallback> callback) override;
nicke4784432015-04-23 14:01:4849 int32_t SetOption(PP_UDPSocket_Option name,
50 const PP_Var& value,
51 scoped_refptr<TrackedCallback> callback) override;
52 int32_t JoinGroup(PP_Resource group,
53 scoped_refptr<TrackedCallback> callback) override;
54 int32_t LeaveGroup(PP_Resource group,
55 scoped_refptr<TrackedCallback> callback) override;
[email protected]31cb1472013-06-13 22:43:3956
57 private:
58 DISALLOW_COPY_AND_ASSIGN(UDPSocketResource);
59};
60
61} // namespace proxy
62} // namespace ppapi
63
64#endif // PPAPI_PROXY_UDP_SOCKET_RESOURCE_H_