| 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" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "net/url_request/redirect_info.h" | 36 #include "net/url_request/redirect_info.h" |
| 37 #include "net/url_request/url_request_context.h" | 37 #include "net/url_request/url_request_context.h" |
| 38 #include "net/url_request/url_request_error_job.h" | 38 #include "net/url_request/url_request_error_job.h" |
| 39 #include "net/url_request/url_request_job.h" | 39 #include "net/url_request/url_request_job.h" |
| 40 #include "net/url_request/url_request_job_manager.h" | 40 #include "net/url_request/url_request_job_manager.h" |
| 41 #include "net/url_request/url_request_netlog_params.h" | 41 #include "net/url_request/url_request_netlog_params.h" |
| 42 #include "net/url_request/url_request_redirect_job.h" | 42 #include "net/url_request/url_request_redirect_job.h" |
| 43 #include "url/gurl.h" | 43 #include "url/gurl.h" |
| 44 #include "url/origin.h" | 44 #include "url/origin.h" |
| 45 | 45 |
| 46 #include "base/trace_event/memory_allocator_dump.h" |
| 47 #include "base/trace_event/process_memory_dump.h" |
| 48 #include "base/strings/stringprintf.h" |
| 49 |
| 46 using base::Time; | 50 using base::Time; |
| 47 using std::string; | 51 using std::string; |
| 48 | 52 |
| 49 namespace net { | 53 namespace net { |
| 50 | 54 |
| 51 namespace { | 55 namespace { |
| 52 | 56 |
| 53 // Max number of http redirects to follow. Same number as gecko. | 57 // Max number of http redirects to follow. Same number as gecko. |
| 54 const int kMaxRedirects = 20; | 58 const int kMaxRedirects = 20; |
| 55 | 59 |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 net_log_.EndEvent(NetLogEventType::URL_REQUEST_DELEGATE); | 1210 net_log_.EndEvent(NetLogEventType::URL_REQUEST_DELEGATE); |
| 1207 } | 1211 } |
| 1208 | 1212 |
| 1209 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { | 1213 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { |
| 1210 if (job_) | 1214 if (job_) |
| 1211 job_->GetConnectionAttempts(out); | 1215 job_->GetConnectionAttempts(out); |
| 1212 else | 1216 else |
| 1213 out->clear(); | 1217 out->clear(); |
| 1214 } | 1218 } |
| 1215 | 1219 |
| 1220 void URLRequest::PopulateAllocatorDump( |
| 1221 base::trace_event::MemoryAllocatorDump* dump) const { |
| 1222 std::string name = |
| 1223 base::StringPrintf("%s/url_request/%p", dump->absolute_name().c_str(), thi
s); |
| 1224 base::trace_event::MemoryAllocatorDump* url_request_dump = |
| 1225 dump->process_memory_dump()->CreateAllocatorDump(name); |
| 1226 if (job_) { |
| 1227 DCHECK(url_request_dump); |
| 1228 //job_->PopulateAllocatorDump(url_request_dump); |
| 1229 } |
| 1230 } |
| 1231 |
| 1216 void URLRequest::set_status(URLRequestStatus status) { | 1232 void URLRequest::set_status(URLRequestStatus status) { |
| 1217 DCHECK(status_.is_io_pending() || status_.is_success() || | 1233 DCHECK(status_.is_io_pending() || status_.is_success() || |
| 1218 (!status.is_success() && !status.is_io_pending())); | 1234 (!status.is_success() && !status.is_io_pending())); |
| 1219 status_ = status; | 1235 status_ = status; |
| 1220 } | 1236 } |
| 1221 | 1237 |
| 1222 } // namespace net | 1238 } // namespace net |
| OLD | NEW |