| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
| 15 #include "base/profiler/scoped_tracker.h" | 15 #include "base/profiler/scoped_tracker.h" |
| 16 #include "base/rand_util.h" | 16 #include "base/rand_util.h" |
| 17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
| 18 #include "base/strings/stringprintf.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 19 #include "base/synchronization/lock.h" | 20 #include "base/synchronization/lock.h" |
| 20 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
| 22 #include "base/trace_event/memory_allocator_dump.h" |
| 23 #include "base/trace_event/process_memory_dump.h" |
| 21 #include "base/values.h" | 24 #include "base/values.h" |
| 22 #include "net/base/auth.h" | 25 #include "net/base/auth.h" |
| 23 #include "net/base/host_port_pair.h" | 26 #include "net/base/host_port_pair.h" |
| 24 #include "net/base/load_flags.h" | 27 #include "net/base/load_flags.h" |
| 25 #include "net/base/load_timing_info.h" | 28 #include "net/base/load_timing_info.h" |
| 26 #include "net/base/net_errors.h" | 29 #include "net/base/net_errors.h" |
| 27 #include "net/base/network_change_notifier.h" | 30 #include "net/base/network_change_notifier.h" |
| 28 #include "net/base/network_delegate.h" | 31 #include "net/base/network_delegate.h" |
| 29 #include "net/base/upload_data_stream.h" | 32 #include "net/base/upload_data_stream.h" |
| 30 #include "net/http/http_response_headers.h" | 33 #include "net/http/http_response_headers.h" |
| (...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 net_log_.EndEvent(NetLogEventType::URL_REQUEST_DELEGATE); | 1210 net_log_.EndEvent(NetLogEventType::URL_REQUEST_DELEGATE); |
| 1208 } | 1211 } |
| 1209 | 1212 |
| 1210 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { | 1213 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { |
| 1211 if (job_) | 1214 if (job_) |
| 1212 job_->GetConnectionAttempts(out); | 1215 job_->GetConnectionAttempts(out); |
| 1213 else | 1216 else |
| 1214 out->clear(); | 1217 out->clear(); |
| 1215 } | 1218 } |
| 1216 | 1219 |
| 1220 void URLRequest::DumpMemoryStats( |
| 1221 base::trace_event::MemoryAllocatorDump* dump) const { |
| 1222 if (!job_) |
| 1223 return; |
| 1224 base::trace_event::MemoryAllocatorDump* url_request_dump = |
| 1225 dump->process_memory_dump()->CreateAllocatorDump(base::StringPrintf( |
| 1226 "%s/url_request_%p", dump->absolute_name().c_str(), this)); |
| 1227 job_->DumpMemoryStats(url_request_dump); |
| 1228 } |
| 1229 |
| 1217 void URLRequest::set_status(URLRequestStatus status) { | 1230 void URLRequest::set_status(URLRequestStatus status) { |
| 1218 DCHECK(status_.is_io_pending() || status_.is_success() || | 1231 DCHECK(status_.is_io_pending() || status_.is_success() || |
| 1219 (!status.is_success() && !status.is_io_pending())); | 1232 (!status.is_success() && !status.is_io_pending())); |
| 1220 status_ = status; | 1233 status_ = status; |
| 1221 } | 1234 } |
| 1222 | 1235 |
| 1223 } // namespace net | 1236 } // namespace net |
| OLD | NEW |