| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/power_monitor/power_monitor.h" | 10 #include "base/power_monitor/power_monitor.h" |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 tracked_objects::ScopedTracker tracking_profile10( | 496 tracked_objects::ScopedTracker tracking_profile10( |
| 497 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 497 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 498 "423948 URLRequestJob::NotifyHeadersComplete 10")); | 498 "423948 URLRequestJob::NotifyHeadersComplete 10")); |
| 499 | 499 |
| 500 request_->NotifyResponseStarted(); | 500 request_->NotifyResponseStarted(); |
| 501 } | 501 } |
| 502 | 502 |
| 503 void URLRequestJob::NotifyReadComplete(int bytes_read) { | 503 void URLRequestJob::NotifyReadComplete(int bytes_read) { |
| 504 // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed. | 504 // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed. |
| 505 tracked_objects::ScopedTracker tracking_profile( | 505 tracked_objects::ScopedTracker tracking_profile( |
| 506 FROM_HERE_WITH_EXPLICIT_FUNCTION("URLRequestJob::NotifyReadComplete")); | 506 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 507 "423948 URLRequestJob::NotifyReadComplete")); |
| 507 | 508 |
| 508 if (!request_ || !request_->has_delegate()) | 509 if (!request_ || !request_->has_delegate()) |
| 509 return; // The request was destroyed, so there is no more work to do. | 510 return; // The request was destroyed, so there is no more work to do. |
| 510 | 511 |
| 511 // TODO(darin): Bug 1004233. Re-enable this test once all of the chrome | 512 // TODO(darin): Bug 1004233. Re-enable this test once all of the chrome |
| 512 // unit_tests have been fixed to not trip this. | 513 // unit_tests have been fixed to not trip this. |
| 513 #if 0 | 514 #if 0 |
| 514 DCHECK(!request_->status().is_io_pending()); | 515 DCHECK(!request_->status().is_io_pending()); |
| 515 #endif | 516 #endif |
| 516 // The headers should be complete before reads complete | 517 // The headers should be complete before reads complete |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). | 936 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). |
| 936 redirect_info.new_referrer = | 937 redirect_info.new_referrer = |
| 937 ComputeReferrerForRedirect(request_->referrer_policy(), | 938 ComputeReferrerForRedirect(request_->referrer_policy(), |
| 938 request_->referrer(), | 939 request_->referrer(), |
| 939 redirect_info.new_url).spec(); | 940 redirect_info.new_url).spec(); |
| 940 | 941 |
| 941 return redirect_info; | 942 return redirect_info; |
| 942 } | 943 } |
| 943 | 944 |
| 944 } // namespace net | 945 } // namespace net |
| OLD | NEW |