Title: [241049] trunk/Source
Revision
241049
Author
wilan...@apple.com
Date
2019-02-06 14:02:15 -0800 (Wed, 06 Feb 2019)

Log Message

Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
https://bugs.webkit.org/show_bug.cgi?id=194325
<rdar://problem/47840283>

Reviewed by Chris Dumez.

Source/WebCore:

No new tests. This is just data forwarding. Once the data is stored, I will create
test infrastructure to query it.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::encode const):
(WebCore::AdClickAttribution::decode):
(WebCore::AdClickAttribution::Conversion::encode const):
(WebCore::AdClickAttribution::Conversion::decode):
    Infrastructure for IPC.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
    These functions forward the optional WebCore::AdClickAttribution object
    FrameLoader::loadURL() creates the NavigationAction object and sets the
    WebCore::AdClickAttribution object on there.
* loader/FrameLoader.h:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURL):
* loader/NavigationAction.h:
(WebCore::NavigationAction::adClickAttribution):
(WebCore::NavigationAction::setAdClickAttribution):

Source/WebKit:

* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
    Now holds an optional WebCore::AdClickAttribution object.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (241048 => 241049)


--- trunk/Source/WebCore/ChangeLog	2019-02-06 21:52:57 UTC (rev 241048)
+++ trunk/Source/WebCore/ChangeLog	2019-02-06 22:02:15 UTC (rev 241049)
@@ -1,3 +1,37 @@
+2019-02-06  John Wilander  <wilan...@apple.com>
+
+        Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
+        https://bugs.webkit.org/show_bug.cgi?id=194325
+        <rdar://problem/47840283>
+
+        Reviewed by Chris Dumez.
+
+        No new tests. This is just data forwarding. Once the data is stored, I will create
+        test infrastructure to query it.
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::handleClick):
+        * loader/AdClickAttribution.h:
+        (WebCore::AdClickAttribution::encode const):
+        (WebCore::AdClickAttribution::decode):
+        (WebCore::AdClickAttribution::Conversion::encode const):
+        (WebCore::AdClickAttribution::Conversion::decode):
+            Infrastructure for IPC.
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::urlSelected):
+        (WebCore::FrameLoader::loadURLIntoChildFrame):
+        (WebCore::FrameLoader::loadFrameRequest):
+        (WebCore::FrameLoader::loadURL):
+            These functions forward the optional WebCore::AdClickAttribution object
+            FrameLoader::loadURL() creates the NavigationAction object and sets the
+            WebCore::AdClickAttribution object on there.
+        * loader/FrameLoader.h:
+        (WebCore::FrameLoader::urlSelected):
+        (WebCore::FrameLoader::loadURL):
+        * loader/NavigationAction.h:
+        (WebCore::NavigationAction::adClickAttribution):
+        (WebCore::NavigationAction::setAdClickAttribution):
+
 2019-02-06  Justin Fan  <justin_...@apple.com>
 
         [Web GPU] Implement supporting dictionaries for GPUTexture

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (241048 => 241049)


--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2019-02-06 21:52:57 UTC (rev 241048)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2019-02-06 22:02:15 UTC (rev 241049)
@@ -488,13 +488,11 @@
         newFrameOpenerPolicy = NewFrameOpenerPolicy::Suppress;
 
     auto adClickAttribution = parseAdClickAttribution();
-    // FIXME: The adClickAttribution should be forwarded to the loader and handled down the pipe. See
-    // rdar://problem/47650118
     // A matching conversion event needs to happen before the complete ad click attributionURL can be
     // created. Thus, it should be empty for now.
-    ASSERT_UNUSED(adClickAttribution, !adClickAttribution || adClickAttribution->url().isNull());
+    ASSERT(!adClickAttribution || adClickAttribution->url().isNull());
     
-    frame->loader().urlSelected(completedURL, effectiveTarget, &event, LockHistory::No, LockBackForwardList::No, shouldSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), newFrameOpenerPolicy, downloadAttribute, systemPreviewInfo);
+    frame->loader().urlSelected(completedURL, effectiveTarget, &event, LockHistory::No, LockBackForwardList::No, shouldSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), newFrameOpenerPolicy, downloadAttribute, systemPreviewInfo, WTFMove(adClickAttribution));
 
     sendPings(completedURL);
 }

