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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/cpp/dev/udp_socket_dev.h
diff --git a/ppapi/cpp/dev/udp_socket_dev.h b/ppapi/cpp/dev/udp_socket_dev.h
new file mode 100644
index 0000000000000000000000000000000000000000..09ef2643933748d18a33a0f6c38c4a4e37b8ca00
--- /dev/null
+++ b/ppapi/cpp/dev/udp_socket_dev.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_CPP_DEV_UDP_SOCKET_DEV_H_
+#define PPAPI_CPP_DEV_UDP_SOCKET_DEV_H_
+
+#include "ppapi/c/dev/ppb_udp_socket_dev.h"
+#include "ppapi/cpp/dev/net_address_dev.h"
+#include "ppapi/cpp/pass_ref.h"
+#include "ppapi/cpp/resource.h"
+
+namespace pp {
+
+class CompletionCallback;
+class InstanceHandle;
+class Var;
+
+class UDPSocket_Dev: public Resource {
+ public:
+ UDPSocket_Dev();
+
+ explicit UDPSocket_Dev(const InstanceHandle& instance);
+
+ UDPSocket_Dev(PassRef, PP_Resource resource);
+
+ UDPSocket_Dev(const UDPSocket_Dev& other);
+
+ virtual ~UDPSocket_Dev();
+
+ UDPSocket_Dev& operator=(const UDPSocket_Dev& other);
+
+ // Returns true if the required interface is available.
+ static bool IsAvailable();
+
+ int32_t Bind(const NetAddress_Dev& addr,
+ const CompletionCallback& callback);
+ NetAddress_Dev GetBoundAddress();
+ int32_t RecvFrom(char* buffer,
+ int32_t num_bytes,
+ 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
+ const CompletionCallback& callback);
+ int32_t SendTo(const char* buffer,
+ int32_t num_bytes,
+ const NetAddress_Dev& addr,
+ const CompletionCallback& callback);
+ void Close();
+ int32_t SetOption(PP_UDPSocket_Option_Dev name,
+ const Var& value,
+ const CompletionCallback& callback);
+};
+
+} // namespace pp
+
+#endif // PPAPI_CPP_DEV_UDP_SOCKET_DEV_H_

Powered by Google App Engine
This is Rietveld 408576698