| 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 3b5e835c2b490ff015f9597595702fd41cf91471..45f9ad6a217458cebb86b4d8511c21d78f6e9816 100644
|
| --- a/chrome/browser/extensions/api/socket/socket_api.h
|
| +++ b/chrome/browser/extensions/api/socket/socket_api.h
|
| @@ -9,9 +9,11 @@
|
| #include "chrome/browser/extensions/api/api_function.h"
|
| #include "chrome/browser/extensions/api/api_resource_manager.h"
|
| #include "chrome/browser/extensions/extension_function.h"
|
| +#include "chrome/common/extensions/api/experimental_socket.h"
|
| #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>
|
|
|
| @@ -164,6 +166,41 @@ class SocketBindFunction : public SocketAsyncApiFunction {
|
| int port_;
|
| };
|
|
|
| +class SocketListenFunction : public SocketAsyncApiFunction {
|
| + public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.socket.listen");
|
| +
|
| + SocketListenFunction();
|
| +
|
| + protected:
|
| + virtual ~SocketListenFunction();
|
| +
|
| + // AsyncApiFunction:
|
| + virtual bool Prepare() OVERRIDE;
|
| + virtual void Work() OVERRIDE;
|
| +
|
| + private:
|
| + scoped_ptr<api::experimental_socket::Listen::Params> params_;
|
| +};
|
| +
|
| +class SocketAcceptFunction : public SocketAsyncApiFunction {
|
| + public:
|
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.socket.accept");
|
| +
|
| + SocketAcceptFunction();
|
| +
|
| + protected:
|
| + virtual ~SocketAcceptFunction();
|
| +
|
| + // AsyncApiFunction:
|
| + virtual bool Prepare() OVERRIDE;
|
| + virtual void AsyncWorkStart() OVERRIDE;
|
| +
|
| + private:
|
| + void OnAccept(int result_code, net::TCPClientSocket *socket);
|
| + scoped_ptr<api::experimental_socket::Accept::Params> params_;
|
| +};
|
| +
|
| class SocketReadFunction : public SocketAsyncApiFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION_NAME("socket.read")
|
|
|