ppb_udp_socket_api.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #ifndef PPAPI_THUNK_PPB_UDP_SOCKET_API_H_
  5. #define PPAPI_THUNK_PPB_UDP_SOCKET_API_H_
  6. #include <stdint.h>
  7. #include "base/memory/ref_counted.h"
  8. #include "ppapi/c/ppb_udp_socket.h"
  9. #include "ppapi/thunk/ppapi_thunk_export.h"
  10. namespace ppapi {
  11. class TrackedCallback;
  12. namespace thunk {
  13. class PPAPI_THUNK_EXPORT PPB_UDPSocket_API {
  14. public:
  15. virtual ~PPB_UDPSocket_API() {}
  16. virtual int32_t Bind(PP_Resource addr,
  17. scoped_refptr<TrackedCallback> callback) = 0;
  18. virtual PP_Resource GetBoundAddress() = 0;
  19. virtual int32_t RecvFrom(char* buffer,
  20. int32_t num_bytes,
  21. PP_Resource* addr,
  22. scoped_refptr<TrackedCallback> callback) = 0;
  23. virtual int32_t SendTo(const char* buffer,
  24. int32_t num_bytes,
  25. PP_Resource addr,
  26. scoped_refptr<TrackedCallback> callback) = 0;
  27. virtual void Close() = 0;
  28. virtual int32_t SetOption1_0(PP_UDPSocket_Option name,
  29. const PP_Var& value,
  30. scoped_refptr<TrackedCallback> callback) = 0;
  31. virtual int32_t SetOption1_1(PP_UDPSocket_Option name,
  32. const PP_Var& value,
  33. scoped_refptr<TrackedCallback> callback) = 0;
  34. virtual int32_t SetOption(PP_UDPSocket_Option name,
  35. const PP_Var& value,
  36. scoped_refptr<TrackedCallback> callback) = 0;
  37. virtual int32_t JoinGroup(PP_Resource group,
  38. scoped_refptr<TrackedCallback> callback) = 0;
  39. virtual int32_t LeaveGroup(PP_Resource group,
  40. scoped_refptr<TrackedCallback> callback) = 0;
  41. };
  42. } // namespace thunk
  43. } // namespace ppapi
  44. #endif // PPAPI_THUNK_PPB_UDP_SOCKET_API_H_