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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 346 |
347 return job_->GetFullRequestHeaders(headers); | 347 return job_->GetFullRequestHeaders(headers); |
348 } | 348 } |
349 | 349 |
350 LoadStateWithParam URLRequest::GetLoadState() const { | 350 LoadStateWithParam URLRequest::GetLoadState() const { |
351 // The !blocked_by_.empty() check allows |this| to report it's blocked on a | 351 // The !blocked_by_.empty() check allows |this| to report it's blocked on a |
352 // delegate before it has been started. | 352 // delegate before it has been started. |
353 if (calling_delegate_ || !blocked_by_.empty()) { | 353 if (calling_delegate_ || !blocked_by_.empty()) { |
354 return LoadStateWithParam( | 354 return LoadStateWithParam( |
355 LOAD_STATE_WAITING_FOR_DELEGATE, | 355 LOAD_STATE_WAITING_FOR_DELEGATE, |
356 use_blocked_by_as_load_param_ ? UTF8ToUTF16(blocked_by_) : | 356 use_blocked_by_as_load_param_ ? base::UTF8ToUTF16(blocked_by_) : |
357 base::string16()); | 357 base::string16()); |
358 } | 358 } |
359 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE, | 359 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE, |
360 base::string16()); | 360 base::string16()); |
361 } | 361 } |
362 | 362 |
363 base::Value* URLRequest::GetStateAsValue() const { | 363 base::Value* URLRequest::GetStateAsValue() const { |
364 base::DictionaryValue* dict = new base::DictionaryValue(); | 364 base::DictionaryValue* dict = new base::DictionaryValue(); |
365 dict->SetString("url", original_url().possibly_invalid_spec()); | 365 dict->SetString("url", original_url().possibly_invalid_spec()); |
366 | 366 |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 new base::debug::StackTrace(NULL, 0); | 1203 new base::debug::StackTrace(NULL, 0); |
1204 *stack_trace_copy = stack_trace; | 1204 *stack_trace_copy = stack_trace; |
1205 stack_trace_.reset(stack_trace_copy); | 1205 stack_trace_.reset(stack_trace_copy); |
1206 } | 1206 } |
1207 | 1207 |
1208 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1208 const base::debug::StackTrace* URLRequest::stack_trace() const { |
1209 return stack_trace_.get(); | 1209 return stack_trace_.get(); |
1210 } | 1210 } |
1211 | 1211 |
1212 } // namespace net | 1212 } // namespace net |
OLD | NEW |