| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/browser/api/socket/tls_socket.h" | 5 #include "extensions/browser/api/socket/tls_socket.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "extensions/browser/api/api_resource.h" | 9 #include "extensions/browser/api/api_resource.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 TLSSocket::TLSSocket(scoped_ptr<net::StreamSocket> tls_socket, | 71 TLSSocket::TLSSocket(scoped_ptr<net::StreamSocket> tls_socket, |
| 72 const std::string& owner_extension_id) | 72 const std::string& owner_extension_id) |
| 73 : ResumableTCPSocket(owner_extension_id), tls_socket_(tls_socket.Pass()) { | 73 : ResumableTCPSocket(owner_extension_id), tls_socket_(tls_socket.Pass()) { |
| 74 } | 74 } |
| 75 | 75 |
| 76 TLSSocket::~TLSSocket() { | 76 TLSSocket::~TLSSocket() { |
| 77 Disconnect(); | 77 Disconnect(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void TLSSocket::Connect(const std::string& address, | 80 void TLSSocket::Connect(const std::string& address, |
| 81 int port, | 81 uint16 port, |
| 82 const CompletionCallback& callback) { | 82 const CompletionCallback& callback) { |
| 83 callback.Run(net::ERR_CONNECTION_FAILED); | 83 callback.Run(net::ERR_CONNECTION_FAILED); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void TLSSocket::Disconnect() { | 86 void TLSSocket::Disconnect() { |
| 87 if (tls_socket_) { | 87 if (tls_socket_) { |
| 88 tls_socket_->Disconnect(); | 88 tls_socket_->Disconnect(); |
| 89 tls_socket_.reset(); | 89 tls_socket_.reset(); |
| 90 } | 90 } |
| 91 } | 91 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 bool TLSSocket::SetKeepAlive(bool enable, int delay) { | 142 bool TLSSocket::SetKeepAlive(bool enable, int delay) { |
| 143 return false; | 143 return false; |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool TLSSocket::SetNoDelay(bool no_delay) { | 146 bool TLSSocket::SetNoDelay(bool no_delay) { |
| 147 return false; | 147 return false; |
| 148 } | 148 } |
| 149 | 149 |
| 150 int TLSSocket::Listen(const std::string& address, | 150 int TLSSocket::Listen(const std::string& address, |
| 151 int port, | 151 uint16 port, |
| 152 int backlog, | 152 int backlog, |
| 153 std::string* error_msg) { | 153 std::string* error_msg) { |
| 154 *error_msg = kTLSSocketTypeInvalidError; | 154 *error_msg = kTLSSocketTypeInvalidError; |
| 155 return net::ERR_NOT_IMPLEMENTED; | 155 return net::ERR_NOT_IMPLEMENTED; |
| 156 } | 156 } |
| 157 | 157 |
| 158 void TLSSocket::Accept(const AcceptCompletionCallback& callback) { | 158 void TLSSocket::Accept(const AcceptCompletionCallback& callback) { |
| 159 callback.Run(net::ERR_FAILED, NULL); | 159 callback.Run(net::ERR_FAILED, NULL); |
| 160 } | 160 } |
| 161 | 161 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 if (status != net::OK) { | 300 if (status != net::OK) { |
| 301 DVLOG(1) << "Status is not OK or IO-pending: " | 301 DVLOG(1) << "Status is not OK or IO-pending: " |
| 302 << net::ErrorToString(status); | 302 << net::ErrorToString(status); |
| 303 } | 303 } |
| 304 connect_cb.Run(status); | 304 connect_cb.Run(status); |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace extensions | 308 } // namespace extensions |
| 309 | 309 |
| OLD | NEW |