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

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

Issue 10827390: Implement chrome.socket.bind/listen/accept for TCP server socket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/socket/socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/socket/socket.h
diff --git a/chrome/browser/extensions/api/socket/socket.h b/chrome/browser/extensions/api/socket/socket.h
index 27e2685fe505d91410a9ef07c4bfc338a6abb1d3..404b06438aecd7fb024f35b499713ac3337219f3 100644
--- a/chrome/browser/extensions/api/socket/socket.h
+++ b/chrome/browser/extensions/api/socket/socket.h
@@ -15,6 +15,7 @@
#include "net/base/completion_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
+#include "net/socket/tcp_client_socket.h"
namespace net {
class AddressList;
@@ -30,6 +31,8 @@ typedef base::Callback<void(int, scoped_refptr<net::IOBuffer> io_buffer)>
typedef base::Callback<
void(int, scoped_refptr<net::IOBuffer> io_buffer, const std::string&, int)>
RecvFromCompletionCallback;
+typedef base::Callback<
+ void(int, net::TCPClientSocket*)> AcceptCompletionCallback;
// A Socket wraps a low-level socket and includes housekeeping information that
// we need to manage it in the context of an extension.
@@ -68,6 +71,9 @@ class Socket : public ApiResource {
virtual bool SetKeepAlive(bool enable, int delay);
virtual bool SetNoDelay(bool no_delay);
+ virtual int Listen(const std::string& address, int port, int backlog,
+ std::string* error_msg);
+ virtual void Accept(const AcceptCompletionCallback &callback);
bool IsConnected();
« no previous file with comments | « no previous file | chrome/browser/extensions/api/socket/socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698