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

Side by Side Diff: Source/core/page/CreateWindow.cpp

Issue 339593005: Set the target type when creating the request for main resource (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 newFrame->loader().setOpener(&openerFrame); 147 newFrame->loader().setOpener(&openerFrame);
148 148
149 if (newFrame->domWindow()->isInsecureScriptAccess(callingWindow, completedUR L)) 149 if (newFrame->domWindow()->isInsecureScriptAccess(callingWindow, completedUR L))
150 return newFrame; 150 return newFrame;
151 151
152 if (function) 152 if (function)
153 function(newFrame->domWindow(), functionContext); 153 function(newFrame->domWindow(), functionContext);
154 154
155 if (created) { 155 if (created) {
156 FrameLoadRequest request(callingWindow.document(), ResourceRequest(compl etedURL, referrer)); 156 ResourceRequest resourceRequest = ResourceRequest(completedURL, referrer );
157 resourceRequest.initializeForMainResource(newFrame->isMainFrame());
158 FrameLoadRequest request(callingWindow.document(), resourceRequest);
157 newFrame->loader().load(request); 159 newFrame->loader().load(request);
158 } else if (!urlString.isEmpty()) { 160 } else if (!urlString.isEmpty()) {
159 newFrame->navigationScheduler().scheduleLocationChange(callingWindow.doc ument(), completedURL.string(), referrer, false); 161 newFrame->navigationScheduler().scheduleLocationChange(callingWindow.doc ument(), completedURL.string(), referrer, false);
160 } 162 }
161 return newFrame; 163 return newFrame;
162 } 164 }
163 165
164 void createWindowForRequest(const FrameLoadRequest& request, LocalFrame& openerF rame, NavigationPolicy policy, ShouldSendReferrer shouldSendReferrer) 166 void createWindowForRequest(const FrameLoadRequest& request, LocalFrame& openerF rame, NavigationPolicy policy, ShouldSendReferrer shouldSendReferrer)
165 { 167 {
166 if (openerFrame.document()->pageDismissalEventBeingDispatched() != Document: :NoDismissal) 168 if (openerFrame.document()->pageDismissalEventBeingDispatched() != Document: :NoDismissal)
(...skipping 11 matching lines...) Expand all
178 WindowFeatures features; 180 WindowFeatures features;
179 bool created; 181 bool created;
180 LocalFrame* newFrame = createWindow(openerFrame, openerFrame, request, featu res, policy, shouldSendReferrer, created); 182 LocalFrame* newFrame = createWindow(openerFrame, openerFrame, request, featu res, policy, shouldSendReferrer, created);
181 if (!newFrame) 183 if (!newFrame)
182 return; 184 return;
183 if (shouldSendReferrer == MaybeSendReferrer) { 185 if (shouldSendReferrer == MaybeSendReferrer) {
184 newFrame->loader().setOpener(&openerFrame); 186 newFrame->loader().setOpener(&openerFrame);
185 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer Policy()); 187 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer Policy());
186 } 188 }
187 FrameLoadRequest newRequest(0, request.resourceRequest()); 189 FrameLoadRequest newRequest(0, request.resourceRequest());
190 newRequest.resourceRequest().initializeForMainResource(newFrame->isMainFrame ());
188 newRequest.setFormState(request.formState()); 191 newRequest.setFormState(request.formState());
189 newFrame->loader().load(newRequest); 192 newFrame->loader().load(newRequest);
190 } 193 }
191 194
192 } // namespace WebCore 195 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698