Changeset 260423 in webkit
- Timestamp:
- Apr 21, 2020 3:31:08 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r260420 r260423 1 2020-04-21 Rob Buis <rbuis@igalia.com> 2 3 Exit early in FrameLoader::loadURL when redirecting to another frame 4 https://bugs.webkit.org/show_bug.cgi?id=210751 5 6 Reviewed by Geoffrey Garen. 7 8 Exit early in FrameLoader::loadURL when redirecting to another frame, previously we were preparing 9 request needlessly, doing it twice in case of frame redirecting. Also move some variables to 10 where they are actually used. 11 12 * loader/FrameLoader.cpp: 13 (WebCore::FrameLoader::loadURL): 14 * loader/FrameLoader.h: 15 1 16 2020-04-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 17 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r260351 r260423 1353 1353 // Anchor target is ignored when the download attribute is set since it will download the hyperlink rather than follow it. 1354 1354 String effectiveFrameName = frameLoadRequest.downloadAttribute().isNull() ? frameLoadRequest.frameName() : String(); 1355 AllowNavigationToInvalidURL allowNavigationToInvalidURL = frameLoadRequest.allowNavigationToInvalidURL();1356 NewFrameOpenerPolicy openerPolicy = frameLoadRequest.newFrameOpenerPolicy();1357 LockHistory lockHistory = frameLoadRequest.lockHistory();1358 1355 bool isFormSubmission = formState; 1356 1357 // The search for a target frame is done earlier in the case of form submission. 1358 auto targetFrame = isFormSubmission ? nullptr : makeRefPtr(findFrameForNavigation(effectiveFrameName)); 1359 if (targetFrame && targetFrame != &m_frame) { 1360 frameLoadRequest.setFrameName("_self"); 1361 targetFrame->loader().loadURL(WTFMove(frameLoadRequest), referrer, newLoadType, event, WTFMove(formState), WTFMove(adClickAttribution), completionHandlerCaller.release()); 1362 return; 1363 } 1359 1364 1360 1365 const URL& newURL = frameLoadRequest.resourceRequest().url(); … … 1367 1372 ASSERT(newLoadType != FrameLoadType::Same); 1368 1373 1369 // The search for a target frame is done earlier in the case of form submission.1370 Frame* targetFrame = isFormSubmission ? nullptr : findFrameForNavigation(effectiveFrameName);1371 if (targetFrame && targetFrame != &m_frame) {1372 frameLoadRequest.setFrameName("_self");1373 targetFrame->loader().loadURL(WTFMove(frameLoadRequest), referrer, newLoadType, event, WTFMove(formState), WTFMove(adClickAttribution), completionHandlerCaller.release());1374 return;1375 }1376 1377 1374 if (!isNavigationAllowed()) 1378 1375 return; 1379 1376 1380 1377 NavigationAction action { frameLoadRequest.requester(), request, frameLoadRequest.initiatedByMainFrame(), newLoadType, isFormSubmission, event, frameLoadRequest.shouldOpenExternalURLsPolicy(), frameLoadRequest.downloadAttribute() }; 1381 action.setLockHistory( lockHistory);1378 action.setLockHistory(frameLoadRequest.lockHistory()); 1382 1379 action.setLockBackForwardList(frameLoadRequest.lockBackForwardList()); 1383 1380 if (adClickAttribution && m_frame.isMainFrame()) 1384 1381 action.setAdClickAttribution(WTFMove(*adClickAttribution)); 1385 1382 1383 NewFrameOpenerPolicy openerPolicy = frameLoadRequest.newFrameOpenerPolicy(); 1384 AllowNavigationToInvalidURL allowNavigationToInvalidURL = frameLoadRequest.allowNavigationToInvalidURL(); 1386 1385 if (!targetFrame && !effectiveFrameName.isEmpty()) { 1387 1386 action = action.copyWithShouldOpenExternalURLsPolicy(shouldOpenExternalURLsPolicyToApply(m_frame, frameLoadRequest)); -
trunk/Source/WebCore/loader/FrameLoader.h
r260239 r260423 282 282 FrameLoaderStateMachine& stateMachine() { return m_stateMachine; } 283 283 284 // FIXME: should return RefPtr. 284 285 WEBCORE_EXPORT Frame* findFrameForNavigation(const AtomString& name, Document* activeDocument = nullptr); 285 286
Note: See TracChangeset
for help on using the changeset viewer.