| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/url_request/url_request_job.h" | 5 #include "net/url_request/url_request_job.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 333 |
| 334 int URLRequestJob::GetResponseCode() const { | 334 int URLRequestJob::GetResponseCode() const { |
| 335 return -1; | 335 return -1; |
| 336 } | 336 } |
| 337 | 337 |
| 338 HostPortPair URLRequestJob::GetSocketAddress() const { | 338 HostPortPair URLRequestJob::GetSocketAddress() const { |
| 339 return HostPortPair(); | 339 return HostPortPair(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 void URLRequestJob::OnSuspend() { | 342 void URLRequestJob::OnSuspend() { |
| 343 LOG(ERROR) << __func__; |
| 344 |
| 343 // Most errors generated by the Job come as the result of the one current | 345 // Most errors generated by the Job come as the result of the one current |
| 344 // operation the job is waiting on returning an error. This event is unusual | 346 // operation the job is waiting on returning an error. This event is unusual |
| 345 // in that the Job may have another operation ongoing, or the Job may be idle | 347 // in that the Job may have another operation ongoing, or the Job may be idle |
| 346 // and waiting on the next call. | 348 // and waiting on the next call. |
| 347 // | 349 // |
| 348 // Need to cancel through the request to make sure everything is notified | 350 // Need to cancel through the request to make sure everything is notified |
| 349 // of the failure (Particularly that the NetworkDelegate, which the Job may be | 351 // of the failure (Particularly that the NetworkDelegate, which the Job may be |
| 350 // waiting on, is notified synchronously) and torn down correctly. | 352 // waiting on, is notified synchronously) and torn down correctly. |
| 351 // | 353 // |
| 352 // TODO(mmenke): This should probably fail the request with | 354 // TODO(mmenke): This should probably fail the request with |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 int64_t total_sent_bytes = GetTotalSentBytes(); | 1004 int64_t total_sent_bytes = GetTotalSentBytes(); |
| 1003 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); | 1005 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); |
| 1004 if (total_sent_bytes > last_notified_total_sent_bytes_) { | 1006 if (total_sent_bytes > last_notified_total_sent_bytes_) { |
| 1005 network_delegate_->NotifyNetworkBytesSent( | 1007 network_delegate_->NotifyNetworkBytesSent( |
| 1006 request_, total_sent_bytes - last_notified_total_sent_bytes_); | 1008 request_, total_sent_bytes - last_notified_total_sent_bytes_); |
| 1007 } | 1009 } |
| 1008 last_notified_total_sent_bytes_ = total_sent_bytes; | 1010 last_notified_total_sent_bytes_ = total_sent_bytes; |
| 1009 } | 1011 } |
| 1010 | 1012 |
| 1011 } // namespace net | 1013 } // namespace net |
| OLD | NEW |