Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / ppapi / cpp / private / tcp_socket_private.h
blob12e435e5895b2cc5b9a07ad18b75b90956c66f71
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.
5 #ifndef PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_
6 #define PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_
8 #include "ppapi/c/pp_stdint.h"
9 #include "ppapi/c/private/ppb_tcp_socket_private.h"
10 #include "ppapi/cpp/pass_ref.h"
11 #include "ppapi/cpp/private/x509_certificate_private.h"
12 #include "ppapi/cpp/resource.h"
14 namespace pp {
16 class CompletionCallback;
17 class InstanceHandle;
19 class TCPSocketPrivate : public Resource {
20 public:
21 explicit TCPSocketPrivate(const InstanceHandle& instance);
23 TCPSocketPrivate(PassRef, PP_Resource resource);
25 // Returns true if the required interface is available.
26 static bool IsAvailable();
28 int32_t Connect(const char* host,
29 uint16_t port,
30 const CompletionCallback& callback);
31 int32_t ConnectWithNetAddress(const PP_NetAddress_Private* addr,
32 const CompletionCallback& callback);
33 bool GetLocalAddress(PP_NetAddress_Private* local_addr);
34 bool GetRemoteAddress(PP_NetAddress_Private* remote_addr);
35 int32_t SSLHandshake(const char* server_name,
36 uint16_t server_port,
37 const CompletionCallback& callback);
38 X509CertificatePrivate GetServerCertificate();
39 bool AddChainBuildingCertificate(const X509CertificatePrivate& cert,
40 bool trusted);
42 int32_t Read(char* buffer,
43 int32_t bytes_to_read,
44 const CompletionCallback& callback);
45 int32_t Write(const char* buffer,
46 int32_t bytes_to_write,
47 const CompletionCallback& callback);
48 void Disconnect();
49 int32_t SetOption(PP_TCPSocketOption_Private name,
50 const Var& value,
51 const CompletionCallback& callback);
54 } // namespace pp
56 #endif // PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_