| 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 "chrome/browser/devtools/devtools_network_transaction.h" | 5 #include "chrome/browser/devtools/devtools_network_transaction.h" |
| 6 | 6 |
| 7 #include "chrome/browser/devtools/devtools_network_controller.h" | 7 #include "chrome/browser/devtools/devtools_network_controller.h" |
| 8 #include "chrome/browser/devtools/devtools_network_interceptor.h" | 8 #include "chrome/browser/devtools/devtools_network_interceptor.h" |
| 9 #include "net/base/load_timing_info.h" | 9 #include "net/base/load_timing_info.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 int DevToolsNetworkTransaction::RestartIgnoringLastError( | 174 int DevToolsNetworkTransaction::RestartIgnoringLastError( |
| 175 const net::CompletionCallback& callback) { | 175 const net::CompletionCallback& callback) { |
| 176 if (failed_) | 176 if (failed_) |
| 177 return net::ERR_INTERNET_DISCONNECTED; | 177 return net::ERR_INTERNET_DISCONNECTED; |
| 178 int rv = network_transaction_->RestartIgnoringLastError(proxy_callback_); | 178 int rv = network_transaction_->RestartIgnoringLastError(proxy_callback_); |
| 179 return SetupCallback(callback, rv, RESTART_IGNORING_LAST_ERROR); | 179 return SetupCallback(callback, rv, RESTART_IGNORING_LAST_ERROR); |
| 180 } | 180 } |
| 181 | 181 |
| 182 int DevToolsNetworkTransaction::RestartWithCertificate( | 182 int DevToolsNetworkTransaction::RestartWithCertificate( |
| 183 net::X509Certificate* client_cert, | 183 net::X509Certificate* client_cert, |
| 184 net::SSLPrivateKey* client_private_key, |
| 184 const net::CompletionCallback& callback) { | 185 const net::CompletionCallback& callback) { |
| 185 if (failed_) | 186 if (failed_) |
| 186 return net::ERR_INTERNET_DISCONNECTED; | 187 return net::ERR_INTERNET_DISCONNECTED; |
| 187 int rv = network_transaction_->RestartWithCertificate( | 188 int rv = network_transaction_->RestartWithCertificate( |
| 188 client_cert, proxy_callback_); | 189 client_cert, client_private_key, proxy_callback_); |
| 189 return SetupCallback(callback, rv, RESTART_WITH_CERTIFICATE); | 190 return SetupCallback(callback, rv, RESTART_WITH_CERTIFICATE); |
| 190 } | 191 } |
| 191 | 192 |
| 192 int DevToolsNetworkTransaction::RestartWithAuth( | 193 int DevToolsNetworkTransaction::RestartWithAuth( |
| 193 const net::AuthCredentials& credentials, | 194 const net::AuthCredentials& credentials, |
| 194 const net::CompletionCallback& callback) { | 195 const net::CompletionCallback& callback) { |
| 195 if (failed_) | 196 if (failed_) |
| 196 return net::ERR_INTERNET_DISCONNECTED; | 197 return net::ERR_INTERNET_DISCONNECTED; |
| 197 int rv = network_transaction_->RestartWithAuth(credentials, proxy_callback_); | 198 int rv = network_transaction_->RestartWithAuth(credentials, proxy_callback_); |
| 198 return SetupCallback(callback, rv, RESTART_WITH_AUTH); | 199 return SetupCallback(callback, rv, RESTART_WITH_AUTH); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 294 } |
| 294 | 295 |
| 295 void DevToolsNetworkTransaction::ThrottleFinished() { | 296 void DevToolsNetworkTransaction::ThrottleFinished() { |
| 296 DCHECK(!callback_.is_null()); | 297 DCHECK(!callback_.is_null()); |
| 297 DCHECK(callback_type_ == READ || callback_type_ == START); | 298 DCHECK(callback_type_ == READ || callback_type_ == START); |
| 298 net::CompletionCallback callback = callback_; | 299 net::CompletionCallback callback = callback_; |
| 299 callback_.Reset(); | 300 callback_.Reset(); |
| 300 callback_type_ = NONE; | 301 callback_type_ = NONE; |
| 301 callback.Run(throttled_result_); | 302 callback.Run(throttled_result_); |
| 302 } | 303 } |
| OLD | NEW |