| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "chrome/browser/devtools/devtools_network_controller.h" | 10 #include "chrome/browser/devtools/devtools_network_controller.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 interceptor_->StopThrottle(throttle_callback_); | 38 interceptor_->StopThrottle(throttle_callback_); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void DevToolsNetworkTransaction::IOCallback( | 41 void DevToolsNetworkTransaction::IOCallback( |
| 42 const net::CompletionCallback& callback, bool start, int result) { | 42 const net::CompletionCallback& callback, bool start, int result) { |
| 43 result = Throttle(callback, start, result); | 43 result = Throttle(callback, start, result); |
| 44 if (result != net::ERR_IO_PENDING) | 44 if (result != net::ERR_IO_PENDING) |
| 45 callback.Run(result); | 45 callback.Run(result); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void DevToolsNetworkTransaction::Orphan( |
| 49 std::unique_ptr<HttpTransaction> trans) { |
| 50 NOTREACHED(); |
| 51 return; |
| 52 } |
| 53 |
| 48 int DevToolsNetworkTransaction::Throttle( | 54 int DevToolsNetworkTransaction::Throttle( |
| 49 const net::CompletionCallback& callback, bool start, int result) { | 55 const net::CompletionCallback& callback, bool start, int result) { |
| 50 if (failed_) | 56 if (failed_) |
| 51 return net::ERR_INTERNET_DISCONNECTED; | 57 return net::ERR_INTERNET_DISCONNECTED; |
| 52 if (!interceptor_ || result < 0) | 58 if (!interceptor_ || result < 0) |
| 53 return result; | 59 return result; |
| 54 | 60 |
| 55 base::TimeTicks send_end; | 61 base::TimeTicks send_end; |
| 56 if (start) { | 62 if (start) { |
| 57 throttled_byte_count_ += network_transaction_->GetTotalReceivedBytes(); | 63 throttled_byte_count_ += network_transaction_->GetTotalReceivedBytes(); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (CheckFailed()) | 297 if (CheckFailed()) |
| 292 return net::ERR_INTERNET_DISCONNECTED; | 298 return net::ERR_INTERNET_DISCONNECTED; |
| 293 return network_transaction_->ResumeNetworkStart(); | 299 return network_transaction_->ResumeNetworkStart(); |
| 294 } | 300 } |
| 295 | 301 |
| 296 void | 302 void |
| 297 DevToolsNetworkTransaction::GetConnectionAttempts(net::ConnectionAttempts* out) | 303 DevToolsNetworkTransaction::GetConnectionAttempts(net::ConnectionAttempts* out) |
| 298 const { | 304 const { |
| 299 network_transaction_->GetConnectionAttempts(out); | 305 network_transaction_->GetConnectionAttempts(out); |
| 300 } | 306 } |
| OLD | NEW |