Modified: trunk/Source/WebCore/loader/AdClickAttribution.h (241048 => 241049)


--- trunk/Source/WebCore/loader/AdClickAttribution.h	2019-02-06 21:52:57 UTC (rev 241048)
+++ trunk/Source/WebCore/loader/AdClickAttribution.h	2019-02-06 22:02:15 UTC (rev 241049)
@@ -108,6 +108,9 @@
         
         ConversionData data;
         PriorityValue priority;
+
+        template<class Encoder> void encode(Encoder&) const;
+        template<class Decoder> static Optional<Conversion> decode(Decoder&);
     };
 
     AdClickAttribution(Campaign campaign, const Source& source, const Destination& destination)
@@ -123,6 +126,9 @@
     WEBCORE_EXPORT URL referrer() const;
     Optional<WallTime> earliestTimeToSend() const { return m_earliestTimeToSend; };
 
+    template<class Encoder> void encode(Encoder&) const;
+    template<class Decoder> static Optional<AdClickAttribution> decode(Decoder&);
+
 private:
     bool isValid() const;
 
@@ -134,5 +140,73 @@
     Optional<Conversion> m_conversion;
     Optional<WallTime> m_earliestTimeToSend;
 };
+
+template<class Encoder>
+void AdClickAttribution::encode(Encoder& encoder) const
+{
+    encoder << m_campaign.id << m_source.registrableDomain << m_destination.registrableDomain << m_timeOfAdClick << m_conversion << m_earliestTimeToSend;
+}
+
+template<class Decoder>
+Optional<AdClickAttribution> AdClickAttribution::decode(Decoder& decoder)
+{
+    Optional<CampaignId> campaignId;
+    decoder >> campaignId;
+    if (!campaignId)
+        return WTF::nullopt;
     
+    Optional<String> sourceRegistrableDomain;
+    decoder >> sourceRegistrableDomain;
+    if (!sourceRegistrableDomain)
+        return WTF::nullopt;
+    
+    Optional<String> destinationRegistrableDomain;
+    decoder >> destinationRegistrableDomain;
+    if (!destinationRegistrableDomain)
+        return WTF::nullopt;
+    
+    Optional<WallTime> timeOfAdClick;
+    decoder >> timeOfAdClick;
+    if (!timeOfAdClick)
+        return WTF::nullopt;
+    
+    Optional<Optional<Conversion>> conversion;
+    decoder >> conversion;
+    if (!conversion)
+        return WTF::nullopt;
+    
+    Optional<Optional<WallTime>> earliestTimeToSend;
+    decoder >> earliestTimeToSend;
+    if (!earliestTimeToSend)
+        return WTF::nullopt;
+    
+    AdClickAttribution attribution { Campaign { WTFMove(*campaignId) }, Source { WTFMove(*sourceRegistrableDomain) }, Destination { WTFMove(*destinationRegistrableDomain) } };
+    attribution.m_conversion = WTFMove(*conversion);
+    attribution.m_earliestTimeToSend = WTFMove(*earliestTimeToSend);
+    
+    return attribution;
+}
+
+template<class Encoder>
+void AdClickAttribution::Conversion::encode(Encoder& encoder) const
+{
+    encoder << data << priority;
+}
+
+template<class Decoder>
+Optional<AdClickAttribution::Conversion> AdClickAttribution::Conversion::decode(Decoder& decoder)
+{
+    Optional<ConversionData> data;
+    decoder >> data;
+    if (!data)
+        return WTF::nullopt;
+    
+    Optional<PriorityValue> priority;
+    decoder >> priority;
+    if (!priority)
+        return WTF::nullopt;
+    
+    return Conversion { WTFMove(*data), Priority { WTFMove(*priority) } };
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (241048 => 241049)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2019-02-06 21:52:57 UTC (rev 241048)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2019-02-06 22:02:15 UTC (rev 241049)
@@ -380,16 +380,16 @@
     urlSelected(WTFMove(request), nullptr);
 }
 
