Changeset 269129 in webkit
- Timestamp:
- Oct 28, 2020 5:00:17 PM (21 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/adClickAttribution/attribution-conversion-through-image-redirect-in-new-window-expected.txt (added)
-
LayoutTests/http/tests/adClickAttribution/attribution-conversion-through-image-redirect-in-new-window.html (added)
-
LayoutTests/http/tests/adClickAttribution/resources/convertAndPostMessageBack.html (added)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.cpp (modified) (3 diffs)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (modified) (1 diff)
-
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r269126 r269129 1 2020-10-28 John Wilander <wilander@apple.com> 2 3 PCM: Accept ad click data when the link opens a new window 4 https://bugs.webkit.org/show_bug.cgi?id=214176 5 <rdar://problem/65358005> 6 7 Reviewed by Brent Fulgham. 8 9 A link with the attribute target="_blank" takes another code path for 10 navigation which involves the creation of a new window and webpage. That 11 code path needs to transfer ad click attribution data to the new webpage 12 where it can be picked up. 13 14 * http/tests/adClickAttribution/attribution-conversion-through-image-redirect-in-new-window-expected.txt: Added. 15 * http/tests/adClickAttribution/attribution-conversion-through-image-redirect-in-new-window.html: Added. 16 * http/tests/adClickAttribution/resources/convertAndPostMessageBack.html: Added. 17 1 18 2020-10-28 Truitt Savell <tsavell@apple.com> 2 19 -
trunk/Source/WebKit/ChangeLog
r269123 r269129 1 2020-10-28 John Wilander <wilander@apple.com> 2 3 PCM: Accept ad click data when the link opens a new window 4 https://bugs.webkit.org/show_bug.cgi?id=214176 5 <rdar://problem/65358005> 6 7 Reviewed by Brent Fulgham. 8 9 A link with the attribute target="_blank" takes another code path for 10 navigation which involves the creation of a new window and webpage. That 11 code path needs to transfer ad click attribution data to the new webpage 12 where it can be picked up in WebPageProxy::didCommitLoadForFrame(). 13 The ad click attribution data sits in the NavigationAction which is not 14 available in the completion handler WebPageProxy::createNewPage(). 15 The client, which differs between TestRunner and e.g. Safari, consumes 16 the NavigationAction. I don't want to risk a regression in e.g. Safari 17 while still passing the test because TestRunner hasn't regressed. 18 19 Test: http/tests/adClickAttribution/attribution-conversion-through-image-redirect-in-new-window.html 20 21 * UIProcess/WebPageProxy.cpp: 22 (WebKit::WebPageProxy::didCommitLoadForFrame): 23 Now also checks for pending ad click attribution data in its new 24 member variable m_newPageNavigationAdClickAttribution. 25 (WebKit::WebPageProxy::createNewPage): 26 Now forwards optional ad click attribution data to the completion 27 handler where it can be stored on the newly created webpage in the 28 new member variable m_newPageNavigationAdClickAttribution. 29 * UIProcess/WebPageProxy.h: 30 Added m_newPageNavigationAdClickAttribution. 31 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 32 (WebKit::WebChromeClient::createWindow): 33 Added missing navigationAction.adClickAttribution() copy. 34 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 35 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): 36 Added missing navigationAction.adClickAttribution() copy. 37 1 38 2020-10-28 Said Abou-Hallawa <said@apple.com> 2 39 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r269027 r269129 4652 4652 frame->didCommitLoad(mimeType, webCertificateInfo, containsPluginDocument); 4653 4653 4654 if (navigation && frame->isMainFrame()) { 4655 if (auto& adClickAttribution = navigation->adClickAttribution()) { 4654 if (frame->isMainFrame()) { 4655 Optional<WebCore::AdClickAttribution> adClickAttribution; 4656 if (m_newPageNavigationAdClickAttribution) 4657 adClickAttribution = m_newPageNavigationAdClickAttribution; 4658 else if (navigation && navigation->adClickAttribution()) 4659 adClickAttribution = navigation->adClickAttribution(); 4660 if (adClickAttribution) { 4656 4661 if (adClickAttribution->destination().matches(frame->url())) 4657 4662 websiteDataStore().networkProcess().send(Messages::NetworkProcess::StoreAdClickAttribution(m_websiteDataStore->sessionID(), *adClickAttribution), 0); 4658 4663 } 4659 4664 } 4665 m_newPageNavigationAdClickAttribution.reset(); 4660 4666 4661 4667 if (frame->isMainFrame()) { … … 5519 5525 auto originatingFrameInfo = API::FrameInfo::create(WTFMove(originatingFrameInfoData), originatingPage); 5520 5526 auto mainFrameURL = m_mainFrame ? m_mainFrame->url() : URL(); 5521 auto completionHandler = [this, protectedThis = makeRef(*this), mainFrameURL, request, reply = WTFMove(reply) ] (RefPtr<WebPageProxy> newPage) mutable {5527 auto completionHandler = [this, protectedThis = makeRef(*this), mainFrameURL, request, reply = WTFMove(reply), adClickAttribution = navigationActionData.adClickAttribution] (RefPtr<WebPageProxy> newPage) mutable { 5522 5528 if (!newPage) { 5523 5529 reply(WTF::nullopt, WTF::nullopt); … … 5531 5537 newPage->m_shouldSuppressAppLinksInNextNavigationPolicyDecision = mainFrameURL.host() == request.url().host(); 5532 5538 5539 newPage->m_newPageNavigationAdClickAttribution = adClickAttribution; 5533 5540 #if HAVE(APP_SSO) 5534 5541 newPage->m_shouldSuppressSOAuthorizationInNextNavigationPolicyDecision = true; -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r269027 r269129 2886 2886 2887 2887 size_t m_suspendMediaPlaybackCounter { 0 }; 2888 2889 Optional<WebCore::AdClickAttribution> m_newPageNavigationAdClickAttribution; 2888 2890 }; 2889 2891 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
r269084 r269129 268 268 navigationActionData.shouldOpenExternalURLsPolicy = navigationAction.shouldOpenExternalURLsPolicy(); 269 269 navigationActionData.downloadAttribute = navigationAction.downloadAttribute(); 270 navigationActionData.adClickAttribution = navigationAction.adClickAttribution(); 270 271 271 272 WebFrame* webFrame = WebFrame::fromCoreFrame(frame); -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r268239 r269129 880 880 navigationActionData.shouldOpenExternalURLsPolicy = navigationAction.shouldOpenExternalURLsPolicy(); 881 881 navigationActionData.downloadAttribute = navigationAction.downloadAttribute(); 882 navigationActionData.adClickAttribution = navigationAction.adClickAttribution(); 882 883 883 884 webPage->send(Messages::WebPageProxy::DecidePolicyForNewWindowAction(m_frame->frameID(), m_frame->info(), identifier, navigationActionData, request,
Note: See TracChangeset
for help on using the changeset viewer.