Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: extensions/browser/api/socket/tls_socket.cc

Issue 1059973004: favor DCHECK_CURRENTLY_ON for better logs in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 // static 178 // static
179 void TLSSocket::UpgradeSocketToTLS( 179 void TLSSocket::UpgradeSocketToTLS(
180 Socket* socket, 180 Socket* socket,
181 scoped_refptr<net::SSLConfigService> ssl_config_service, 181 scoped_refptr<net::SSLConfigService> ssl_config_service,
182 net::CertVerifier* cert_verifier, 182 net::CertVerifier* cert_verifier,
183 net::TransportSecurityState* transport_security_state, 183 net::TransportSecurityState* transport_security_state,
184 const std::string& extension_id, 184 const std::string& extension_id,
185 core_api::socket::SecureOptions* options, 185 core_api::socket::SecureOptions* options,
186 const TLSSocket::SecureCallback& callback) { 186 const TLSSocket::SecureCallback& callback) {
187 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 187 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
188 TCPSocket* tcp_socket = static_cast<TCPSocket*>(socket); 188 TCPSocket* tcp_socket = static_cast<TCPSocket*>(socket);
189 scoped_ptr<net::SSLClientSocket> null_sock; 189 scoped_ptr<net::SSLClientSocket> null_sock;
190 190
191 if (!tcp_socket || tcp_socket->GetSocketType() != Socket::TYPE_TCP || 191 if (!tcp_socket || tcp_socket->GetSocketType() != Socket::TYPE_TCP ||
192 !tcp_socket->ClientStream() || !tcp_socket->IsConnected() || 192 !tcp_socket->ClientStream() || !tcp_socket->IsConnected() ||
193 tcp_socket->HasPendingRead()) { 193 tcp_socket->HasPendingRead()) {
194 DVLOG(1) << "Failing before trying. socket is " << tcp_socket; 194 DVLOG(1) << "Failing before trying. socket is " << tcp_socket;
195 if (tcp_socket) { 195 if (tcp_socket) {
196 DVLOG(1) << "type: " << tcp_socket->GetSocketType() 196 DVLOG(1) << "type: " << tcp_socket->GetSocketType()
197 << ", ClientStream is " << tcp_socket->ClientStream() 197 << ", ClientStream is " << tcp_socket->ClientStream()
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « extensions/browser/api/bluetooth_socket/bluetooth_socket_api.cc ('k') | extensions/browser/api/sockets_tcp/sockets_tcp_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698