| 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/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/base/upload_progress.h" | 10 #include "net/base/upload_progress.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 int DevToolsNetworkTransaction::RestartIgnoringLastError( | 164 int DevToolsNetworkTransaction::RestartIgnoringLastError( |
| 165 const net::CompletionCallback& callback) { | 165 const net::CompletionCallback& callback) { |
| 166 if (failed_) | 166 if (failed_) |
| 167 return net::ERR_INTERNET_DISCONNECTED; | 167 return net::ERR_INTERNET_DISCONNECTED; |
| 168 int rv = network_transaction_->RestartIgnoringLastError(proxy_callback_); | 168 int rv = network_transaction_->RestartIgnoringLastError(proxy_callback_); |
| 169 return SetupCallback(callback, rv, RESTART_IGNORING_LAST_ERROR); | 169 return SetupCallback(callback, rv, RESTART_IGNORING_LAST_ERROR); |
| 170 } | 170 } |
| 171 | 171 |
| 172 int DevToolsNetworkTransaction::RestartWithCertificate( | 172 int DevToolsNetworkTransaction::RestartWithCertificate( |
| 173 net::X509Certificate* client_cert, | 173 net::X509Certificate* client_cert, |
| 174 net::SSLPrivateKey* client_private_key, |
| 174 const net::CompletionCallback& callback) { | 175 const net::CompletionCallback& callback) { |
| 175 if (failed_) | 176 if (failed_) |
| 176 return net::ERR_INTERNET_DISCONNECTED; | 177 return net::ERR_INTERNET_DISCONNECTED; |
| 177 int rv = network_transaction_->RestartWithCertificate( | 178 int rv = network_transaction_->RestartWithCertificate( |
| 178 client_cert, proxy_callback_); | 179 client_cert, client_private_key, proxy_callback_); |
| 179 return SetupCallback(callback, rv, RESTART_WITH_CERTIFICATE); | 180 return SetupCallback(callback, rv, RESTART_WITH_CERTIFICATE); |
| 180 } | 181 } |
| 181 | 182 |
| 182 int DevToolsNetworkTransaction::RestartWithAuth( | 183 int DevToolsNetworkTransaction::RestartWithAuth( |
| 183 const net::AuthCredentials& credentials, | 184 const net::AuthCredentials& credentials, |
| 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_->RestartWithAuth(credentials, proxy_callback_); | 188 int rv = network_transaction_->RestartWithAuth(credentials, proxy_callback_); |
| 188 return SetupCallback(callback, rv, RESTART_WITH_AUTH); | 189 return SetupCallback(callback, rv, RESTART_WITH_AUTH); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 } | 279 } |
| 279 | 280 |
| 280 void DevToolsNetworkTransaction::FireThrottledCallback() { | 281 void DevToolsNetworkTransaction::FireThrottledCallback() { |
| 281 DCHECK(!callback_.is_null()); | 282 DCHECK(!callback_.is_null()); |
| 282 DCHECK(callback_type_ == READ || callback_type_ == START); | 283 DCHECK(callback_type_ == READ || callback_type_ == START); |
| 283 net::CompletionCallback callback = callback_; | 284 net::CompletionCallback callback = callback_; |
| 284 callback_.Reset(); | 285 callback_.Reset(); |
| 285 callback_type_ = NONE; | 286 callback_type_ = NONE; |
| 286 callback.Run(throttled_result_); | 287 callback.Run(throttled_result_); |
| 287 } | 288 } |
| OLD | NEW |