Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: ppapi/cpp/dev/udp_socket_dev.h

Issue 16282005: Introduce PPB_UDPSocket_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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
5 #ifndef PPAPI_CPP_DEV_UDP_SOCKET_DEV_H_
6 #define PPAPI_CPP_DEV_UDP_SOCKET_DEV_H_
7
8 #include "ppapi/c/dev/ppb_udp_socket_dev.h"
9 #include "ppapi/cpp/dev/net_address_dev.h"
10 #include "ppapi/cpp/pass_ref.h"
11 #include "ppapi/cpp/resource.h"
12
13 namespace pp {
14
15 class CompletionCallback;
16 class InstanceHandle;
17 class Var;
18
19 template <typename T> class CompletionCallbackWithOutput;
20
21 class UDPSocket_Dev: public Resource {
22 public:
23 UDPSocket_Dev();
24
25 explicit UDPSocket_Dev(const InstanceHandle& instance);
26
27 UDPSocket_Dev(PassRef, PP_Resource resource);
28
29 UDPSocket_Dev(const UDPSocket_Dev& other);
30
31 virtual ~UDPSocket_Dev();
32
33 UDPSocket_Dev& operator=(const UDPSocket_Dev& other);
34
35 // Returns true if the required interface is available.
36 static bool IsAvailable();
37
38 int32_t Bind(const NetAddress_Dev& addr,
39 const CompletionCallback& callback);
40 NetAddress_Dev GetBoundAddress();
41 int32_t RecvFrom(
42 char* buffer,
43 int32_t num_bytes,
44 const CompletionCallbackWithOutput<NetAddress_Dev>& callback);
45 int32_t SendTo(const char* buffer,
46 int32_t num_bytes,
47 const NetAddress_Dev& addr,
48 const CompletionCallback& callback);
49 void Close();
50 int32_t SetOption(PP_UDPSocket_Option_Dev name,
51 const Var& value,
52 const CompletionCallback& callback);
53 };
54
55 } // namespace pp
56
57 #endif // PPAPI_CPP_DEV_UDP_SOCKET_DEV_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698