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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 prerender::PrerenderContents::FromWebContents(web_contents); | 235 prerender::PrerenderContents::FromWebContents(web_contents); |
236 if (prerender_contents) { | 236 if (prerender_contents) { |
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 // TODO(davidsac): External protocol handling needs to be |
| 246 // fixed for OOPIFs. See https://crbug.com/668289. |
245 if (is_whitelisted) { | 247 if (is_whitelisted) { |
246 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck( | 248 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck( |
247 url, render_process_id, web_contents->GetRoutingID()); | 249 url, render_process_id, |
| 250 web_contents->GetRenderViewHost()->GetRoutingID()); |
248 } else { | 251 } else { |
249 ExternalProtocolHandler::LaunchUrlWithDelegate( | 252 ExternalProtocolHandler::LaunchUrlWithDelegate( |
250 url, render_process_id, web_contents->GetRoutingID(), page_transition, | 253 url, render_process_id, |
| 254 web_contents->GetRenderViewHost()->GetRoutingID(), page_transition, |
251 has_user_gesture, g_external_protocol_handler_delegate); | 255 has_user_gesture, g_external_protocol_handler_delegate); |
252 } | 256 } |
253 } | 257 } |
254 | 258 |
255 #if !defined(DISABLE_NACL) | 259 #if !defined(DISABLE_NACL) |
256 void AppendComponentUpdaterThrottles( | 260 void AppendComponentUpdaterThrottles( |
257 net::URLRequest* request, | 261 net::URLRequest* request, |
258 const ResourceRequestInfo& info, | 262 const ResourceRequestInfo& info, |
259 content::ResourceContext* resource_context, | 263 content::ResourceContext* resource_context, |
260 ResourceType resource_type, | 264 ResourceType resource_type, |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 883 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
880 base::Unretained(this), url, request_loading_time)); | 884 base::Unretained(this), url, request_loading_time)); |
881 return; | 885 return; |
882 } | 886 } |
883 | 887 |
884 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 888 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
885 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 889 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
886 rappor::SampleDomainAndRegistryFromGURL( | 890 rappor::SampleDomainAndRegistryFromGURL( |
887 g_browser_process->rappor_service(), metric_name, url); | 891 g_browser_process->rappor_service(), metric_name, url); |
888 } | 892 } |
OLD | NEW |