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::ProcessMemoryDump* pmd, |
| 1222 const std::string& parent_dump_absolute_name) const { |
| 1223 if (!job_) |
| 1224 return; |
| 1225 base::trace_event::MemoryAllocatorDump* url_request_dump = |
| 1226 pmd->CreateAllocatorDump(base::StringPrintf( |
| 1227 "%s/url_request_%p", parent_dump_absolute_name.c_str(), this)); |
| 1228 job_->DumpMemoryStats(pmd, url_request_dump->absolute_name()); |
| 1229 } |
| 1230 |
1217 void URLRequest::set_status(URLRequestStatus status) { | 1231 void URLRequest::set_status(URLRequestStatus status) { |
1218 DCHECK(status_.is_io_pending() || status_.is_success() || | 1232 DCHECK(status_.is_io_pending() || status_.is_success() || |
1219 (!status.is_success() && !status.is_io_pending())); | 1233 (!status.is_success() && !status.is_io_pending())); |
1220 status_ = status; | 1234 status_ = status; |
1221 } | 1235 } |
1222 | 1236 |
1223 } // namespace net | 1237 } // namespace net |
OLD | NEW |