-void FrameLoader::urlSelected(const URL& url, const String& passedTarget, Event* triggeringEvent, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, Optional<NewFrameOpenerPolicy> openerPolicy, const AtomicString& downloadAttribute, const SystemPreviewInfo& systemPreviewInfo)
+void FrameLoader::urlSelected(const URL& url, const String& passedTarget, Event* triggeringEvent, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, Optional<NewFrameOpenerPolicy> openerPolicy, const AtomicString& downloadAttribute, const SystemPreviewInfo& systemPreviewInfo, Optional<AdClickAttribution>&& adClickAttribution)
 {
     auto* frame = lexicalFrameFromCommonVM();
     auto initiatedByMainFrame = frame && frame->isMainFrame() ? InitiatedByMainFrame::Yes : InitiatedByMainFrame::Unknown;
 
     NewFrameOpenerPolicy newFrameOpenerPolicy = openerPolicy.valueOr(shouldSendReferrer == NeverSendReferrer ? NewFrameOpenerPolicy::Suppress : NewFrameOpenerPolicy::Allow);
-    urlSelected(FrameLoadRequest(*m_frame.document(), m_frame.document()->securityOrigin(), { url }, passedTarget, lockHistory, lockBackForwardList, shouldSendReferrer, AllowNavigationToInvalidURL::Yes, newFrameOpenerPolicy, shouldOpenExternalURLsPolicy, initiatedByMainFrame, DoNotReplaceDocumentIfJavaScriptURL, downloadAttribute, systemPreviewInfo), triggeringEvent);
+    urlSelected(FrameLoadRequest(*m_frame.document(), m_frame.document()->securityOrigin(), { url }, passedTarget, lockHistory, lockBackForwardList, shouldSendReferrer, AllowNavigationToInvalidURL::Yes, newFrameOpenerPolicy, shouldOpenExternalURLsPolicy, initiatedByMainFrame, DoNotReplaceDocumentIfJavaScriptURL, downloadAttribute, systemPreviewInfo), triggeringEvent, WTFMove(adClickAttribution));
 }
 
-void FrameLoader::urlSelected(FrameLoadRequest&& frameRequest, Event* triggeringEvent)
+void FrameLoader::urlSelected(FrameLoadRequest&& frameRequest, Event* triggeringEvent, Optional<AdClickAttribution>&& adClickAttribution)
 {
     RELEASE_LOG_IF_ALLOWED("urlSelected: frame load started (frame = %p, main = %d)", &m_frame, m_frame.isMainFrame());
 
@@ -404,7 +404,7 @@
     addHTTPOriginIfNeeded(frameRequest.resourceRequest(), outgoingOrigin());
     m_frame.document()->contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(frameRequest.resourceRequest(), ContentSecurityPolicy::InsecureRequestType::Navigation);
 
-    loadFrameRequest(WTFMove(frameRequest), triggeringEvent, { });
+    loadFrameRequest(WTFMove(frameRequest), triggeringEvent, { }, WTFMove(adClickAttribution));
 }
 
 void FrameLoader::submitForm(Ref<FormSubmission>&& submission)
@@ -984,7 +984,7 @@
     auto initiatedByMainFrame = lexicalFrame && lexicalFrame->isMainFrame() ? InitiatedByMainFrame::Yes : InitiatedByMainFrame::Unknown;
 
     FrameLoadRequest frameLoadRequest { *m_frame.document(), m_frame.document()->securityOrigin(), { url }, "_self"_s, LockHistory::No, LockBackForwardList::Yes, ShouldSendReferrer::MaybeSendReferrer, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Suppress, ShouldOpenExternalURLsPolicy::ShouldNotAllow, initiatedByMainFrame };
-    childFrame->loader().loadURL(WTFMove(frameLoadRequest), referer, FrameLoadType::RedirectWithLockedBackForwardList, nullptr, { }, [] { });
+    childFrame->loader().loadURL(WTFMove(frameLoadRequest), referer, FrameLoadType::RedirectWithLockedBackForwardList, nullptr, { }, WTF::nullopt, [] { });
 }
 
 #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
@@ -1240,7 +1240,7 @@
     detachChildren();
 }
 
