OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 delegate_(delegate), | 145 delegate_(delegate), |
146 is_pending_(false), | 146 is_pending_(false), |
147 redirect_limit_(kMaxRedirects), | 147 redirect_limit_(kMaxRedirects), |
148 final_upload_progress_(0), | 148 final_upload_progress_(0), |
149 priority_(LOWEST), | 149 priority_(LOWEST), |
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 SIMPLE_STATS_COUNTER("URLRequestCount"); | 157 SIMPLE_STATS_COUNTER("URLRequestCount"); |
157 | 158 |
158 // Sanity check out environment. | 159 // Sanity check out environment. |
159 DCHECK(MessageLoop::current()) << | 160 DCHECK(MessageLoop::current()) << |
160 "The current MessageLoop must exist"; | 161 "The current MessageLoop must exist"; |
161 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << | 162 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << |
162 "The current MessageLoop must be TYPE_IO"; | 163 "The current MessageLoop must be TYPE_IO"; |
163 } | 164 } |
164 | 165 |
165 URLRequest::~URLRequest() { | 166 URLRequest::~URLRequest() { |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 | 895 |
895 void URLRequest::SetUnblockedOnDelegate() { | 896 void URLRequest::SetUnblockedOnDelegate() { |
896 if (!blocked_on_delegate_) | 897 if (!blocked_on_delegate_) |
897 return; | 898 return; |
898 blocked_on_delegate_ = false; | 899 blocked_on_delegate_ = false; |
899 load_state_param_.clear(); | 900 load_state_param_.clear(); |
900 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); | 901 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); |
901 } | 902 } |
902 | 903 |
903 } // namespace net | 904 } // namespace net |
OLD | NEW |