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

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 class UDPSocket_Dev: public Resource {
20 public:
21 UDPSocket_Dev();
22
23 explicit UDPSocket_Dev(const InstanceHandle& instance);
24
25 UDPSocket_Dev(PassRef, PP_Resource resource);
26
27 UDPSocket_Dev(const UDPSocket_Dev& other);
28
29 virtual ~UDPSocket_Dev();
30
31 UDPSocket_Dev& operator=(const UDPSocket_Dev& other);
32
33 // Returns true if the required interface is available.
34 static bool IsAvailable();
35
36 int32_t Bind(const NetAddress_Dev& addr,
37 const CompletionCallback& callback);
38 NetAddress_Dev GetBoundAddress();
39 int32_t RecvFrom(char* buffer,
40 int32_t num_bytes,
41 PP_Resource* addr,
bbudge 2013/06/10 12:59:56 It would be nice if this could be NetAddress_Dev*.
yzshen1 2013/06/10 22:10:35 The problem is that NetAddress_Dev doesn't have a
dmichael (off chromium) 2013/06/11 17:03:35 Can you grant friendship from NetAddress_Dev to UD
yzshen1 2013/06/11 17:29:58 The problem is that NetAddress_Dev itself doesn't
42 const CompletionCallback& callback);
43 int32_t SendTo(const char* buffer,
44 int32_t num_bytes,
45 const NetAddress_Dev& addr,
46 const CompletionCallback& callback);
47 void Close();
48 int32_t SetOption(PP_UDPSocket_Option_Dev name,
49 const Var& value,
50 const CompletionCallback& callback);
51 };
52
53 } // namespace pp
54
55 #endif // PPAPI_CPP_DEV_UDP_SOCKET_DEV_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698