Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1350)

Unified Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 6901128: Cancel prerenders that spawn post requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/prerender/prerender_xhr_post.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/resource_dispatcher_host.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index c32d8b907695b8f02805d9dcebd470ebdca10201..e76c28f87f608d0059ac35adf80553e085024631 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -423,6 +423,19 @@ void ResourceDispatcherHost::BeginRequest(
// Otherwise, treat like a normal request, and fall-through.
}
+ // Abort any prerenders that spawn requests that are not GET methods.
+ if (is_prerendering && request_data.method != "GET") {
cbentzel 2011/04/29 20:00:30 HEAD should be allowed. OPTIONS could probably b
dominich 2011/04/29 21:13:52 Done.
+ CHECK(IsPrerenderingChildRoutePair(child_id, route_id));
cbentzel 2011/04/29 20:00:30 This CHECK is not necessary - is_prerendering is s
dominich 2011/04/29 21:13:52 Done.
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(
+ prerender::DestroyPreloadForChildRouteIdPairOnUIThread,
+ resource_context.prerender_manager(),
+ std::make_pair(child_id, route_id),
+ prerender::FINAL_STATUS_NOT_GET));
+ AbortRequestBeforeItStarts(filter_, sync_result, route_id, request_id);
+ return;
+ }
// Construct the event handler.
scoped_refptr<ResourceHandler> handler;
« no previous file with comments | « chrome/test/data/prerender/prerender_xhr_post.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698