[Android] Implement 3-way sensor fallback for Device Orientation.
[chromium-blink-merge.git] / ppapi / cpp / private / tcp_server_socket_private.h
blobd6a1942fc2e069c1a76a557ec5d84e8fabfe7e65
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_SERVER_SOCKET_PRIVATE_H_
6 #define PPAPI_CPP_PRIVATE_TCP_SERVER_SOCKET_PRIVATE_H_
8 #include "ppapi/c/pp_stdint.h"
9 #include "ppapi/c/private/ppb_tcp_server_socket_private.h"
10 #include "ppapi/cpp/resource.h"
12 namespace pp {
14 class CompletionCallback;
15 class InstanceHandle;
17 class TCPServerSocketPrivate : public Resource {
18 public:
19 explicit TCPServerSocketPrivate(const InstanceHandle& instance);
21 // Returns true if the required interface is available.
22 static bool IsAvailable();
24 int32_t Listen(const PP_NetAddress_Private* addr,
25 int32_t backlog,
26 const CompletionCallback& callback);
27 // Accepts incoming connection and stores resource of accepted
28 // socket into |socket|. If Accept returns PP_OK_COMPLETIONPENDING,
29 // the memory pointed by |socket| should stay valid until the
30 // |callback| is called or StopListening method is called.
31 int32_t Accept(PP_Resource* socket,
32 const CompletionCallback& callback);
33 int32_t GetLocalAddress(PP_NetAddress_Private* addr);
34 void StopListening();
37 } // namespace pp
39 #endif // PPAPI_CPP_PRIVATE_TCP_SERVER_SOCKET_PRIVATE_H_