blob: 3f4b629a9db95748192adf3d3a6b6b7b31095f20 [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"
11#include "ppapi/proxy/ppapi_proxy_export.h"
12#include "ppapi/proxy/udp_socket_resource_base.h"
13#include "ppapi/thunk/ppb_udp_socket_api.h"
14
15namespace ppapi {
16namespace proxy {
17
18class PPAPI_PROXY_EXPORT UDPSocketResource : public UDPSocketResourceBase,
19 public thunk::PPB_UDPSocket_API {
20 public:
21 UDPSocketResource(Connection connection, PP_Instance instance);
Peter Boström3d5b3cb2021-09-23 21:35:4522
23 UDPSocketResource(const UDPSocketResource&) = delete;
24 UDPSocketResource& operator=(const UDPSocketResource&) = delete;
25
nicke4784432015-04-23 14:01:4826 ~UDPSocketResource() override;
[email protected]31cb1472013-06-13 22:43:3927
28 // PluginResource implementation.
nicke4784432015-04-23 14:01:4829 thunk::PPB_UDPSocket_API* AsPPB_UDPSocket_API() override;
[email protected]31cb1472013-06-13 22:43:3930
31 // thunk::PPB_UDPSocket_API implementation.
nicke4784432015-04-23 14:01:4832 int32_t Bind(PP_Resource addr,
33 scoped_refptr<TrackedCallback> callback) override;
34 PP_Resource GetBoundAddress() override;
35 int32_t RecvFrom(char* buffer,
36 int32_t num_bytes,
37 PP_Resource* addr,
38 scoped_refptr<TrackedCallback> callback) override;
39 int32_t SendTo(const char* buffer,
40 int32_t num_bytes,
41 PP_Resource addr,
42 scoped_refptr<TrackedCallback> callback) override;
43 void Close() override;
44 int32_t SetOption1_0(
hidehikofd305c122014-12-11 06:01:4745 PP_UDPSocket_Option name,
46 const PP_Var& value,
47 scoped_refptr<TrackedCallback> callback) override;
nicke4784432015-04-23 14:01:4848 int32_t SetOption1_1(
eduardo.lima8171d462015-03-13 15:40:2149 PP_UDPSocket_Option name,
50 const PP_Var& value,
51 scoped_refptr<TrackedCallback> callback) override;
nicke4784432015-04-23 14:01:4852 int32_t SetOption(PP_UDPSocket_Option name,
53 const PP_Var& value,
54 scoped_refptr<TrackedCallback> callback) override;
55 int32_t JoinGroup(PP_Resource group,
56 scoped_refptr<TrackedCallback> callback) override;
57 int32_t LeaveGroup(PP_Resource group,
58 scoped_refptr<TrackedCallback> callback) override;
[email protected]31cb1472013-06-13 22:43:3959};
60
61} // namespace proxy
62} // namespace ppapi
63
64#endif // PPAPI_PROXY_UDP_SOCKET_RESOURCE_H_