Add data abstraction and validation for Ad Click Attribution
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2019 19:54:32 +0000 (19:54 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2019 19:54:32 +0000 (19:54 +0000)
commit32cee0dc45868c4da801cc5bd6839f84408bfd55
treefc62ffdf51279caf37076c3f8855ff410e065958
parentf6861ce0b072904e768d6c9bf910e3c6cd80dc1c
Add data abstraction and validation for Ad Click Attribution
https://bugs.webkit.org/show_bug.cgi?id=193916
<rdar://problem/47603481>

Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen.

Source/WebCore:

New API tests added.

Ad click attribution has two steps. First, the storage of an ad
campaign ID for a click that takes the user to a destination
site. Second, a conversion on the destination site that can be
attributed to the ad click.

This patch adds a class that represents a request for ad click
attribution. Validation makes sure that the bits of entropy
reported through this mechanism is limited.

This feature is experimental and off by default.

* Sources.txt:
    Added loader/AdClickAttribution.cpp.
* WebCore.xcodeproj/project.pbxproj:
* loader/AdClickAttribution.cpp: Added.
(WebCore::AdClickAttribution::isValid const):
(WebCore::AdClickAttribution::setConversion):
(WebCore::AdClickAttribution::url const):
(WebCore::AdClickAttribution::referrer const):
* loader/AdClickAttribution.h: Added.
(WebCore::AdClickAttribution::Campaign::Campaign):
(WebCore::AdClickAttribution::Campaign::isValid const):
(WebCore::AdClickAttribution::Source::Source):
(WebCore::AdClickAttribution::Destination::Destination):
(WebCore::AdClickAttribution::Priority::Priority):
(WebCore::AdClickAttribution::Conversion::Conversion):
(WebCore::AdClickAttribution::Conversion::isValid const):
(WebCore::AdClickAttribution::AdClickAttribution):
(WebCore::AdClickAttribution::earliestTimeToSend const):
* loader/DocumentLoader.cpp:
    Added missing #include "RuntimeEnabledFeatures.h".

Tools:

Ad click attribution has two steps. First, the storage of an ad
campaign ID for a click that takes the user to a destination
site. Second, a conversion on the destination site that can be
attributed to the ad click.

This patch adds a class that represents a request for ad click
attribution. Validation makes sure that the bits of entropy
reported through this mechanism is limited.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/AdClickAttribution.cpp: Added.
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/AdClickAttribution.cpp [new file with mode: 0644]
Source/WebCore/loader/AdClickAttribution.h [new file with mode: 0644]
Source/WebCore/loader/DocumentLoader.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebCore/AdClickAttribution.cpp [new file with mode: 0644]