blob: 15160679a008b0bc65cd79f264cd8027a94d4a8b [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
8#include "base/basictypes.h"
9#include "base/compiler_specific.h"
10#include "ppapi/proxy/ppapi_proxy_export.h"
11#include "ppapi/proxy/udp_socket_resource_base.h"
12#include "ppapi/thunk/ppb_udp_socket_api.h"
13
14namespace ppapi {
15namespace proxy {
16
17class PPAPI_PROXY_EXPORT UDPSocketResource : public UDPSocketResourceBase,
18 public thunk::PPB_UDPSocket_API {
19 public:
20 UDPSocketResource(Connection connection, PP_Instance instance);
21 virtual ~UDPSocketResource();
22
23 // PluginResource implementation.
mostynb699af3c2014-10-06 18:03:3424 virtual thunk::PPB_UDPSocket_API* AsPPB_UDPSocket_API() override;
[email protected]31cb1472013-06-13 22:43:3925
26 // thunk::PPB_UDPSocket_API implementation.
27 virtual int32_t Bind(PP_Resource addr,
mostynb699af3c2014-10-06 18:03:3428 scoped_refptr<TrackedCallback> callback) override;
29 virtual PP_Resource GetBoundAddress() override;
[email protected]31cb1472013-06-13 22:43:3930 virtual int32_t RecvFrom(char* buffer,
31 int32_t num_bytes,
32 PP_Resource* addr,
mostynb699af3c2014-10-06 18:03:3433 scoped_refptr<TrackedCallback> callback) override;
[email protected]31cb1472013-06-13 22:43:3934 virtual int32_t SendTo(const char* buffer,
35 int32_t num_bytes,
36 PP_Resource addr,
mostynb699af3c2014-10-06 18:03:3437 scoped_refptr<TrackedCallback> callback) override;
38 virtual void Close() override;
hidehikofd305c122014-12-11 06:01:4739 virtual int32_t SetOption1_0(
40 PP_UDPSocket_Option name,
41 const PP_Var& value,
42 scoped_refptr<TrackedCallback> callback) override;
eduardo.lima8171d462015-03-13 15:40:2143 virtual int32_t SetOption1_1(
44 PP_UDPSocket_Option name,
45 const PP_Var& value,
46 scoped_refptr<TrackedCallback> callback) override;
[email protected]8de13292013-06-24 06:04:3947 virtual int32_t SetOption(PP_UDPSocket_Option name,
[email protected]31cb1472013-06-13 22:43:3948 const PP_Var& value,
mostynb699af3c2014-10-06 18:03:3449 scoped_refptr<TrackedCallback> callback) override;
eduardo.lima8171d462015-03-13 15:40:2150 virtual int32_t JoinGroup(PP_Resource group,
51 scoped_refptr<TrackedCallback> callback) override;
52 virtual int32_t LeaveGroup(PP_Resource group,
53 scoped_refptr<TrackedCallback> callback) override;
[email protected]31cb1472013-06-13 22:43:3954
55 private:
56 DISALLOW_COPY_AND_ASSIGN(UDPSocketResource);
57};
58
59} // namespace proxy
60} // namespace ppapi
61
62#endif // PPAPI_PROXY_UDP_SOCKET_RESOURCE_H_