[email protected] | 31cb147 | 2013-06-13 22:43:39 | [diff] [blame] | 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. |
| 4 | |
| 5 | #ifndef PPAPI_PROXY_UDP_SOCKET_RESOURCE_H_ |
| 6 | #define PPAPI_PROXY_UDP_SOCKET_RESOURCE_H_ |
| 7 | |
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
[email protected] | 31cb147 | 2013-06-13 22:43:39 | [diff] [blame] | 10 | #include "base/compiler_specific.h" |
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 11 | #include "base/macros.h" |
[email protected] | 31cb147 | 2013-06-13 22:43:39 | [diff] [blame] | 12 | #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 | |
| 16 | namespace ppapi { |
| 17 | namespace proxy { |
| 18 | |
| 19 | class PPAPI_PROXY_EXPORT UDPSocketResource : public UDPSocketResourceBase, |
| 20 | public thunk::PPB_UDPSocket_API { |
| 21 | public: |
| 22 | UDPSocketResource(Connection connection, PP_Instance instance); |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 23 | ~UDPSocketResource() override; |
[email protected] | 31cb147 | 2013-06-13 22:43:39 | [diff] [blame] | 24 | |
| 25 | // PluginResource implementation. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 26 | thunk::PPB_UDPSocket_API* AsPPB_UDPSocket_API() override; |
[email protected] | 31cb147 | 2013-06-13 22:43:39 | [diff] [blame] | 27 | |
| 28 | // thunk::PPB_UDPSocket_API implementation. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 29 | 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( |
hidehiko | fd305c12 | 2014-12-11 06:01:47 | [diff] [blame] | 42 | PP_UDPSocket_Option name, |
| 43 | const PP_Var& value, |
| 44 | scoped_refptr<TrackedCallback> callback) override; |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 45 | int32_t SetOption1_1( |
eduardo.lima | 8171d46 | 2015-03-13 15:40:21 | [diff] [blame] | 46 | PP_UDPSocket_Option name, |
| 47 | const PP_Var& value, |
| 48 | scoped_refptr<TrackedCallback> callback) override; |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 49 | 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] | 31cb147 | 2013-06-13 22:43:39 | [diff] [blame] | 56 | |
| 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_ |