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

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

Issue 9113028: Substitute ResourceHandlers with dummy ResourceHandler while request is transferred (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 12 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
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 a210f8de897aaa3ebe2ecf5aab43b8d48fb63a88..ddc0c9c1a004d98defaa7d8ebec7765d477af627 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -32,6 +32,7 @@
#include "content/browser/download/save_file_manager.h"
#include "content/browser/download/save_file_resource_handler.h"
#include "content/browser/plugin_service_impl.h"
+#include "content/browser/renderer_host/allow_cancel_resource_handler.h"
#include "content/browser/renderer_host/async_resource_handler.h"
#include "content/browser/renderer_host/buffered_resource_handler.h"
#include "content/browser/renderer_host/cross_site_resource_handler.h"
@@ -1303,8 +1304,21 @@ void ResourceDispatcherHost::OnReceivedRedirect(net::URLRequest* request,
PopulateResourceResponse(request, response);
if (!info->resource_handler()->OnRequestRedirected(info->request_id(),
new_url,
- response, defer_redirect))
+ response,
+ defer_redirect)) {
CancelRequestInternal(request, false);
+ return;
+ }
+
+ // If a URLRequest is transferred to a new RenderViewHost, its
+ // ResourceHandlers should not received any notifications because they may
Matt Perry 2012/01/05 23:52:44 receive*
battre 2012/01/06 02:18:02 Done.
+ // depend on the state of the old RVH. We set a ResourceHandler that allows
+ // canceling requests, because on shutdown of the RDH all pending requests
+ // are canceled. The RVH of requests that are being transferred may be gone by
+ // that time.
+ GlobalRequestID global_request_id(info->child_id(), info->request_id());
+ if (IsTransferredNavigation(global_request_id))
+ info->set_resource_handler(new AllowCancelResourceHandler());
battre 2012/01/05 22:55:17 We cannot put this code into the TransferNavigatio
Matt Perry 2012/01/05 23:52:44 It's perfectly fine to delete an instance of a cla
battre 2012/01/06 02:18:02 Done. Moved to MarkAsTransferredNavigation as disc
}
void ResourceDispatcherHost::OnAuthRequired(

Powered by Google App Engine
This is Rietveld 408576698