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

Unified Diff: Source/core/page/CreateWindow.cpp

Issue 1071893003: WebURLRequest: Track the requesting document's URL through navigations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
Index: Source/core/page/CreateWindow.cpp
diff --git a/Source/core/page/CreateWindow.cpp b/Source/core/page/CreateWindow.cpp
index b3b2cdd598b3e961346b978b369e6f926e1bf575..0daf53e1dbb7aa229de2c52d2a9dd10f2a45dd27 100644
--- a/Source/core/page/CreateWindow.cpp
+++ b/Source/core/page/CreateWindow.cpp
@@ -42,12 +42,15 @@
#include "platform/weborigin/KURL.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "platform/weborigin/SecurityPolicy.h"
+#include "public/platform/WebURLRequest.h"
namespace blink {
static LocalFrame* createWindow(LocalFrame& openerFrame, LocalFrame& lookupFrame, const FrameLoadRequest& request, const WindowFeatures& features, NavigationPolicy policy, ShouldSendReferrer shouldSendReferrer, bool& created)
{
ASSERT(!features.dialog || request.frameName().isEmpty());
+ ASSERT(!request.resourceRequest().requestorURL().isEmpty() || openerFrame.document()->url().isEmpty());
+ ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeAuxiliary);
if (!request.frameName().isEmpty() && request.frameName() != "_blank" && policy == NavigationPolicyIgnore) {
if (Frame* frame = lookupFrame.findFrameForNavigation(request.frameName(), openerFrame)) {
@@ -138,6 +141,8 @@ LocalFrame* createWindow(const String& urlString, const AtomicString& frameName,
}
FrameLoadRequest frameRequest(callingWindow.document(), completedURL, frameName);
+ frameRequest.resourceRequest().setFrameType(WebURLRequest::FrameTypeAuxiliary);
+ frameRequest.resourceRequest().setRequestorURL(activeFrame->document()->url());
// Normally, FrameLoader would take care of setting the referrer for a navigation that is
// triggered from javascript. However, creating a window goes through sufficient processing
@@ -167,6 +172,8 @@ LocalFrame* createWindow(const String& urlString, const AtomicString& frameName,
void createWindowForRequest(const FrameLoadRequest& request, LocalFrame& openerFrame, NavigationPolicy policy, ShouldSendReferrer shouldSendReferrer)
{
+ ASSERT(!request.resourceRequest().requestorURL().isEmpty() || (openerFrame.document() && openerFrame.document()->url().isEmpty()));
+
if (openerFrame.document()->pageDismissalEventBeingDispatched() != Document::NoDismissal)
return;

Powered by Google App Engine
This is Rietveld 408576698