Index: extensions/browser/api/socket/socket.h |
diff --git a/extensions/browser/api/socket/socket.h b/extensions/browser/api/socket/socket.h |
index dce5216f4cbe4e3c5ac664000f163ec0ddfdca38..e2287fe5c895434ec824de0613fce6e6203707ea 100644 |
--- a/extensions/browser/api/socket/socket.h |
+++ b/extensions/browser/api/socket/socket.h |
@@ -29,9 +29,10 @@ namespace extensions { |
typedef base::Callback<void(int)> CompletionCallback; |
typedef base::Callback<void(int, scoped_refptr<net::IOBuffer> io_buffer)> |
ReadCompletionCallback; |
-typedef base::Callback< |
- void(int, scoped_refptr<net::IOBuffer> io_buffer, const std::string&, int)> |
- RecvFromCompletionCallback; |
+typedef base::Callback<void(int, |
+ scoped_refptr<net::IOBuffer> io_buffer, |
+ const std::string&, |
+ uint16)> RecvFromCompletionCallback; |
typedef base::Callback<void(int, net::TCPClientSocket*)> |
AcceptCompletionCallback; |
@@ -58,10 +59,10 @@ class Socket : public ApiResource { |
// the remote endpoint. In order to upgrade this socket to TLS, callers |
// must also supply the hostname of the endpoint via set_hostname(). |
virtual void Connect(const std::string& address, |
- int port, |
+ uint16 port, |
const CompletionCallback& callback) = 0; |
virtual void Disconnect() = 0; |
- virtual int Bind(const std::string& address, int port) = 0; |
+ virtual int Bind(const std::string& address, uint16 port) = 0; |
// The |callback| will be called with the number of bytes read into the |
// buffer, or a negative number if an error occurred. |
@@ -78,13 +79,13 @@ class Socket : public ApiResource { |
virtual void SendTo(scoped_refptr<net::IOBuffer> io_buffer, |
int byte_count, |
const std::string& address, |
- int port, |
+ uint16 port, |
const CompletionCallback& callback) = 0; |
virtual bool SetKeepAlive(bool enable, int delay); |
virtual bool SetNoDelay(bool no_delay); |
virtual int Listen(const std::string& address, |
- int port, |
+ uint16 port, |
int backlog, |
std::string* error_msg); |
virtual void Accept(const AcceptCompletionCallback& callback); |
@@ -97,14 +98,14 @@ class Socket : public ApiResource { |
virtual SocketType GetSocketType() const = 0; |
static bool StringAndPortToAddressList(const std::string& ip_address_str, |
- int port, |
+ uint16 port, |
net::AddressList* address_list); |
static bool StringAndPortToIPEndPoint(const std::string& ip_address_str, |
- int port, |
+ uint16 port, |
net::IPEndPoint* ip_end_point); |
static void IPEndPointToStringAndPort(const net::IPEndPoint& address, |
std::string* ip_address_str, |
- int* port); |
+ uint16* port); |
protected: |
explicit Socket(const std::string& owner_extension_id_); |