Android NTP: Most visited tile clicks should have PageTransition.AUTO_BOOKMARK
[chromium-blink-merge.git] / ppapi / cpp / private / udp_socket_private.h
blob34e06a906a0970a06beeb970b3618cde5711a1ca
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_UDP_SOCKET_PRIVATE_H_
6 #define PPAPI_CPP_PRIVATE_UDP_SOCKET_PRIVATE_H_
8 #include "ppapi/c/pp_stdint.h"
9 #include "ppapi/c/private/ppb_udp_socket_private.h"
10 #include "ppapi/cpp/resource.h"
12 namespace pp {
14 class CompletionCallback;
15 class InstanceHandle;
16 class Var;
18 class UDPSocketPrivate : public Resource {
19 public:
20 explicit UDPSocketPrivate(const InstanceHandle& instance);
22 // Returns true if the required interface is available.
23 static bool IsAvailable();
25 int32_t SetSocketFeature(PP_UDPSocketFeature_Private name, const Var& value);
26 int32_t Bind(const PP_NetAddress_Private* addr,
27 const CompletionCallback& callback);
28 bool GetBoundAddress(PP_NetAddress_Private* addr);
29 int32_t RecvFrom(char* buffer,
30 int32_t num_bytes,
31 const CompletionCallback& callback);
32 bool GetRecvFromAddress(PP_NetAddress_Private* addr);
33 int32_t SendTo(const char* buffer,
34 int32_t num_bytes,
35 const PP_NetAddress_Private* addr,
36 const CompletionCallback& callback);
37 void Close();
40 } // namespace pp
42 #endif // PPAPI_CPP_PRIVATE_UDP_SOCKET_PRIVATE_H_