Commit 09667f03 authored by jam@chromium.org's avatar jam@chromium.org

Remove calls of PrerenderTracker::TryCancel on UI thread and instead have them...

Remove calls of PrerenderTracker::TryCancel on UI thread and instead have them call PrerenderContents::Destroy directly.

This is part of the work on removing calls to ResourceRequestInfo::GetAssociatedRenderView. The last callers to that method are using it to cancel prerenders if they haven't been used yet, so the checking/cancelling needs to all move to the UI thread.

BUG=304341
R=tburkard@chromium.org

Review URL: https://codereview.chromium.org/109983006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243094 0039d316-1c4b-4281-b951-d872f2087c98
parent eade942b
......@@ -1781,18 +1781,13 @@ void ChromeContentBrowserClient::AllowCertificateError(
NOTREACHED();
return;
}
prerender::PrerenderManager* prerender_manager =
prerender::PrerenderManagerFactory::GetForProfile(
Profile::FromBrowserContext(tab->GetBrowserContext()));
if (prerender_manager && prerender_manager->IsWebContentsPrerendering(tab,
NULL)) {
if (prerender_manager->prerender_tracker()->TryCancel(
render_process_id,
render_frame_host->GetRenderViewHost()->GetRoutingID(),
prerender::FINAL_STATUS_SSL_ERROR)) {
*result = content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL;
return;
}
prerender::PrerenderContents* prerender_contents =
prerender::PrerenderContents::FromWebContents(tab);
if (prerender_contents) {
prerender_contents->Destroy(prerender::FINAL_STATUS_SSL_ERROR);
*result = content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL;
return;
}
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
......
......@@ -1754,12 +1754,11 @@ void PrerenderManager::OnCreatingAudioStream(int render_process_id,
if (!tab)
return;
if (!IsWebContentsPrerendering(tab, NULL))
PrerenderContents* prerender_contents = GetPrerenderContents(tab);
if (!prerender_contents)
return;
prerender_tracker()->TryCancel(
render_process_id, render_view_id,
prerender::FINAL_STATUS_CREATING_AUDIO_STREAM);
prerender_contents->Destroy(prerender::FINAL_STATUS_CREATING_AUDIO_STREAM);
}
void PrerenderManager::RecordLikelyLoginOnURL(const GURL& url) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment