| 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/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 load_flags_(LOAD_NORMAL), | 143 load_flags_(LOAD_NORMAL), |
| 144 delegate_(delegate), | 144 delegate_(delegate), |
| 145 is_pending_(false), | 145 is_pending_(false), |
| 146 redirect_limit_(kMaxRedirects), | 146 redirect_limit_(kMaxRedirects), |
| 147 final_upload_progress_(0), | 147 final_upload_progress_(0), |
| 148 priority_(LOWEST), | 148 priority_(LOWEST), |
| 149 identifier_(GenerateURLRequestIdentifier()), | 149 identifier_(GenerateURLRequestIdentifier()), |
| 150 blocked_on_delegate_(false), | 150 blocked_on_delegate_(false), |
| 151 ALLOW_THIS_IN_INITIALIZER_LIST( | 151 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 152 before_request_callback_(this, &URLRequest::BeforeRequestComplete)), | 152 before_request_callback_(this, &URLRequest::BeforeRequestComplete)), |
| 153 has_notified_completion_(false) { | 153 has_notified_completion_(false), |
| 154 start_time_(base::TimeTicks::Now()) { |
| 154 SIMPLE_STATS_COUNTER("URLRequestCount"); | 155 SIMPLE_STATS_COUNTER("URLRequestCount"); |
| 155 | 156 |
| 156 // Sanity check out environment. | 157 // Sanity check out environment. |
| 157 DCHECK(MessageLoop::current()) << | 158 DCHECK(MessageLoop::current()) << |
| 158 "The current MessageLoop must exist"; | 159 "The current MessageLoop must exist"; |
| 159 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << | 160 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << |
| 160 "The current MessageLoop must be TYPE_IO"; | 161 "The current MessageLoop must be TYPE_IO"; |
| 161 } | 162 } |
| 162 | 163 |
| 163 URLRequest::~URLRequest() { | 164 URLRequest::~URLRequest() { |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 | 893 |
| 893 void URLRequest::SetUnblockedOnDelegate() { | 894 void URLRequest::SetUnblockedOnDelegate() { |
| 894 if (!blocked_on_delegate_) | 895 if (!blocked_on_delegate_) |
| 895 return; | 896 return; |
| 896 blocked_on_delegate_ = false; | 897 blocked_on_delegate_ = false; |
| 897 load_state_param_.clear(); | 898 load_state_param_.clear(); |
| 898 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); | 899 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); |
| 899 } | 900 } |
| 900 | 901 |
| 901 } // namespace net | 902 } // namespace net |
| OLD | NEW |