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

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

Issue 10134008: Add bind(), recvFrom(), sendTo() for UDP socket. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update Created 8 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/tcp_socket.h
diff --git a/chrome/browser/extensions/api/socket/tcp_socket.h b/chrome/browser/extensions/api/socket/tcp_socket.h
index 051abf45ea2c9c04c12cd5eae84ae7361a2ab53b..55ead13fd7d0cbdd0ec5bcaff26673fa2f7b2311 100644
--- a/chrome/browser/extensions/api/socket/tcp_socket.h
+++ b/chrome/browser/extensions/api/socket/tcp_socket.h
@@ -24,28 +24,32 @@ class APIResourceEventNotifier;
class TCPSocket : public Socket {
public:
- TCPSocket(const std::string& address, int port,
- APIResourceEventNotifier* event_notifier);
+ explicit TCPSocket(APIResourceEventNotifier* event_notifier);
virtual ~TCPSocket();
- virtual bool IsValid() OVERRIDE;
-
- virtual int Connect() OVERRIDE;
+ virtual int Connect(const std::string& address, int port) OVERRIDE;
virtual void Disconnect() OVERRIDE;
+ virtual int Bind(const std::string& address, int port) OVERRIDE;
+ virtual int Read(scoped_refptr<net::IOBuffer> io_buffer,
+ int io_buffer_size) OVERRIDE;
+ virtual int Write(scoped_refptr<net::IOBuffer> io_buffer,
+ int bytes) OVERRIDE;
+ virtual int RecvFrom(scoped_refptr<net::IOBuffer> io_buffer,
+ int io_buffer_size,
+ net::IPEndPoint *address) OVERRIDE;
+ virtual int SendTo(scoped_refptr<net::IOBuffer> io_buffer,
+ int byte_count,
+ const std::string& address,
+ int port) OVERRIDE;
virtual void OnConnect(int result);
static TCPSocket* CreateSocketForTesting(
net::TCPClientSocket* tcp_client_socket,
- const std::string& address, int port,
APIResourceEventNotifier* event_notifier);
- protected:
- virtual net::Socket* socket() OVERRIDE;
-
private:
TCPSocket(net::TCPClientSocket* tcp_client_socket,
- const std::string& address, int port,
APIResourceEventNotifier* event_notifier);
scoped_ptr<net::TCPClientSocket> socket_;
« no previous file with comments | « chrome/browser/extensions/api/socket/socket_api.cc ('k') | chrome/browser/extensions/api/socket/tcp_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698