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

Unified Diff: content/renderer/render_view.cc

Issue 7601011: Fix resource loads dropped when iframe is transferred to a new window and original window closes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix crash in tests (RenderThread::current() is NULL) Created 9 years, 4 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 | « content/common/resource_messages.h ('k') | webkit/glue/resource_loader_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view.cc
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index 368cc335081dad50c4f5741cabbfc0935738ff69..2b82904d49d488b6f5837253a50de6150837f7e1 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -35,6 +35,7 @@
#include "content/common/notification_service.h"
#include "content/common/pepper_messages.h"
#include "content/common/pepper_plugin_registry.h"
+#include "content/common/resource_dispatcher.h"
#include "content/common/quota_dispatcher.h"
#include "content/common/renderer_preferences.h"
#include "content/common/url_constants.h"
@@ -2615,9 +2616,15 @@ void RenderView::didUpdateCurrentHistoryItem(WebFrame* frame) {
StartNavStateSyncTimerIfNecessary();
}
+// Called by WebKit on new or transferred requests to introduce the request
+// to the RenderView. If this RenderView inherited a pending Request from other
+// RenderView (as in the case of reparenting an iframe via adoptNode() JS API),
+// we need to update routing information to point to this RenderView.
void RenderView::assignIdentifierToRequest(
WebFrame* frame, unsigned identifier, const WebURLRequest& request) {
- // Ignore
+ if (RenderThread::current()) // Will be NULL during tests.
+ RenderThread::current()->resource_dispatcher()->TransferRequestToNewPage(
+ identifier, routing_id_);
}
void RenderView::willSendRequest(
@@ -2657,6 +2664,8 @@ void RenderView::willSendRequest(
state->set_was_prefetcher(true);
}
+ request.setIdentifier(identifier);
+
request.setRequestorID(routing_id_);
request.setHasUserGesture(frame->isProcessingUserGesture());
« no previous file with comments | « content/common/resource_messages.h ('k') | webkit/glue/resource_loader_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698