| Index: chrome/browser/extensions/api/socket/socket_api.h
|
| diff --git a/chrome/browser/extensions/api/socket/socket_api.h b/chrome/browser/extensions/api/socket/socket_api.h
|
| index 69406f12ceec1981fb77d2b4bb287731d169bba5..48c3cad89c73581f0ddcfa00a8e4110ae283bf17 100644
|
| --- a/chrome/browser/extensions/api/socket/socket_api.h
|
| +++ b/chrome/browser/extensions/api/socket/socket_api.h
|
| @@ -11,6 +11,7 @@
|
| #include "chrome/common/extensions/api/socket.h"
|
| #include "net/base/address_list.h"
|
| #include "net/base/host_resolver.h"
|
| +#include "net/socket/tcp_client_socket.h"
|
|
|
| #include <string>
|
|
|
| @@ -159,6 +160,42 @@ class SocketBindFunction : public SocketAsyncApiFunction {
|
| int port_;
|
| };
|
|
|
| +class SocketListenFunction : public SocketAsyncApiFunction {
|
| + public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("socket.listen");
|
| +
|
| + protected:
|
| + virtual ~SocketListenFunction() {}
|
| +
|
| + // AsyncApiFunction:
|
| + virtual bool Prepare() OVERRIDE;
|
| + virtual void Work() OVERRIDE;
|
| +
|
| + private:
|
| + int socket_id_;
|
| + int backlog_;
|
| +};
|
| +
|
| +class SocketAcceptFunction : public SocketAsyncApiFunction {
|
| + public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("socket.accept");
|
| +
|
| + SocketAcceptFunction();
|
| +
|
| + protected:
|
| + virtual ~SocketAcceptFunction();
|
| +
|
| + // AsyncApiFunction:
|
| + virtual bool Prepare() OVERRIDE;
|
| + virtual void Work() OVERRIDE;
|
| +
|
| + private:
|
| + void OnAccept(int result_code, net::TCPClientSocket *socket);
|
| + scoped_ptr<api::socket::Accept::Params> params_;
|
| + ApiResourceEventNotifier* event_notifier_;
|
| + int src_id_;
|
| +};
|
| +
|
| class SocketReadFunction : public SocketAsyncApiFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION_NAME("socket.read")
|
|
|