| 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.h" | 5 #include "net/url_request/url_request.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 // Caller is not too bright. I guess we've done what they asked. | 761 // Caller is not too bright. I guess we've done what they asked. |
| 762 return true; | 762 return true; |
| 763 } | 763 } |
| 764 | 764 |
| 765 // Once the request fails or is cancelled, read will just return 0 bytes | 765 // Once the request fails or is cancelled, read will just return 0 bytes |
| 766 // to indicate end of stream. | 766 // to indicate end of stream. |
| 767 if (!status_.is_success()) { | 767 if (!status_.is_success()) { |
| 768 return true; | 768 return true; |
| 769 } | 769 } |
| 770 | 770 |
| 771 // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed. |
| 772 tracked_objects::ScopedTracker tracking_profile1( |
| 773 FROM_HERE_WITH_EXPLICIT_FUNCTION("423948 URLRequest::Read1")); |
| 774 |
| 771 bool rv = job_->Read(dest, dest_size, bytes_read); | 775 bool rv = job_->Read(dest, dest_size, bytes_read); |
| 772 // If rv is false, the status cannot be success. | 776 // If rv is false, the status cannot be success. |
| 773 DCHECK(rv || status_.status() != URLRequestStatus::SUCCESS); | 777 DCHECK(rv || status_.status() != URLRequestStatus::SUCCESS); |
| 778 |
| 779 // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed. |
| 780 tracked_objects::ScopedTracker tracking_profile2( |
| 781 FROM_HERE_WITH_EXPLICIT_FUNCTION("423948 URLRequest::Read2")); |
| 782 |
| 774 if (rv && *bytes_read <= 0 && status_.is_success()) | 783 if (rv && *bytes_read <= 0 && status_.is_success()) |
| 775 NotifyRequestCompleted(); | 784 NotifyRequestCompleted(); |
| 776 return rv; | 785 return rv; |
| 777 } | 786 } |
| 778 | 787 |
| 779 void URLRequest::StopCaching() { | 788 void URLRequest::StopCaching() { |
| 780 DCHECK(job_.get()); | 789 DCHECK(job_.get()); |
| 781 job_->StopCaching(); | 790 job_->StopCaching(); |
| 782 } | 791 } |
| 783 | 792 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 new base::debug::StackTrace(NULL, 0); | 1234 new base::debug::StackTrace(NULL, 0); |
| 1226 *stack_trace_copy = stack_trace; | 1235 *stack_trace_copy = stack_trace; |
| 1227 stack_trace_.reset(stack_trace_copy); | 1236 stack_trace_.reset(stack_trace_copy); |
| 1228 } | 1237 } |
| 1229 | 1238 |
| 1230 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1239 const base::debug::StackTrace* URLRequest::stack_trace() const { |
| 1231 return stack_trace_.get(); | 1240 return stack_trace_.get(); |
| 1232 } | 1241 } |
| 1233 | 1242 |
| 1234 } // namespace net | 1243 } // namespace net |
| OLD | NEW |