ppb_tcp_socket_private_api.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright (c) 2012 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_TCP_SOCKET_PRIVATE_API_H_
  5. #define PPAPI_THUNK_PPB_TCP_SOCKET_PRIVATE_API_H_
  6. #include <stdint.h>
  7. #include "base/memory/ref_counted.h"
  8. #include "ppapi/c/private/ppb_tcp_socket_private.h"
  9. #include "ppapi/thunk/ppapi_thunk_export.h"
  10. namespace ppapi {
  11. class TrackedCallback;
  12. namespace thunk {
  13. class PPAPI_THUNK_EXPORT PPB_TCPSocket_Private_API {
  14. public:
  15. virtual ~PPB_TCPSocket_Private_API() {}
  16. virtual int32_t Connect(const char* host,
  17. uint16_t port,
  18. scoped_refptr<TrackedCallback> callback) = 0;
  19. virtual int32_t ConnectWithNetAddress(
  20. const PP_NetAddress_Private* addr,
  21. scoped_refptr<TrackedCallback> callback) = 0;
  22. virtual PP_Bool GetLocalAddress(PP_NetAddress_Private* local_addr) = 0;
  23. virtual PP_Bool GetRemoteAddress(PP_NetAddress_Private* remote_addr) = 0;
  24. virtual int32_t SSLHandshake(const char* server_name,
  25. uint16_t server_port,
  26. scoped_refptr<TrackedCallback> callback) = 0;
  27. virtual PP_Resource GetServerCertificate() = 0;
  28. virtual PP_Bool AddChainBuildingCertificate(PP_Resource certificate,
  29. PP_Bool trusted) = 0;
  30. virtual int32_t Read(char* buffer,
  31. int32_t bytes_to_read,
  32. scoped_refptr<TrackedCallback> callback) = 0;
  33. virtual int32_t Write(const char* buffer,
  34. int32_t bytes_to_write,
  35. scoped_refptr<TrackedCallback> callback) = 0;
  36. virtual void Disconnect() = 0;
  37. virtual int32_t SetOption(PP_TCPSocketOption_Private name,
  38. const PP_Var& value,
  39. scoped_refptr<TrackedCallback> callback) = 0;
  40. };
  41. } // namespace thunk
  42. } // namespace ppapi
  43. #endif // PPAPI_THUNK_PPB_TCP_SOCKET_PRIVATE_API_H_