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

Unified Diff: chrome/browser/extensions/api/socket/udp_socket.h

Issue 12684008: Multicast socket API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor fixes Created 7 years, 8 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: chrome/browser/extensions/api/socket/udp_socket.h
diff --git a/chrome/browser/extensions/api/socket/udp_socket.h b/chrome/browser/extensions/api/socket/udp_socket.h
index 8e2d2e66f69b4ca01b1f9e41714a2a2c5a4f9d2b..e3370838c579bf5c5807b4e2fc749f5feda48146 100644
--- a/chrome/browser/extensions/api/socket/udp_socket.h
+++ b/chrome/browser/extensions/api/socket/udp_socket.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/hash_tables.h"
#include "chrome/browser/extensions/api/socket/socket.h"
#include "net/udp/udp_socket.h"
@@ -35,6 +36,14 @@ class UDPSocket : public Socket {
virtual bool GetLocalAddress(net::IPEndPoint* address) OVERRIDE;
virtual Socket::SocketType GetSocketType() const OVERRIDE;
+ int JoinGroup(const std::string& address);
+ int LeaveGroup(const std::string& address);
+
+ int SetMulticastTimeToLive(int ttl);
+ int SetMulticastLoopbackMode(bool loopback);
+
+ int GetJoinedGroups(base::hash_set<std::string>* groups) const;
+
protected:
virtual int WriteImpl(net::IOBuffer* io_buffer,
int io_buffer_size,
@@ -58,6 +67,8 @@ class UDPSocket : public Socket {
RecvFromCompletionCallback recv_from_callback_;
CompletionCallback send_to_callback_;
+
+ base::hash_set<std::string> multicast_groups_;
miket_OOO 2013/04/25 21:52:12 Why a hash_set and not a set?
Bei Zhang 2013/04/25 23:56:21 hash set is faster for strings. A vector would be
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698