Chromium Code Reviews| Index: chrome/browser/prerender/prerender_resource_throttle.cc |
| diff --git a/chrome/browser/prerender/prerender_resource_throttle.cc b/chrome/browser/prerender/prerender_resource_throttle.cc |
| index 8d8511e22e2fc16a1612f39e862089171ecc2afa..95bbbbd4a20970d40a925b2ae259055801823770 100644 |
| --- a/chrome/browser/prerender/prerender_resource_throttle.cc |
| +++ b/chrome/browser/prerender/prerender_resource_throttle.cc |
| @@ -184,13 +184,18 @@ void PrerenderResourceThrottle::WillStartRequestOnUI( |
| cancel = true; |
| } else if (!PrerenderManager::DoesSubresourceURLHaveValidScheme(url) && |
| resource_type != content::RESOURCE_TYPE_MAIN_FRAME) { |
| - // Destroying the prerender for unsupported scheme only for non-main |
| - // resource to allow chrome://crash to actually crash in the |
| - // *RendererCrash tests instead of being intercepted here. The unsupported |
| - // scheme for the main resource is checked in WillRedirectRequestOnUI() |
| - // and PrerenderContents::CheckURL(). See http://crbug.com/673771. |
| - prerender_contents->Destroy(FINAL_STATUS_UNSUPPORTED_SCHEME); |
| - ReportUnsupportedPrerenderScheme(url); |
| + // For OFFLINE_ORIGIN, simply cancel this invalid request and continue. |
|
pasko
2017/02/01 01:08:09
nit: s/OFFLINE_ORIGIN/ORIGIN_OFFLINE/
dougarnett
2017/02/06 17:05:01
Done.
|
| + // For other origins, fail the prerender here. |
| + if (prerender_contents->origin() != ORIGIN_OFFLINE) { |
| + // Destroying the prerender for unsupported scheme only for non-main |
| + // resource to allow chrome://crash to actually crash in the |
| + // *RendererCrash tests instead of being intercepted here. The |
| + // unsupported |
| + // scheme for the main resource is checked in WillRedirectRequestOnUI() |
| + // and PrerenderContents::CheckURL(). See http://crbug.com/673771. |
| + prerender_contents->Destroy(FINAL_STATUS_UNSUPPORTED_SCHEME); |
| + ReportUnsupportedPrerenderScheme(url); |
| + } |
| cancel = true; |
| #if defined(OS_ANDROID) |
| } else if (resource_type == content::RESOURCE_TYPE_FAVICON) { |