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 "content/browser/loader/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 if (login_delegate_.get()) | 156 if (login_delegate_.get()) |
157 login_delegate_->OnRequestCancelled(); | 157 login_delegate_->OnRequestCancelled(); |
158 ssl_client_auth_handler_.reset(); | 158 ssl_client_auth_handler_.reset(); |
159 | 159 |
160 // Run ResourceHandler destructor before we tear-down the rest of our state | 160 // Run ResourceHandler destructor before we tear-down the rest of our state |
161 // as the ResourceHandler may want to inspect the URLRequest and other state. | 161 // as the ResourceHandler may want to inspect the URLRequest and other state. |
162 handler_.reset(); | 162 handler_.reset(); |
163 } | 163 } |
164 | 164 |
165 void ResourceLoader::StartRequest() { | 165 void ResourceLoader::StartRequest() { |
166 if (delegate_->HandleExternalProtocol(this, request_->url())) { | |
167 CancelAndIgnore(); | |
168 return; | |
169 } | |
170 | |
171 // Give the handler a chance to delay the URLRequest from being started. | 166 // Give the handler a chance to delay the URLRequest from being started. |
172 bool defer_start = false; | 167 bool defer_start = false; |
173 if (!handler_->OnWillStart(request_->url(), &defer_start)) { | 168 if (!handler_->OnWillStart(request_->url(), &defer_start)) { |
174 Cancel(); | 169 Cancel(); |
175 return; | 170 return; |
176 } | 171 } |
177 | 172 |
173 if (delegate_->HandleExternalProtocol(this, request_->url())) { | |
174 CancelAndIgnore(); | |
175 return; | |
176 } | |
177 | |
carlosk
2016/07/18 14:37:13
This order change was necessary to allow mixed-con
clamy
2016/07/18 15:20:37
This seems wrong. The mixed content_check will not
carlosk
2016/07/19 13:31:01
Thanks for pointing that out. My latest patch shou
| |
178 TRACE_EVENT_WITH_FLOW0("loading", "ResourceLoader::StartRequest", this, | 178 TRACE_EVENT_WITH_FLOW0("loading", "ResourceLoader::StartRequest", this, |
179 TRACE_EVENT_FLAG_FLOW_OUT); | 179 TRACE_EVENT_FLAG_FLOW_OUT); |
180 if (defer_start) { | 180 if (defer_start) { |
181 deferred_stage_ = DEFERRED_START; | 181 deferred_stage_ = DEFERRED_START; |
182 } else { | 182 } else { |
183 StartRequestInternal(); | 183 StartRequestInternal(); |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 void ResourceLoader::CancelRequest(bool from_renderer) { | 187 void ResourceLoader::CancelRequest(bool from_renderer) { |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
729 } | 729 } |
730 | 730 |
731 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 731 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
732 } else if (request_->response_info().unused_since_prefetch) { | 732 } else if (request_->response_info().unused_since_prefetch) { |
733 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); | 733 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); |
734 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); | 734 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); |
735 } | 735 } |
736 } | 736 } |
737 | 737 |
738 } // namespace content | 738 } // namespace content |
OLD | NEW |