Index: chrome/browser/extensions/api/socket/tcp_socket.cc |
diff --git a/chrome/browser/extensions/api/socket/tcp_socket.cc b/chrome/browser/extensions/api/socket/tcp_socket.cc |
index 4f9273468ab31690db5401025e197e63b9aa6cb3..3f5d3a205e331ae485b9e1ea30620a1bc139169b 100644 |
--- a/chrome/browser/extensions/api/socket/tcp_socket.cc |
+++ b/chrome/browser/extensions/api/socket/tcp_socket.cc |
@@ -306,6 +306,31 @@ void TCPSocket::OnAccept(int result) { |
accept_callback_.Reset(); |
} |
+void TCPSocket::Release() { |
+ if (server_socket_.release() || accept_socket_.release()) { |
+ VLOG(1) << "TCPSocket::Release getting called in server mode."; |
Ryan Sleevi
2014/02/24 20:06:49
Question: Is this a (C++/Chromium) developer error
lally
2014/02/27 17:05:59
Good question. The only call site is within TLSSo
|
+ return; |
+ } |
+ |
+ // Release() doesn't disconnect the underlying sockets, but it does |
+ // disconnect them from this TCPSocket. |
+ is_connected_ = false; |
+ |
+ connect_callback_.Reset(); |
+ read_callback_.Reset(); |
+ accept_callback_.Reset(); |
+ |
+ if (socket_.release() == NULL && socket_mode_ == CLIENT) { |
+ VLOG(1) << "TCPSocket::Release on null client socket."; |
+ } |
+} |
+ |
+net::TCPClientSocket* TCPSocket::ClientStream() { |
+ if (socket_mode_ != CLIENT || GetSocketType() != TYPE_TCP) |
+ return NULL; |
+ return socket_.get(); |
+} |
+ |
ResumableTCPSocket::ResumableTCPSocket(const std::string& owner_extension_id) |
: TCPSocket(owner_extension_id), |
persistent_(false), |