1 // 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.
5 #ifndef PPAPI_PROXY_UDP_SOCKET_RESOURCE_H_
6 #define PPAPI_PROXY_UDP_SOCKET_RESOURCE_H_
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"
17 class PPAPI_PROXY_EXPORT UDPSocketResource
: public UDPSocketResourceBase
,
18 public thunk::PPB_UDPSocket_API
{
20 UDPSocketResource(Connection connection
, PP_Instance instance
);
21 ~UDPSocketResource() override
;
23 // PluginResource implementation.
24 thunk::PPB_UDPSocket_API
* AsPPB_UDPSocket_API() override
;
26 // thunk::PPB_UDPSocket_API implementation.
27 int32_t Bind(PP_Resource addr
,
28 scoped_refptr
<TrackedCallback
> callback
) override
;
29 PP_Resource
GetBoundAddress() override
;
30 int32_t RecvFrom(char* buffer
,
33 scoped_refptr
<TrackedCallback
> callback
) override
;
34 int32_t SendTo(const char* buffer
,
37 scoped_refptr
<TrackedCallback
> callback
) override
;
38 void Close() override
;
40 PP_UDPSocket_Option name
,
42 scoped_refptr
<TrackedCallback
> callback
) override
;
44 PP_UDPSocket_Option name
,
46 scoped_refptr
<TrackedCallback
> callback
) override
;
47 int32_t SetOption(PP_UDPSocket_Option name
,
49 scoped_refptr
<TrackedCallback
> callback
) override
;
50 int32_t JoinGroup(PP_Resource group
,
51 scoped_refptr
<TrackedCallback
> callback
) override
;
52 int32_t LeaveGroup(PP_Resource group
,
53 scoped_refptr
<TrackedCallback
> callback
) override
;
56 DISALLOW_COPY_AND_ASSIGN(UDPSocketResource
);
62 #endif // PPAPI_PROXY_UDP_SOCKET_RESOURCE_H_