-void FrameLoader::loadFrameRequest(FrameLoadRequest&& request, Event* event, RefPtr<FormState>&& formState)
+void FrameLoader::loadFrameRequest(FrameLoadRequest&& request, Event* event, RefPtr<FormState>&& formState, Optional<AdClickAttribution>&& adClickAttribution)
 {
     RELEASE_LOG_IF_ALLOWED("loadFrameRequest: frame load started (frame = %p, main = %d)", &m_frame, m_frame.isMainFrame());
 
@@ -1287,7 +1287,7 @@
     if (request.resourceRequest().httpMethod() == "POST")
         loadPostRequest(WTFMove(request), referrer, loadType, event, WTFMove(formState), WTFMove(completionHandler));
     else
-        loadURL(WTFMove(request), referrer, loadType, event, WTFMove(formState), WTFMove(completionHandler));
+        loadURL(WTFMove(request), referrer, loadType, event, WTFMove(formState), WTFMove(adClickAttribution), WTFMove(completionHandler));
 }
 
 static ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicyToApply(Frame& currentFrame, InitiatedByMainFrame initiatedByMainFrame, ShouldOpenExternalURLsPolicy propagatedPolicy)
@@ -1329,7 +1329,7 @@
     return m_pageDismissalEventBeingDispatched == PageDismissalType::None;
 }
 
-void FrameLoader::loadURL(FrameLoadRequest&& frameLoadRequest, const String& referrer, FrameLoadType newLoadType, Event* event, RefPtr<FormState>&& formState, CompletionHandler<void()>&& completionHandler)
+void FrameLoader::loadURL(FrameLoadRequest&& frameLoadRequest, const String& referrer, FrameLoadType newLoadType, Event* event, RefPtr<FormState>&& formState, Optional<AdClickAttribution>&& adClickAttribution, CompletionHandler<void()>&& completionHandler)
 {
     RELEASE_LOG_IF_ALLOWED("loadURL: frame load started (frame = %p, main = %d)", &m_frame, m_frame.isMainFrame());
 
@@ -1366,7 +1366,7 @@
     Frame* targetFrame = isFormSubmission ? nullptr : findFrameForNavigation(effectiveFrameName);
     if (targetFrame && targetFrame != &m_frame) {
         frameLoadRequest.setFrameName("_self");
-        targetFrame->loader().loadURL(WTFMove(frameLoadRequest), referrer, newLoadType, event, WTFMove(formState), completionHandlerCaller.release());
+        targetFrame->loader().loadURL(WTFMove(frameLoadRequest), referrer, newLoadType, event, WTFMove(formState), WTFMove(adClickAttribution), completionHandlerCaller.release());
         return;
     }
 
@@ -1376,6 +1376,8 @@
     NavigationAction action { frameLoadRequest.requester(), request, frameLoadRequest.initiatedByMainFrame(), newLoadType, isFormSubmission, event, frameLoadRequest.shouldOpenExternalURLsPolicy(), frameLoadRequest.downloadAttribute() };
     action.setLockHistory(lockHistory);
     action.setLockBackForwardList(frameLoadRequest.lockBackForwardList());
+    if (adClickAttribution && m_frame.isMainFrame())
+        action.setAdClickAttribution(WTFMove(*adClickAttribution));
 
     if (!targetFrame && !effectiveFrameName.isEmpty()) {
         action = "" frameLoadRequest));

Modified: trunk/Source/WebCore/loader/FrameLoader.h (241048 => 241049)


--- trunk/Source/WebCore/loader/FrameLoader.h	2019-02-06 21:52:57 UTC (rev 241048)
+++ trunk/Source/WebCore/loader/FrameLoader.h	2019-02-06 22:02:15 UTC (rev 241049)
@@ -31,6 +31,7 @@
 
 #pragma once
 
+#include "AdClickAttribution.h"
 #include "CachePolicy.h"
 #include "FrameLoaderStateMachine.h"
 #include "FrameLoaderTypes.h"
@@ -115,7 +116,7 @@
 
     // FIXME: These are all functions which start loads. We have too many.
     WEBCORE_EXPORT void loadURLIntoChildFrame(const URL&, const String& referer, Frame*);
