<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[285170] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/285170">285170</a></dd>
<dt>Author</dt> <dd>katherine_cheney@apple.com</dd>
<dt>Date</dt> <dd>2021-11-02 11:36:32 -0700 (Tue, 02 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>PCM: Safari on iOS and macOS are not sending ad click attribution reports for Private Click Measurement
https://bugs.webkit.org/show_bug.cgi?id=228104
<rdar://problem/80991209>

Reviewed by John Wilander.

Source/WebCore:

No new tests. Several existing tests would timeout with the removal of
m_firePendingAttributionRequestsTimer.startOneShot(m_isRunningTest ? 0_s : seconds)
if the fix wasn't in place.

* loader/PrivateClickMeasurement.cpp:
(WebCore::randomlyBetweenTwentyFourAndFortyEightHours):
(WebCore::PrivateClickMeasurement::attributeAndGetEarliestTimeToSend):
* loader/PrivateClickMeasurement.h:

Source/WebKit:

firePendingAttributionRequests() was sometimes scheduling the next timer
fire to be the raw time value instead of the difference between now
and the scheduled send time. This was resulting in some reports not being
sent within the 24-48 hour range.

To test this, this patch removes the immediate timer fire for testing
and instead sets the earliest time to send values to both be 1 second.
This will test that the proper timer gets set to send both reports.

* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp:
(WebKit::PCM::Database::attributePrivateClickMeasurement):
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h:
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp:
(WebKit::PrivateClickMeasurementManager::startTimer):
(WebKit::PrivateClickMeasurementManager::attribute):
(WebKit::PrivateClickMeasurementManager::randomlyBetweenFifteenAndThirtyMinutes const):
(WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
In the case of both times being past due to report, schedule one for
15 - 30 minutes later.

* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h:
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp:
(WebKit::PCM::Store::attributePrivateClickMeasurement):
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h:

Tools:

* TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
(TestWebKitAPI::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderPrivateClickMeasurementcpp">trunk/Source/WebCore/loader/PrivateClickMeasurement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderPrivateClickMeasurementh">trunk/Source/WebCore/loader/PrivateClickMeasurement.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementDatabasecpp">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementDatabaseh">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagercpp">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerh">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementStorecpp">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementStoreh">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCorePrivateClickMeasurementcpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebCore/ChangeLog      2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2021-11-02  Kate Cheney  <katherine_cheney@apple.com>
+
+        PCM: Safari on iOS and macOS are not sending ad click attribution reports for Private Click Measurement
+        https://bugs.webkit.org/show_bug.cgi?id=228104
+        <rdar://problem/80991209>
+
+        Reviewed by John Wilander.
+
+        No new tests. Several existing tests would timeout with the removal of
+        m_firePendingAttributionRequestsTimer.startOneShot(m_isRunningTest ? 0_s : seconds)
+        if the fix wasn't in place.
+
+        * loader/PrivateClickMeasurement.cpp:
+        (WebCore::randomlyBetweenTwentyFourAndFortyEightHours):
+        (WebCore::PrivateClickMeasurement::attributeAndGetEarliestTimeToSend):
+        * loader/PrivateClickMeasurement.h:
+
</ins><span class="cx"> 2021-11-02  Tyler Wilcock  <tyler_w@apple.com>
</span><span class="cx"> 
</span><span class="cx">         AX: WebKit needs to include NSAccessibilityChildrenInNavigationOrderAttribute in accessibilityAttributeNames
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPrivateClickMeasurementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PrivateClickMeasurement.cpp (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PrivateClickMeasurement.cpp  2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebCore/loader/PrivateClickMeasurement.cpp     2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -147,12 +147,12 @@
</span><span class="cx">     m_sourceApplicationBundleID = appBundleIDForTesting;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Seconds randomlyBetweenTwentyFourAndFortyEightHours()
</del><ins>+static Seconds randomlyBetweenTwentyFourAndFortyEightHours(PrivateClickMeasurement::IsRunningLayoutTest isRunningTest)
</ins><span class="cx"> {
</span><del>-    return 24_h + Seconds(randomNumber() * (24_h).value());
</del><ins>+    return isRunningTest == PrivateClickMeasurement::IsRunningLayoutTest::Yes ? 1_s : 24_h + Seconds(randomNumber() * (24_h).value());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PrivateClickMeasurement::AttributionSecondsUntilSendData PrivateClickMeasurement::attributeAndGetEarliestTimeToSend(AttributionTriggerData&& attributionTriggerData)
</del><ins>+PrivateClickMeasurement::AttributionSecondsUntilSendData PrivateClickMeasurement::attributeAndGetEarliestTimeToSend(AttributionTriggerData&& attributionTriggerData, IsRunningLayoutTest isRunningTest)
</ins><span class="cx"> {
</span><span class="cx">     if (!attributionTriggerData.isValid() || (m_attributionTriggerData && m_attributionTriggerData->priority >= attributionTriggerData.priority))
</span><span class="cx">         return { };
</span><span class="lines">@@ -160,8 +160,8 @@
</span><span class="cx">     m_attributionTriggerData = WTFMove(attributionTriggerData);
</span><span class="cx">     // 24-48 hour delay before sending. This helps privacy since the conversion and the attribution
</span><span class="cx">     // requests are detached and the time of the attribution does not reveal the time of the conversion.
</span><del>-    auto sourceSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours();
-    auto destinationSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours();
</del><ins>+    auto sourceSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours(isRunningTest);
+    auto destinationSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours(isRunningTest);
</ins><span class="cx">     m_timesToSend = { WallTime::now() + sourceSecondsUntilSend, WallTime::now() + destinationSecondsUntilSend };
</span><span class="cx"> 
</span><span class="cx">     return AttributionSecondsUntilSendData { sourceSecondsUntilSend, destinationSecondsUntilSend };
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPrivateClickMeasurementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PrivateClickMeasurement.h (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PrivateClickMeasurement.h    2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebCore/loader/PrivateClickMeasurement.h       2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> 
</span><span class="cx">     enum class PcmDataCarried : bool { NonPersonallyIdentifiable, PersonallyIdentifiable };
</span><span class="cx">     enum class AttributionReportEndpoint : bool { Source, Destination };
</span><ins>+    enum class IsRunningLayoutTest : bool { No, Yes };
</ins><span class="cx"> 
</span><span class="cx">     struct SourceID {
</span><span class="cx">         static constexpr uint8_t MaxEntropy = 255;
</span><span class="lines">@@ -314,7 +315,7 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT static const Seconds maxAge();
</span><span class="cx">     WEBCORE_EXPORT static Expected<AttributionTriggerData, String> parseAttributionRequest(const URL& redirectURL);
</span><del>-    WEBCORE_EXPORT AttributionSecondsUntilSendData attributeAndGetEarliestTimeToSend(AttributionTriggerData&&);
</del><ins>+    WEBCORE_EXPORT AttributionSecondsUntilSendData attributeAndGetEarliestTimeToSend(AttributionTriggerData&&, IsRunningLayoutTest);
</ins><span class="cx">     WEBCORE_EXPORT bool hasHigherPriorityThan(const PrivateClickMeasurement&) const;
</span><span class="cx">     WEBCORE_EXPORT URL attributionReportSourceURL() const;
</span><span class="cx">     WEBCORE_EXPORT URL attributionReportAttributeOnURL() const;
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebKit/ChangeLog       2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2021-11-02  Kate Cheney  <katherine_cheney@apple.com>
+
+        PCM: Safari on iOS and macOS are not sending ad click attribution reports for Private Click Measurement
+        https://bugs.webkit.org/show_bug.cgi?id=228104
+        <rdar://problem/80991209>
+
+        Reviewed by John Wilander.
+
+        firePendingAttributionRequests() was sometimes scheduling the next timer
+        fire to be the raw time value instead of the difference between now
+        and the scheduled send time. This was resulting in some reports not being
+        sent within the 24-48 hour range.
+
+        To test this, this patch removes the immediate timer fire for testing
+        and instead sets the earliest time to send values to both be 1 second.
+        This will test that the proper timer gets set to send both reports.
+
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp:
+        (WebKit::PCM::Database::attributePrivateClickMeasurement):
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h:
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp:
+        (WebKit::PrivateClickMeasurementManager::startTimer):
+        (WebKit::PrivateClickMeasurementManager::attribute):
+        (WebKit::PrivateClickMeasurementManager::randomlyBetweenFifteenAndThirtyMinutes const):
+        (WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
+        In the case of both times being past due to report, schedule one for
+        15 - 30 minutes later.
+
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h:
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp:
+        (WebKit::PCM::Store::attributePrivateClickMeasurement):
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h:
+
</ins><span class="cx"> 2021-11-02  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Revert the wheel event coalescing added in r277587
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp   2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp      2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -272,7 +272,7 @@
</span><span class="cx">     return std::make_pair(unattributedPrivateClickMeasurement, attributedPrivateClickMeasurement);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::pair<std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> Database::attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite& sourceSite, const WebCore::PrivateClickMeasurement::AttributionDestinationSite& destinationSite, const ApplicationBundleIdentifier& applicationBundleIdentifier, WebCore::PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData)
</del><ins>+std::pair<std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> Database::attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite& sourceSite, const WebCore::PrivateClickMeasurement::AttributionDestinationSite& destinationSite, const ApplicationBundleIdentifier& applicationBundleIdentifier, WebCore::PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData, WebCore::PrivateClickMeasurement::IsRunningLayoutTest isRunningTest)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!RunLoop::isMain());
</span><span class="cx"> 
</span><span class="lines">@@ -298,7 +298,7 @@
</span><span class="cx">     if (previouslyUnattributed) {
</span><span class="cx">         // Always convert the pending attribution and remove it from the unattributed map.
</span><span class="cx">         removeUnattributed(*previouslyUnattributed);
</span><del>-        secondsUntilSend = previouslyUnattributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData));
</del><ins>+        secondsUntilSend = previouslyUnattributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData), isRunningTest);
</ins><span class="cx"> 
</span><span class="cx">         // We should always have a valid secondsUntilSend value for a previouslyUnattributed value because there can be no previous attribution with a higher priority.
</span><span class="cx">         if (!secondsUntilSend.hasValidSecondsUntilSendValues()) {
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx">         // If we have no new attribution, re-attribute the old one to respect the new priority, but only if this report has
</span><span class="cx">         // not been sent to the source or destination site yet.
</span><span class="cx">         if (!previouslyAttributed.value().hasPreviouslyBeenReported()) {
</span><del>-            auto secondsUntilSend = previouslyAttributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData));
</del><ins>+            auto secondsUntilSend = previouslyAttributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData), isRunningTest);
</ins><span class="cx">             if (!secondsUntilSend.hasValidSecondsUntilSendValues())
</span><span class="cx">                 return { std::nullopt, WTFMove(debugInfo) };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h     2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h        2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">     static void interruptAllDatabases();
</span><span class="cx"> 
</span><span class="cx">     void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType);
</span><del>-    std::pair<std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&);
</del><ins>+    std::pair<std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, WebCore::PrivateClickMeasurement::IsRunningLayoutTest);
</ins><span class="cx">     Vector<WebCore::PrivateClickMeasurement> allAttributedPrivateClickMeasurement();
</span><span class="cx">     void clearPrivateClickMeasurement(std::optional<WebCore::RegistrableDomain>);
</span><span class="cx">     void clearExpiredPrivateClickMeasurement();
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp    2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp       2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -273,7 +273,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PrivateClickMeasurementManager::startTimer(Seconds seconds)
</span><span class="cx"> {
</span><del>-    m_firePendingAttributionRequestsTimer.startOneShot(m_isRunningTest ? 0_s : seconds);
</del><ins>+    m_firePendingAttributionRequestsTimer.startOneShot(seconds);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PrivateClickMeasurementManager::attribute(const SourceSite& sourceSite, const AttributionDestinationSite& destinationSite, AttributionTriggerData&& attributionTriggerData, const ApplicationBundleIdentifier& applicationBundleIdentifier)
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">     if (!featureEnabled())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    store().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), [this, weakThis = WeakPtr { *this }] (auto attributionSecondsUntilSendData, auto debugInfo) {
</del><ins>+    store().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), m_isRunningTest ? WebCore::PrivateClickMeasurement::IsRunningLayoutTest::Yes : WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No, [this, weakThis = WeakPtr { *this }] (auto attributionSecondsUntilSendData, auto debugInfo) {
</ins><span class="cx">         if (!weakThis)
</span><span class="cx">             return;
</span><span class="cx">         
</span><span class="lines">@@ -382,6 +382,14 @@
</span><span class="cx">     store().clearSentAttribution(WTFMove(sentConversion), attributionReportEndpoint);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Seconds PrivateClickMeasurementManager::randomlyBetweenFifteenAndThirtyMinutes() const
+{
+    if (m_isRunningTest)
+        return 0_s;
+
+    return debugModeEnabled() ? debugModeSecondsUntilSend : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
+}
+
</ins><span class="cx"> void PrivateClickMeasurementManager::firePendingAttributionRequests()
</span><span class="cx"> {
</span><span class="cx">     if (!featureEnabled())
</span><span class="lines">@@ -408,8 +416,7 @@
</span><span class="cx">                     // We've already sent an attribution this round. We should send additional overdue attributions at
</span><span class="cx">                     // a random time between 15 and 30 minutes to avoid a burst of simultaneous attributions. If debug
</span><span class="cx">                     // mode is enabled, this should be much shorter for easy testing.
</span><del>-                    auto interval = debugModeEnabled() ? debugModeSecondsUntilSend : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
-                    startTimer(interval);
</del><ins>+                    startTimer(randomlyBetweenFifteenAndThirtyMinutes());
</ins><span class="cx">                     return;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -420,9 +427,12 @@
</span><span class="cx"> 
</span><span class="cx">                 // Update nextTimeToFire in case the later report time for this attribution is sooner than the scheduled next time to fire.
</span><span class="cx">                 // Or, if debug mode is enabled, we should send the second report on a much shorter delay for easy testing.
</span><del>-                if (laterTimeToSend)
-                    nextTimeToFire = debugModeEnabled() ? debugModeSecondsUntilSend : std::min(nextTimeToFire, laterTimeToSend.value().secondsSinceEpoch());
-
</del><ins>+                if (laterTimeToSend) {
+                    Seconds laterTimeToSendInSecondsFromNow = (*laterTimeToSend - WallTime::now());
+                    // Avoid sending expired attributions in bursts by using a random 15-30 minute interval if laterTimeToSend is expired.
+                    laterTimeToSendInSecondsFromNow = laterTimeToSendInSecondsFromNow.value() < 0 ? randomlyBetweenFifteenAndThirtyMinutes() : laterTimeToSendInSecondsFromNow;
+                    nextTimeToFire = debugModeEnabled() ? debugModeSecondsUntilSend : std::min(nextTimeToFire, laterTimeToSendInSecondsFromNow);
+                }
</ins><span class="cx">                 continue;
</span><span class="cx">             }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h      2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h 2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx">     void clearExpired();
</span><span class="cx">     bool featureEnabled() const;
</span><span class="cx">     bool debugModeEnabled() const;
</span><ins>+    Seconds randomlyBetweenFifteenAndThirtyMinutes() const;
</ins><span class="cx"> 
</span><span class="cx">     RunLoop::Timer<PrivateClickMeasurementManager> m_firePendingAttributionRequestsTimer;
</span><span class="cx">     bool m_isRunningTest { false };
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp      2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp 2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -94,9 +94,9 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Store::attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite& sourceSite, const WebCore::PrivateClickMeasurement::AttributionDestinationSite& destinationSite, const ApplicationBundleIdentifier& applicationBundleIdentifier, WebCore::PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&& completionHandler)
</del><ins>+void Store::attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite& sourceSite, const WebCore::PrivateClickMeasurement::AttributionDestinationSite& destinationSite, const ApplicationBundleIdentifier& applicationBundleIdentifier, WebCore::PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData, WebCore::PrivateClickMeasurement::IsRunningLayoutTest isRunningTest, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    postTask([this, protectedThis = Ref { *this }, sourceSite = sourceSite.isolatedCopy(), destinationSite = destinationSite.isolatedCopy(), applicationBundleIdentifier = applicationBundleIdentifier.isolatedCopy(), attributionTriggerData = WTFMove(attributionTriggerData), completionHandler = WTFMove(completionHandler)] () mutable {
</del><ins>+    postTask([this, protectedThis = Ref { *this }, sourceSite = sourceSite.isolatedCopy(), destinationSite = destinationSite.isolatedCopy(), applicationBundleIdentifier = applicationBundleIdentifier.isolatedCopy(), attributionTriggerData = WTFMove(attributionTriggerData), isRunningTest, completionHandler = WTFMove(completionHandler)] () mutable {
</ins><span class="cx">         if (!m_database) {
</span><span class="cx">             return postTaskReply([completionHandler = WTFMove(completionHandler)] () mutable {
</span><span class="cx">                 completionHandler(std::nullopt, { });
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">             });
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        auto [seconds, debugInfo] = m_database->attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData));
</del><ins>+        auto [seconds, debugInfo] = m_database->attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), isRunningTest);
</ins><span class="cx"> 
</span><span class="cx">         postTaskReply([seconds = WTFMove(seconds), debugInfo = debugInfo.isolatedCopy(), completionHandler = WTFMove(completionHandler)]() mutable {
</span><span class="cx">             completionHandler(WTFMove(seconds), WTFMove(debugInfo));
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h        2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h   2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     static void processDidResume();
</span><span class="cx"> 
</span><span class="cx">     void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, WebKit::PrivateClickMeasurementAttributionType, CompletionHandler<void()>&&);
</span><del>-    void attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&&);
</del><ins>+    void attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, WebCore::PrivateClickMeasurement::IsRunningLayoutTest, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&&);
</ins><span class="cx"> 
</span><span class="cx">     void privateClickMeasurementToStringForTesting(CompletionHandler<void(String)>&&) const;
</span><span class="cx">     void markAllUnattributedPrivateClickMeasurementAsExpiredForTesting();
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Tools/ChangeLog       2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2021-11-02  Kate Cheney  <katherine_cheney@apple.com>
+
+        PCM: Safari on iOS and macOS are not sending ad click attribution reports for Private Click Measurement
+        https://bugs.webkit.org/show_bug.cgi?id=228104
+        <rdar://problem/80991209>
+
+        Reviewed by John Wilander.
+
+        * TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2021-11-02  Tim Horton  <timothy_horton@apple.com>
</span><span class="cx"> 
</span><span class="cx">         dumpAsText() tests don't get the ref-test treatment when using --self-compare-with-header
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCorePrivateClickMeasurementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp (285169 => 285170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp      2021-11-02 18:34:18 UTC (rev 285169)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp 2021-11-02 18:36:32 UTC (rev 285170)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> TEST(PrivateClickMeasurement, WellKnownURLs)
</span><span class="cx"> {
</span><span class="cx">     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(min6BitValue), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
</span><del>-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)));
</del><ins>+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
</ins><span class="cx"> 
</span><span class="cx">     auto attributionSourceURL = attribution.attributionReportSourceURL();
</span><span class="cx">     ASSERT_EQ(attributionSourceURL.string(), "https://webkit.org/.well-known/private-click-measurement/report-attribution/");
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> TEST(PrivateClickMeasurement, ValidMinValues)
</span><span class="cx"> {
</span><span class="cx">     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(min6BitValue), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
</span><del>-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)));
</del><ins>+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_EQ(attribution.attributionReportJSON()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":0,\"attributed_on_site\":\"example.com\",\"trigger_data\":0,\"version\":2}");
</span><span class="cx"> }
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> TEST(PrivateClickMeasurement, ValidMidValues)
</span><span class="cx"> {
</span><span class="cx">     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID((uint32_t)192), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
</span><del>-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((uint32_t)9, PrivateClickMeasurement::Priority((uint32_t)22)));
</del><ins>+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((uint32_t)9, PrivateClickMeasurement::Priority((uint32_t)22)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_EQ(attribution.attributionReportJSON()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":192,\"attributed_on_site\":\"example.com\",\"trigger_data\":9,\"version\":2}");
</span><span class="cx"> }
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> TEST(PrivateClickMeasurement, ValidMaxValues)
</span><span class="cx"> {
</span><span class="cx">     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
</span><del>-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
</del><ins>+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_EQ(attribution.attributionReportJSON()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":255,\"attributed_on_site\":\"example.com\",\"trigger_data\":15,\"version\":2}");
</span><span class="cx"> }
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> {
</span><span class="cx">     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
</span><span class="cx">     auto now = WallTime::now();
</span><del>-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
</del><ins>+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
</ins><span class="cx">     auto earliestTimeToSend = attribution.timesToSend();
</span><span class="cx">     ASSERT_TRUE(earliestTimeToSend.sourceEarliestTimeToSend && earliestTimeToSend.destinationEarliestTimeToSend);
</span><span class="cx">     ASSERT_TRUE(earliestTimeToSend.sourceEarliestTimeToSend.value().secondsSinceEpoch() - 24_h >= now.secondsSinceEpoch());
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> TEST(PrivateClickMeasurement, InvalidSourceHost)
</span><span class="cx"> {
</span><span class="cx">     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { emptyURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
</span><del>-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
</del><ins>+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
</span><span class="cx">     ASSERT_TRUE(attribution.attributionReportAttributeOnURL().isEmpty());
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx"> TEST(PrivateClickMeasurement, InvalidDestinationHost)
</span><span class="cx"> {
</span><span class="cx">     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { emptyURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
</span><del>-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
</del><ins>+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
</span><span class="cx">     ASSERT_TRUE(attribution.attributionReportAttributeOnURL().isEmpty());
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> TEST(PrivateClickMeasurement, AttributionTriggerData)
</span><span class="cx"> {
</span><span class="cx">     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
</span><del>-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((PrivateClickMeasurement::AttributionTriggerData::MaxEntropy + 1), PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
</del><ins>+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((PrivateClickMeasurement::AttributionTriggerData::MaxEntropy + 1), PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
</span><span class="cx">     ASSERT_TRUE(attribution.attributionReportAttributeOnURL().isEmpty());
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx"> TEST(PrivateClickMeasurement, InvalidPriority)
</span><span class="cx"> {
</span><span class="cx">     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier", WallTime::now(), WebCore::PrivateClickMeasurement::AttributionEphemeral::No };
</span><del>-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy + 1)));
</del><ins>+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy + 1)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
</span><span class="cx">     ASSERT_TRUE(attribution.attributionReportAttributeOnURL().isEmpty());
</span></span></pre>
</div>
</div>

</body>
</html>