Chromium Code Reviews| 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 a91a45044b34f1d2eb81bd37dc2efbeb5ac0385d..cdd712f0bc0f2e9bbc79d0172484a26a8e5af8f2 100644 |
| --- a/chrome/browser/extensions/api/socket/socket.h |
| +++ b/chrome/browser/extensions/api/socket/socket.h |
| @@ -35,6 +35,12 @@ typedef base::Callback< |
| // we need to manage it in the context of an extension. |
| class Socket : public ApiResource { |
| public: |
| + enum SocketType { |
| + TYPE_NONE = 0, |
|
Mihai Parparita -not on Chrome
2012/08/10 00:16:16
I don't see this used anywhere. It seems preferabl
Peng
2012/08/13 16:26:10
Done.
|
| + TYPE_TCP, |
| + TYPE_UDP, |
| + }; |
| + |
| virtual ~Socket(); |
| virtual void Connect(const std::string& address, |
| int port, |
| @@ -65,11 +71,12 @@ class Socket : public ApiResource { |
| virtual bool SetNoDelay(bool no_delay); |
| bool IsConnected(); |
| - virtual bool IsTCPSocket() = 0; |
| virtual bool GetPeerAddress(net::IPEndPoint* address) = 0; |
| virtual bool GetLocalAddress(net::IPEndPoint* address) = 0; |
| + virtual SocketType socket_type() const = 0; |
| + |
| static bool StringAndPortToAddressList(const std::string& ip_address_str, |
| int port, |
| net::AddressList* address_list); |