Chromium Code Reviews| 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 027b6eec80de25f8e6cc123d851b3b003ea6eaa4..8c4e4841968f313bf7a7ce2fff23325c926d13e0 100644 |
| --- a/chrome/browser/extensions/api/socket/socket_api.h |
| +++ b/chrome/browser/extensions/api/socket/socket_api.h |
| @@ -7,30 +7,37 @@ |
| #include "base/memory/ref_counted.h" |
| #include "chrome/browser/extensions/api/api_function.h" |
| +#include "chrome/browser/extensions/api/api_resource_manager.h" |
| #include "chrome/common/extensions/api/experimental_socket.h" |
| #include "net/base/address_list.h" |
| #include "net/base/host_resolver.h" |
| #include <string> |
| +class IOThread; |
| + |
| namespace net { |
| class IOBuffer; |
| } |
| -class IOThread; |
| - |
| namespace extensions { |
| -class APIResourceController; |
| -class APIResourceEventNotifier; |
| +class ApiResourceEventNotifier; |
| +class Socket; |
| + |
| +class SocketExtensionFunction : public AsyncApiFunction { |
|
asargent_no_longer_on_chrome
2012/07/16 18:08:25
would it make sense to name this "SocketAsyncApiFu
miket_OOO
2012/07/16 19:46:02
Done, and confirmed that usb devices are following
|
| + public: |
| + SocketExtensionFunction(); |
| -class SocketExtensionFunction : public AsyncAPIFunction { |
| protected: |
| - virtual ~SocketExtensionFunction() {} |
| + virtual ~SocketExtensionFunction(); |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| + virtual bool PrePrepare() OVERRIDE; |
| virtual void Work() OVERRIDE; |
| virtual bool Respond() OVERRIDE; |
| + |
| + ApiResourceManager<Socket>* manager_; |
| }; |
| class SocketExtensionWithDnsLookupFunction : public SocketExtensionFunction { |
| @@ -64,7 +71,7 @@ class SocketCreateFunction : public SocketExtensionFunction { |
| protected: |
| virtual ~SocketCreateFunction(); |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void Work() OVERRIDE; |
| @@ -78,7 +85,7 @@ class SocketCreateFunction : public SocketExtensionFunction { |
| scoped_ptr<api::experimental_socket::Create::Params> params_; |
| SocketType socket_type_; |
| int src_id_; |
| - APIResourceEventNotifier* event_notifier_; |
| + ApiResourceEventNotifier* event_notifier_; |
| }; |
| class SocketDestroyFunction : public SocketExtensionFunction { |
| @@ -88,7 +95,7 @@ class SocketDestroyFunction : public SocketExtensionFunction { |
| protected: |
| virtual ~SocketDestroyFunction() {} |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void Work() OVERRIDE; |
| @@ -105,7 +112,7 @@ class SocketConnectFunction : public SocketExtensionWithDnsLookupFunction { |
| protected: |
| virtual ~SocketConnectFunction(); |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void AsyncWorkStart() OVERRIDE; |
| @@ -128,7 +135,7 @@ class SocketDisconnectFunction : public SocketExtensionFunction { |
| protected: |
| virtual ~SocketDisconnectFunction() {} |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void Work() OVERRIDE; |
| @@ -143,7 +150,7 @@ class SocketBindFunction : public SocketExtensionFunction { |
| protected: |
| virtual ~SocketBindFunction() {} |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void Work() OVERRIDE; |
| @@ -162,7 +169,7 @@ class SocketReadFunction : public SocketExtensionFunction { |
| protected: |
| virtual ~SocketReadFunction(); |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void AsyncWorkStart() OVERRIDE; |
| void OnCompleted(int result, scoped_refptr<net::IOBuffer> io_buffer); |
| @@ -180,7 +187,7 @@ class SocketWriteFunction : public SocketExtensionFunction { |
| protected: |
| virtual ~SocketWriteFunction(); |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void AsyncWorkStart() OVERRIDE; |
| void OnCompleted(int result); |
| @@ -200,7 +207,7 @@ class SocketRecvFromFunction : public SocketExtensionFunction { |
| protected: |
| virtual ~SocketRecvFromFunction(); |
| - // AsyncAPIFunction |
| + // AsyncApiFunction |
| virtual bool Prepare() OVERRIDE; |
| virtual void AsyncWorkStart() OVERRIDE; |
| void OnCompleted(int result, |
| @@ -221,7 +228,7 @@ class SocketSendToFunction : public SocketExtensionWithDnsLookupFunction { |
| protected: |
| virtual ~SocketSendToFunction(); |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void AsyncWorkStart() OVERRIDE; |
| void OnCompleted(int result); |
| @@ -248,7 +255,7 @@ class SocketSetKeepAliveFunction : public SocketExtensionFunction { |
| protected: |
| virtual ~SocketSetKeepAliveFunction(); |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void Work() OVERRIDE; |
| @@ -265,7 +272,7 @@ class SocketSetNoDelayFunction : public SocketExtensionFunction { |
| protected: |
| virtual ~SocketSetNoDelayFunction(); |
| - // AsyncAPIFunction: |
| + // AsyncApiFunction: |
| virtual bool Prepare() OVERRIDE; |
| virtual void Work() OVERRIDE; |