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 "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" | 5 #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 prerender_contents->Destroy(prerender::FINAL_STATUS_UNSUPPORTED_SCHEME); | 237 prerender_contents->Destroy(prerender::FINAL_STATUS_UNSUPPORTED_SCHEME); |
238 prerender::ReportPrerenderExternalURL(); | 238 prerender::ReportPrerenderExternalURL(); |
239 return; | 239 return; |
240 } | 240 } |
241 | 241 |
242 // If the URL is in whitelist, we launch it without asking the user and | 242 // If the URL is in whitelist, we launch it without asking the user and |
243 // without any additional security checks. Since the URL is whitelisted, | 243 // without any additional security checks. Since the URL is whitelisted, |
244 // we assume it can be executed. | 244 // we assume it can be executed. |
245 if (is_whitelisted) { | 245 if (is_whitelisted) { |
246 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck( | 246 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck( |
247 url, render_process_id, web_contents->GetRoutingID()); | 247 url, render_process_id, |
248 web_contents->GetRenderViewHost()->GetRoutingID()); | |
Charlie Reis
2016/11/23 07:53:35
This line looks potentially wrong to me, before an
ncarter (slow)
2016/11/23 18:04:22
Agree, with charlie that there are bugs here that
alexmos
2016/11/23 22:46:20
Nick/Charlie: thanks for pointing out these proble
Charlie Reis
2016/11/23 22:48:27
Yes, a TODO citing that bug is fine. No need to f
| |
248 } else { | 249 } else { |
249 ExternalProtocolHandler::LaunchUrlWithDelegate( | 250 ExternalProtocolHandler::LaunchUrlWithDelegate( |
250 url, render_process_id, web_contents->GetRoutingID(), page_transition, | 251 url, render_process_id, |
252 web_contents->GetRenderViewHost()->GetRoutingID(), page_transition, | |
251 has_user_gesture, g_external_protocol_handler_delegate); | 253 has_user_gesture, g_external_protocol_handler_delegate); |
252 } | 254 } |
253 } | 255 } |
254 | 256 |
255 #if !defined(DISABLE_NACL) | 257 #if !defined(DISABLE_NACL) |
256 void AppendComponentUpdaterThrottles( | 258 void AppendComponentUpdaterThrottles( |
257 net::URLRequest* request, | 259 net::URLRequest* request, |
258 const ResourceRequestInfo& info, | 260 const ResourceRequestInfo& info, |
259 content::ResourceContext* resource_context, | 261 content::ResourceContext* resource_context, |
260 ResourceType resource_type, | 262 ResourceType resource_type, |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
879 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 881 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
880 base::Unretained(this), url, request_loading_time)); | 882 base::Unretained(this), url, request_loading_time)); |
881 return; | 883 return; |
882 } | 884 } |
883 | 885 |
884 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 886 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
885 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 887 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
886 rappor::SampleDomainAndRegistryFromGURL( | 888 rappor::SampleDomainAndRegistryFromGURL( |
887 g_browser_process->rappor_service(), metric_name, url); | 889 g_browser_process->rappor_service(), metric_name, url); |
888 } | 890 } |
OLD | NEW |