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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 } | 260 } |
261 | 261 |
262 int64 URLRequest::GetTotalReceivedBytes() const { | 262 int64 URLRequest::GetTotalReceivedBytes() const { |
263 if (!job_.get()) | 263 if (!job_.get()) |
264 return 0; | 264 return 0; |
265 | 265 |
266 return job_->GetTotalReceivedBytes(); | 266 return job_->GetTotalReceivedBytes(); |
267 } | 267 } |
268 | 268 |
269 LoadStateWithParam URLRequest::GetLoadState() const { | 269 LoadStateWithParam URLRequest::GetLoadState() const { |
| 270 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455952 is |
| 271 // fixed. |
| 272 tracked_objects::ScopedTracker tracking_profile( |
| 273 FROM_HERE_WITH_EXPLICIT_FUNCTION("455952 URLRequest::GetLoadState")); |
270 // The !blocked_by_.empty() check allows |this| to report it's blocked on a | 274 // The !blocked_by_.empty() check allows |this| to report it's blocked on a |
271 // delegate before it has been started. | 275 // delegate before it has been started. |
272 if (calling_delegate_ || !blocked_by_.empty()) { | 276 if (calling_delegate_ || !blocked_by_.empty()) { |
273 return LoadStateWithParam( | 277 return LoadStateWithParam( |
274 LOAD_STATE_WAITING_FOR_DELEGATE, | 278 LOAD_STATE_WAITING_FOR_DELEGATE, |
275 use_blocked_by_as_load_param_ ? base::UTF8ToUTF16(blocked_by_) : | 279 use_blocked_by_as_load_param_ ? base::UTF8ToUTF16(blocked_by_) : |
276 base::string16()); | 280 base::string16()); |
277 } | 281 } |
278 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE, | 282 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE, |
279 base::string16()); | 283 base::string16()); |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 new base::debug::StackTrace(NULL, 0); | 1218 new base::debug::StackTrace(NULL, 0); |
1215 *stack_trace_copy = stack_trace; | 1219 *stack_trace_copy = stack_trace; |
1216 stack_trace_.reset(stack_trace_copy); | 1220 stack_trace_.reset(stack_trace_copy); |
1217 } | 1221 } |
1218 | 1222 |
1219 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1223 const base::debug::StackTrace* URLRequest::stack_trace() const { |
1220 return stack_trace_.get(); | 1224 return stack_trace_.get(); |
1221 } | 1225 } |
1222 | 1226 |
1223 } // namespace net | 1227 } // namespace net |
OLD | NEW |