-    WEBCORE_EXPORT void loadFrameRequest(FrameLoadRequest&&, Event*, RefPtr<FormState>&&); // Called by submitForm, calls loadPostRequest and loadURL.
+    WEBCORE_EXPORT void loadFrameRequest(FrameLoadRequest&&, Event*, RefPtr<FormState>&&, Optional<AdClickAttribution>&& = WTF::nullopt); // Called by submitForm, calls loadPostRequest and loadURL.
 
     WEBCORE_EXPORT void load(FrameLoadRequest&&);
 
@@ -125,7 +126,7 @@
     unsigned long loadResourceSynchronously(const ResourceRequest&, ClientCredentialPolicy, const FetchOptions&, const HTTPHeaderMap&, ResourceError&, ResourceResponse&, RefPtr<SharedBuffer>& data);
 
     void changeLocation(FrameLoadRequest&&);
-    WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, Optional<NewFrameOpenerPolicy> = WTF::nullopt, const AtomicString& downloadAttribute = nullAtom(), const SystemPreviewInfo& = { });
+    WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, Optional<NewFrameOpenerPolicy> = WTF::nullopt, const AtomicString& downloadAttribute = nullAtom(), const SystemPreviewInfo& = { }, Optional<AdClickAttribution>&& = WTF::nullopt);
     void submitForm(Ref<FormSubmission>&&);
 
     WEBCORE_EXPORT void reload(OptionSet<ReloadOption> = { });
@@ -371,7 +372,7 @@
 
     void dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent);
 
-    void urlSelected(FrameLoadRequest&&, Event*);
+    void urlSelected(FrameLoadRequest&&, Event*, Optional<AdClickAttribution>&& = WTF::nullopt);
 
     void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, RefPtr<FormState>&&, AllowNavigationToInvalidURL, ShouldTreatAsContinuingLoad, CompletionHandler<void()>&& = [] { }); // Calls continueLoadAfterNavigationPolicy
     void load(DocumentLoader&); // Calls loadWithDocumentLoader
@@ -379,7 +380,7 @@
     void loadWithNavigationAction(const ResourceRequest&, NavigationAction&&, LockHistory, FrameLoadType, RefPtr<FormState>&&, AllowNavigationToInvalidURL, CompletionHandler<void()>&& = [] { }); // Calls loadWithDocumentLoader
 
     void loadPostRequest(FrameLoadRequest&&, const String& referrer, FrameLoadType, Event*, RefPtr<FormState>&&, CompletionHandler<void()>&&);
-    void loadURL(FrameLoadRequest&&, const String& referrer, FrameLoadType, Event*, RefPtr<FormState>&&, CompletionHandler<void()>&&);
+    void loadURL(FrameLoadRequest&&, const String& referrer, FrameLoadType, Event*, RefPtr<FormState>&&, Optional<AdClickAttribution>&&, CompletionHandler<void()>&&);
 
     bool shouldReload(const URL& currentURL, const URL& destinationURL);
 

Modified: trunk/Source/WebCore/loader/NavigationAction.h (241048 => 241049)


--- trunk/Source/WebCore/loader/NavigationAction.h	2019-02-06 21:52:57 UTC (rev 241048)
+++ trunk/Source/WebCore/loader/NavigationAction.h	2019-02-06 22:02:15 UTC (rev 241049)
@@ -28,6 +28,7 @@
 
 #pragma once
 
+#include "AdClickAttribution.h"
 #include "BackForwardItemIdentifier.h"
 #include "FrameLoaderTypes.h"
 #include "LayoutPoint.h"
@@ -35,6 +36,7 @@
 #include "SecurityOrigin.h"
 #include "UserGestureIndicator.h"
 #include <wtf/Forward.h>
