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/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 load_flags_(LOAD_NORMAL), | 140 load_flags_(LOAD_NORMAL), |
141 delegate_(delegate), | 141 delegate_(delegate), |
142 is_pending_(false), | 142 is_pending_(false), |
143 redirect_limit_(kMaxRedirects), | 143 redirect_limit_(kMaxRedirects), |
144 final_upload_progress_(0), | 144 final_upload_progress_(0), |
145 priority_(LOWEST), | 145 priority_(LOWEST), |
146 identifier_(GenerateURLRequestIdentifier()), | 146 identifier_(GenerateURLRequestIdentifier()), |
147 blocked_on_delegate_(false), | 147 blocked_on_delegate_(false), |
148 ALLOW_THIS_IN_INITIALIZER_LIST( | 148 ALLOW_THIS_IN_INITIALIZER_LIST( |
149 before_request_callback_(this, &URLRequest::BeforeRequestComplete)), | 149 before_request_callback_(this, &URLRequest::BeforeRequestComplete)), |
150 has_notified_completion_(false) { | 150 has_notified_completion_(false), |
| 151 start_time_(base::TimeTicks::Now()) { |
151 SIMPLE_STATS_COUNTER("URLRequestCount"); | 152 SIMPLE_STATS_COUNTER("URLRequestCount"); |
152 | 153 |
153 // Sanity check out environment. | 154 // Sanity check out environment. |
154 DCHECK(MessageLoop::current()) << | 155 DCHECK(MessageLoop::current()) << |
155 "The current MessageLoop must exist"; | 156 "The current MessageLoop must exist"; |
156 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << | 157 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << |
157 "The current MessageLoop must be TYPE_IO"; | 158 "The current MessageLoop must be TYPE_IO"; |
158 } | 159 } |
159 | 160 |
160 URLRequest::~URLRequest() { | 161 URLRequest::~URLRequest() { |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 | 878 |
878 void URLRequest::SetUnblockedOnDelegate() { | 879 void URLRequest::SetUnblockedOnDelegate() { |
879 if (!blocked_on_delegate_) | 880 if (!blocked_on_delegate_) |
880 return; | 881 return; |
881 blocked_on_delegate_ = false; | 882 blocked_on_delegate_ = false; |
882 load_state_param_.clear(); | 883 load_state_param_.clear(); |
883 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); | 884 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); |
884 } | 885 } |
885 | 886 |
886 } // namespace net | 887 } // namespace net |
OLD | NEW |