| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 identifier_(GenerateURLRequestIdentifier()), | 150 identifier_(GenerateURLRequestIdentifier()), |
| 151 blocked_on_delegate_(false), | 151 blocked_on_delegate_(false), |
| 152 ALLOW_THIS_IN_INITIALIZER_LIST(before_request_callback_( | 152 ALLOW_THIS_IN_INITIALIZER_LIST(before_request_callback_( |
| 153 base::Bind(&URLRequest::BeforeRequestComplete, | 153 base::Bind(&URLRequest::BeforeRequestComplete, |
| 154 base::Unretained(this)))), | 154 base::Unretained(this)))), |
| 155 has_notified_completion_(false), | 155 has_notified_completion_(false), |
| 156 creation_time_(base::TimeTicks::Now()) { | 156 creation_time_(base::TimeTicks::Now()) { |
| 157 SIMPLE_STATS_COUNTER("URLRequestCount"); | 157 SIMPLE_STATS_COUNTER("URLRequestCount"); |
| 158 | 158 |
| 159 // Sanity check out environment. | 159 // Sanity check out environment. |
| 160 DCHECK(MessageLoop::current()) << | 160 DCHECK(MessageLoop::current()) << "The current MessageLoop must exist"; |
| 161 "The current MessageLoop must exist"; | 161 |
| 162 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << | 162 DCHECK(MessageLoop::current()->IsType(MessageLoop::TYPE_IO)) << "" |
| 163 "The current MessageLoop must be TYPE_IO"; | 163 "The current MessageLoop must be TYPE_IO"; |
| 164 | 164 |
| 165 CHECK(context); | 165 CHECK(context); |
| 166 context->url_requests()->insert(this); | 166 context->url_requests()->insert(this); |
| 167 | 167 |
| 168 net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE); | 168 net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE); |
| 169 } | 169 } |
| 170 | 170 |
| 171 URLRequest::~URLRequest() { | 171 URLRequest::~URLRequest() { |
| 172 Cancel(); | 172 Cancel(); |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 new base::debug::StackTrace(NULL, 0); | 904 new base::debug::StackTrace(NULL, 0); |
| 905 *stack_trace_copy = stack_trace; | 905 *stack_trace_copy = stack_trace; |
| 906 stack_trace_.reset(stack_trace_copy); | 906 stack_trace_.reset(stack_trace_copy); |
| 907 } | 907 } |
| 908 | 908 |
| 909 const base::debug::StackTrace* URLRequest::stack_trace() const { | 909 const base::debug::StackTrace* URLRequest::stack_trace() const { |
| 910 return stack_trace_.get(); | 910 return stack_trace_.get(); |
| 911 } | 911 } |
| 912 | 912 |
| 913 } // namespace net | 913 } // namespace net |
| OLD | NEW |