+#include <wtf/Optional.h>
 
 namespace WebCore {
 
@@ -133,6 +135,9 @@
     LockBackForwardList lockBackForwardList() const { return m_lockBackForwardList; }
     void setLockBackForwardList(LockBackForwardList lockBackForwardList) { m_lockBackForwardList = lockBackForwardList; }
 
+    const Optional<AdClickAttribution>& adClickAttribution() { return m_adClickAttribution; };
+    void setAdClickAttribution(AdClickAttribution&& adClickAttribution) { m_adClickAttribution = adClickAttribution; };
+
 private:
     // Do not add a strong reference to the originating document or a subobject that holds the
     // originating document. See comment above the class for more details.
@@ -151,6 +156,7 @@
     Optional<BackForwardItemIdentifier> m_targetBackForwardItemIdentifier;
     LockHistory m_lockHistory { LockHistory::No };
     LockBackForwardList m_lockBackForwardList { LockBackForwardList::No };
+    Optional<AdClickAttribution> m_adClickAttribution;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebKit/ChangeLog (241048 => 241049)


--- trunk/Source/WebKit/ChangeLog	2019-02-06 21:52:57 UTC (rev 241048)
+++ trunk/Source/WebKit/ChangeLog	2019-02-06 22:02:15 UTC (rev 241049)
@@ -1,3 +1,17 @@
+2019-02-06  John Wilander  <wilan...@apple.com>
+
+        Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
+        https://bugs.webkit.org/show_bug.cgi?id=194325
+        <rdar://problem/47840283>
+
+        Reviewed by Chris Dumez.
+
+        * Shared/NavigationActionData.cpp:
+        (WebKit::NavigationActionData::encode const):
+        (WebKit::NavigationActionData::decode):
+        * Shared/NavigationActionData.h:
+            Now holds an optional WebCore::AdClickAttribution object.
+
 2019-02-06  Daniel Bates  <daba...@apple.com>
 
         Fix the Apple Internal build. See <rdar://problem/47860943> for more details.

Modified: trunk/Source/WebKit/Shared/NavigationActionData.cpp (241048 => 241049)


--- trunk/Source/WebKit/Shared/NavigationActionData.cpp	2019-02-06 21:52:57 UTC (rev 241048)
+++ trunk/Source/WebKit/Shared/NavigationActionData.cpp	2019-02-06 22:02:15 UTC (rev 241049)
@@ -53,6 +53,7 @@
     encoder.encodeEnum(lockHistory);
     encoder.encodeEnum(lockBackForwardList);
     encoder << clientRedirectSourceForHistory;
+    encoder << adClickAttribution;
 }
 
 Optional<NavigationActionData> NavigationActionData::decode(IPC::Decoder& decoder)
@@ -139,10 +140,15 @@
     if (!clientRedirectSourceForHistory)
         return WTF::nullopt;
 
+    Optional<Optional<WebCore::AdClickAttribution>> adClickAttribution;
+    decoder >> adClickAttribution;
+    if (!adClickAttribution)
+        return WTF::nullopt;
+
     return {{ WTFMove(navigationType), modifiers, WTFMove(mouseButton), WTFMove(syntheticClickType), WTFMove(*userGestureTokenIdentifier),
         WTFMove(*canHandleRequest), WTFMove(shouldOpenExternalURLsPolicy), WTFMove(*downloadAttribute), WTFMove(clickLocationInRootViewCoordinates),
         WTFMove(*isRedirect), *treatAsSameOriginNavigation, *hasOpenedFrames, *openedByDOMWithOpener, WTFMove(*requesterOrigin),
-        WTFMove(*targetBackForwardItemIdentifier), lockHistory, lockBackForwardList, WTFMove(*clientRedirectSourceForHistory) }};
+        WTFMove(*targetBackForwardItemIdentifier), lockHistory, lockBackForwardList, WTFMove(*clientRedirectSourceForHistory), WTFMove(*adClickAttribution) }};
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/Shared/NavigationActionData.h (241048 => 241049)


--- trunk/Source/WebKit/Shared/NavigationActionData.h	2019-02-06 21:52:57 UTC (rev 241048)
+++ trunk/Source/WebKit/Shared/NavigationActionData.h	2019-02-06 22:02:15 UTC (rev 241049)
@@ -26,6 +26,7 @@
 #pragma once
 
 #include "WebEvent.h"
+#include <WebCore/AdClickAttribution.h>
 #include <WebCore/BackForwardItemIdentifier.h>
 #include <WebCore/FloatPoint.h>
 #include <WebCore/FrameLoaderTypes.h>
@@ -60,6 +61,7 @@
     WebCore::LockHistory lockHistory;
     WebCore::LockBackForwardList lockBackForwardList;
     WTF::String clientRedirectSourceForHistory;
+    Optional<WebCore::AdClickAttribution> adClickAttribution;
 };
 
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to