<!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>[283383] trunk/Source/WebKit</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/283383">283383</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2021-10-01 11:13:51 -0700 (Fri, 01 Oct 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move ephemeral PCM storage from PCM manager to NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=231025

Patch by Alex Christensen <achristensen@webkit.org> on 2021-10-01
Reviewed by Kate Cheney.

With the daemon, we want the network process to hang on to an ephemeral PCM instead of the daemon,
which is responsible for many network processes.  When attribution happens we insert the PCM then
attribute it like we did before, but from the NetworkSession instead of from the PCM manager.

Functionality covered by existing tests.
This just reduces state in the daemon.  All the other state in the PCM manager is only used for tests.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::storePrivateClickMeasurement):
(WebKit::NetworkSession::handlePrivateClickMeasurementConversion):
(WebKit::NetworkSession::clearPrivateClickMeasurement):
(WebKit::NetworkSession::setPrivateClickMeasurementEphemeralMeasurementForTesting):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp:
(WebKit::PrivateClickMeasurementManager::storeUnattributed):
(WebKit::PrivateClickMeasurementManager::getSignedUnlinkableToken):
(WebKit::PrivateClickMeasurementManager::insertPrivateClickMeasurement):
(WebKit::PrivateClickMeasurementManager::migratePrivateClickMeasurementFromLegacyStorage):
(WebKit::PrivateClickMeasurementManager::attribute):
(WebKit::PrivateClickMeasurementManager::clear):
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h:
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp:
(WebKit::PCM::messageTypeSendsReply):
(WebKit::PCM::decodeMessageAndSendToManager):
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.h:
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp:
(WebKit::PCM::ManagerProxy::storeUnattributed):
(WebKit::PCM::ManagerProxy::setEphemeralMeasurementForTesting): Deleted.
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.h:
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp:
(WebKit::PCM::Store::insertPrivateClickMeasurement):
(WebKit::PCM::Store::attributePrivateClickMeasurement):
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkSessioncpp">trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkSessionh">trunk/Source/WebKit/NetworkProcess/NetworkSession.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="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerInterfacecpp">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerInterfaceh">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerProxycpp">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerProxyh">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/ChangeLog       2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2021-10-01  Alex Christensen  <achristensen@webkit.org>
+
+        Move ephemeral PCM storage from PCM manager to NetworkSession
+        https://bugs.webkit.org/show_bug.cgi?id=231025
+
+        Reviewed by Kate Cheney.
+
+        With the daemon, we want the network process to hang on to an ephemeral PCM instead of the daemon,
+        which is responsible for many network processes.  When attribution happens we insert the PCM then
+        attribute it like we did before, but from the NetworkSession instead of from the PCM manager.
+
+        Functionality covered by existing tests.
+        This just reduces state in the daemon.  All the other state in the PCM manager is only used for tests.
+
+        * NetworkProcess/NetworkSession.cpp:
+        (WebKit::NetworkSession::storePrivateClickMeasurement):
+        (WebKit::NetworkSession::handlePrivateClickMeasurementConversion):
+        (WebKit::NetworkSession::clearPrivateClickMeasurement):
+        (WebKit::NetworkSession::setPrivateClickMeasurementEphemeralMeasurementForTesting):
+        * NetworkProcess/NetworkSession.h:
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp:
+        (WebKit::PrivateClickMeasurementManager::storeUnattributed):
+        (WebKit::PrivateClickMeasurementManager::getSignedUnlinkableToken):
+        (WebKit::PrivateClickMeasurementManager::insertPrivateClickMeasurement):
+        (WebKit::PrivateClickMeasurementManager::migratePrivateClickMeasurementFromLegacyStorage):
+        (WebKit::PrivateClickMeasurementManager::attribute):
+        (WebKit::PrivateClickMeasurementManager::clear):
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h:
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp:
+        (WebKit::PCM::messageTypeSendsReply):
+        (WebKit::PCM::decodeMessageAndSendToManager):
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.h:
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp:
+        (WebKit::PCM::ManagerProxy::storeUnattributed):
+        (WebKit::PCM::ManagerProxy::setEphemeralMeasurementForTesting): Deleted.
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.h:
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp:
+        (WebKit::PCM::Store::insertPrivateClickMeasurement):
+        (WebKit::PCM::Store::attributePrivateClickMeasurement):
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h:
+
</ins><span class="cx"> 2021-10-01  Per Arne Vollan <pvollan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [macOS] Remove obsolete sandbox rule
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp    2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp       2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -321,7 +321,13 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkSession::storePrivateClickMeasurement(WebCore::PrivateClickMeasurement&& unattributedPrivateClickMeasurement)
</span><span class="cx"> {
</span><del>-    privateClickMeasurement().storeUnattributed(WTFMove(unattributedPrivateClickMeasurement));
</del><ins>+    if (m_isRunningEphemeralMeasurementTest)
+        unattributedPrivateClickMeasurement.setEphemeral(PrivateClickMeasurement::AttributionEphemeral::Yes);
+    if (unattributedPrivateClickMeasurement.isEphemeral()) {
+        m_ephemeralMeasurement = WTFMove(unattributedPrivateClickMeasurement);
+        return;
+    }
+    privateClickMeasurement().storeUnattributed(WTFMove(unattributedPrivateClickMeasurement), [] { });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkSession::handlePrivateClickMeasurementConversion(PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData, const URL& requestURL, const WebCore::ResourceRequest& redirectRequest)
</span><span class="lines">@@ -331,6 +337,28 @@
</span><span class="cx"> #else
</span><span class="cx">     auto appBundleID = String();
</span><span class="cx"> #endif
</span><ins>+
+    if (m_ephemeralMeasurement) {
+        auto ephemeralMeasurement = *std::exchange(m_ephemeralMeasurement, std::nullopt);
+
+        auto redirectDomain = RegistrableDomain(redirectRequest.url());
+        auto firstPartyForCookies = redirectRequest.firstPartyForCookies();
+
+        // Ephemeral measurement can only have one pending click.
+        if (ephemeralMeasurement.sourceSite().registrableDomain != redirectDomain)
+            return;
+        if (ephemeralMeasurement.destinationSite().registrableDomain != RegistrableDomain(firstPartyForCookies))
+            return;
+
+        // Insert ephemeral measurement right before attribution.
+        privateClickMeasurement().storeUnattributed(WTFMove(ephemeralMeasurement), [this, weakThis = makeWeakPtr(*this), attributionTriggerData = WTFMove(attributionTriggerData), requestURL, redirectDomain = WTFMove(redirectDomain), firstPartyForCookies = WTFMove(firstPartyForCookies), appBundleID = WTFMove(appBundleID)] () mutable {
+            if (!weakThis)
+                return;
+            privateClickMeasurement().handleAttribution(WTFMove(attributionTriggerData), requestURL, WTFMove(redirectDomain), firstPartyForCookies, appBundleID);
+        });
+        return;
+    }
+
</ins><span class="cx">     privateClickMeasurement().handleAttribution(WTFMove(attributionTriggerData), requestURL, RegistrableDomain(redirectRequest.url()), redirectRequest.firstPartyForCookies(), appBundleID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -342,6 +370,8 @@
</span><span class="cx"> void NetworkSession::clearPrivateClickMeasurement(CompletionHandler<void()>&& completionHandler)
</span><span class="cx"> {
</span><span class="cx">     privateClickMeasurement().clear(WTFMove(completionHandler));
</span><ins>+    m_ephemeralMeasurement = std::nullopt;
+    m_isRunningEphemeralMeasurementTest = false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkSession::clearPrivateClickMeasurementForRegistrableDomain(WebCore::RegistrableDomain&& domain, CompletionHandler<void()>&& completionHandler)
</span><span class="lines">@@ -381,7 +411,7 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkSession::setPrivateClickMeasurementEphemeralMeasurementForTesting(bool value)
</span><span class="cx"> {
</span><del>-    privateClickMeasurement().setEphemeralMeasurementForTesting(value);
</del><ins>+    m_isRunningEphemeralMeasurementTest = value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: Switch to non-mocked test data once the right cryptography library is available in open source.
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.h (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkSession.h      2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.h 2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -215,6 +215,8 @@
</span><span class="cx"> #endif
</span><span class="cx">     bool m_isStaleWhileRevalidateEnabled { false };
</span><span class="cx">     UniqueRef<PCM::ManagerInterface> m_privateClickMeasurement;
</span><ins>+    std::optional<WebCore::PrivateClickMeasurement> m_ephemeralMeasurement;
+    bool m_isRunningEphemeralMeasurementTest { false };
</ins><span class="cx"> 
</span><span class="cx">     HashSet<Ref<NetworkResourceLoader>> m_keptAliveLoads;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp    2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp       2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -70,10 +70,10 @@
</span><span class="cx">         m_store->close([] { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PrivateClickMeasurementManager::storeUnattributed(PrivateClickMeasurement&& measurement)
</del><ins>+void PrivateClickMeasurementManager::storeUnattributed(PrivateClickMeasurement&& measurement, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     if (!featureEnabled())
</span><del>-        return;
</del><ins>+        return completionHandler();
</ins><span class="cx"> 
</span><span class="cx">     clearExpired();
</span><span class="cx"> 
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_client->broadcastConsoleMessage(MessageLevel::Log, "[Private Click Measurement] Storing a click."_s);
</span><span class="cx"> 
</span><del>-    insertPrivateClickMeasurement(WTFMove(measurement), PrivateClickMeasurementAttributionType::Unattributed);
</del><ins>+    insertPrivateClickMeasurement(WTFMove(measurement), PrivateClickMeasurementAttributionType::Unattributed, WTFMove(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PrivateClickMeasurementManager::getTokenPublicKey(PrivateClickMeasurement&& attribution, PrivateClickMeasurement::AttributionReportEndpoint attributionReportEndpoint, PrivateClickMeasurement::PcmDataCarried pcmDataCarried, Function<void(PrivateClickMeasurement&& attribution, const String& publicKeyBase64URL)>&& callback)
</span><span class="lines">@@ -212,25 +212,19 @@
</span><span class="cx"> 
</span><span class="cx">         m_client->broadcastConsoleMessage(MessageLevel::Log, "[Private Click Measurement] Storing a secret token."_s);
</span><span class="cx"> 
</span><del>-        insertPrivateClickMeasurement(WTFMove(measurement), PrivateClickMeasurementAttributionType::Unattributed);
</del><ins>+        insertPrivateClickMeasurement(WTFMove(measurement), PrivateClickMeasurementAttributionType::Unattributed, [] { });
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PrivateClickMeasurementManager::insertPrivateClickMeasurement(PrivateClickMeasurement&& measurement, PrivateClickMeasurementAttributionType type)
</del><ins>+void PrivateClickMeasurementManager::insertPrivateClickMeasurement(PrivateClickMeasurement&& measurement, PrivateClickMeasurementAttributionType type, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    if (m_isRunningEphemeralMeasurementTest)
-        measurement.setEphemeral(PrivateClickMeasurement::AttributionEphemeral::Yes);
-    if (measurement.isEphemeral()) {
-        m_ephemeralMeasurement = WTFMove(measurement);
-        return;
-    }
-    store().insertPrivateClickMeasurement(WTFMove(measurement), type);
</del><ins>+    store().insertPrivateClickMeasurement(WTFMove(measurement), type, WTFMove(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PrivateClickMeasurementManager::migratePrivateClickMeasurementFromLegacyStorage(PrivateClickMeasurement&& measurement, PrivateClickMeasurementAttributionType type)
</span><span class="cx"> {
</span><del>-    store().insertPrivateClickMeasurement(WTFMove(measurement), type);
</del><ins>+    store().insertPrivateClickMeasurement(WTFMove(measurement), type, [] { });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PrivateClickMeasurementManager::handleAttribution(AttributionTriggerData&& attributionTriggerData, const URL& requestURL, WebCore::RegistrableDomain&& redirectDomain, const URL& firstPartyURL, const ApplicationBundleIdentifier& applicationBundleIdentifier)
</span><span class="lines">@@ -276,15 +270,7 @@
</span><span class="cx">     if (!featureEnabled())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (m_ephemeralMeasurement) {
-        // Ephemeral measurement can only have one pending click.
-        if (m_ephemeralMeasurement->sourceSite() != sourceSite)
-            return;
-        if (m_ephemeralMeasurement->destinationSite() != destinationSite)
-            return;
-    }
-        
-    store().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), std::exchange(m_ephemeralMeasurement, std::nullopt), [this, weakThis = makeWeakPtr(*this)] (auto attributionSecondsUntilSendData, auto debugInfo) {
</del><ins>+    store().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), [this, weakThis = makeWeakPtr(*this)] (auto attributionSecondsUntilSendData, auto debugInfo) {
</ins><span class="cx">         if (!weakThis)
</span><span class="cx">             return;
</span><span class="cx">         
</span><span class="lines">@@ -445,8 +431,6 @@
</span><span class="cx"> void PrivateClickMeasurementManager::clear(CompletionHandler<void()>&& completionHandler)
</span><span class="cx"> {
</span><span class="cx">     m_firePendingAttributionRequestsTimer.stop();
</span><del>-    m_ephemeralMeasurement = std::nullopt;
-    m_isRunningEphemeralMeasurementTest = false;
</del><span class="cx">     m_privateClickMeasurementAppBundleIDForTesting = std::nullopt;
</span><span class="cx"> 
</span><span class="cx">     if (!featureEnabled())
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h      2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h 2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> 
</span><span class="cx">     using ApplicationBundleIdentifier = String;
</span><span class="cx"> 
</span><del>-    void storeUnattributed(PrivateClickMeasurement&&) final;
</del><ins>+    void storeUnattributed(PrivateClickMeasurement&&, CompletionHandler<void()>&&) final;
</ins><span class="cx">     void handleAttribution(AttributionTriggerData&&, const URL& requestURL, WebCore::RegistrableDomain&& redirectDomain, const URL& firstPartyURL, const ApplicationBundleIdentifier&) final;
</span><span class="cx">     void clear(CompletionHandler<void()>&&) final;
</span><span class="cx">     void clearForRegistrableDomain(const RegistrableDomain&, CompletionHandler<void()>&&) final;
</span><span class="lines">@@ -60,7 +60,6 @@
</span><span class="cx">     void setAttributionReportURLsForTesting(URL&& sourceURL, URL&& destinationURL) final;
</span><span class="cx">     void markAllUnattributedAsExpiredForTesting() final;
</span><span class="cx">     void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&) final;
</span><del>-    void setEphemeralMeasurementForTesting(bool value) final { m_isRunningEphemeralMeasurementTest = value; }
</del><span class="cx">     void setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID) final;
</span><span class="cx">     void startTimerImmediatelyForTesting() final;
</span><span class="cx">     void setPrivateClickMeasurementAppBundleIDForTesting(ApplicationBundleIdentifier&&);
</span><span class="lines">@@ -73,7 +72,7 @@
</span><span class="cx">     void startTimer(Seconds);
</span><span class="cx">     void getTokenPublicKey(PrivateClickMeasurement&&, PrivateClickMeasurement::AttributionReportEndpoint, PrivateClickMeasurement::PcmDataCarried, Function<void(PrivateClickMeasurement&& attribution, const String& publicKeyBase64URL)>&&);
</span><span class="cx">     void getSignedUnlinkableToken(PrivateClickMeasurement&&);
</span><del>-    void insertPrivateClickMeasurement(PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType);
</del><ins>+    void insertPrivateClickMeasurement(PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType, CompletionHandler<void()>&&);
</ins><span class="cx">     void clearSentAttribution(PrivateClickMeasurement&&, PrivateClickMeasurement::AttributionReportEndpoint);
</span><span class="cx">     void attribute(const SourceSite&, const AttributionDestinationSite&, AttributionTriggerData&&, const ApplicationBundleIdentifier&);
</span><span class="cx">     void fireConversionRequest(const PrivateClickMeasurement&, PrivateClickMeasurement::AttributionReportEndpoint);
</span><span class="lines">@@ -83,10 +82,8 @@
</span><span class="cx">     bool featureEnabled() const;
</span><span class="cx">     bool debugModeEnabled() const;
</span><span class="cx"> 
</span><del>-    std::optional<PrivateClickMeasurement> m_ephemeralMeasurement;
</del><span class="cx">     WebCore::Timer m_firePendingAttributionRequestsTimer;
</span><span class="cx">     bool m_isRunningTest { false };
</span><del>-    bool m_isRunningEphemeralMeasurementTest { false };
</del><span class="cx">     std::optional<URL> m_tokenPublicKeyURLForTesting;
</span><span class="cx">     std::optional<URL> m_tokenSignatureURLForTesting;
</span><span class="cx">     std::optional<ApplicationBundleIdentifier> m_privateClickMeasurementAppBundleIDForTesting;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp   2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp      2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> 
</span><span class="cx"> FUNCTION(storeUnattributed)
</span><span class="cx"> ARGUMENTS(WebCore::PrivateClickMeasurement)
</span><ins>+REPLY()
</ins><span class="cx"> END
</span><span class="cx"> 
</span><span class="cx"> FUNCTION(handleAttribution)
</span><span class="lines">@@ -98,10 +99,6 @@
</span><span class="cx"> REPLY()
</span><span class="cx"> END
</span><span class="cx"> 
</span><del>-FUNCTION(setEphemeralMeasurementForTesting)
-ARGUMENTS(bool)
-END
-
</del><span class="cx"> FUNCTION(setPCMFraudPreventionValuesForTesting)
</span><span class="cx"> ARGUMENTS(String, String, String, String)
</span><span class="cx"> END
</span><span class="lines">@@ -133,6 +130,7 @@
</span><span class="cx"> EMPTY_REPLY(clearForRegistrableDomain);
</span><span class="cx"> EMPTY_REPLY(markAttributedPrivateClickMeasurementsAsExpiredForTesting);
</span><span class="cx"> EMPTY_REPLY(destroyStoreForTesting);
</span><ins>+EMPTY_REPLY(storeUnattributed);
</ins><span class="cx"> #undef EMPTY_REPLY
</span><span class="cx"> 
</span><span class="cx"> PCM::EncodedMessage toStringForTesting::encodeReply(String reply)
</span><span class="lines">@@ -147,7 +145,6 @@
</span><span class="cx"> bool messageTypeSendsReply(MessageType messageType)
</span><span class="cx"> {
</span><span class="cx">     switch (messageType) {
</span><del>-    case MessageType::StoreUnattributed:
</del><span class="cx">     case MessageType::HandleAttribution:
</span><span class="cx">     case MessageType::MigratePrivateClickMeasurementFromLegacyStorage:
</span><span class="cx">     case MessageType::SetOverrideTimerForTesting:
</span><span class="lines">@@ -155,12 +152,12 @@
</span><span class="cx">     case MessageType::SetTokenSignatureURLForTesting:
</span><span class="cx">     case MessageType::SetAttributionReportURLsForTesting:
</span><span class="cx">     case MessageType::MarkAllUnattributedAsExpiredForTesting:
</span><del>-    case MessageType::SetEphemeralMeasurementForTesting:
</del><span class="cx">     case MessageType::SetPCMFraudPreventionValuesForTesting:
</span><span class="cx">     case MessageType::StartTimerImmediatelyForTesting:
</span><span class="cx">     case MessageType::SetPrivateClickMeasurementAppBundleIDForTesting:
</span><span class="cx">     case MessageType::AllowTLSCertificateChainForLocalPCMTesting:
</span><span class="cx">         return false;
</span><ins>+    case MessageType::StoreUnattributed:
</ins><span class="cx">     case MessageType::MarkAttributedPrivateClickMeasurementsAsExpiredForTesting:
</span><span class="cx">     case MessageType::DestroyStoreForTesting:
</span><span class="cx">     case MessageType::ToStringForTesting:
</span><span class="lines">@@ -225,7 +222,7 @@
</span><span class="cx">     ASSERT(messageTypeSendsReply(messageType) == !!replySender);
</span><span class="cx">     switch (messageType) {
</span><span class="cx">     case PCM::MessageType::StoreUnattributed:
</span><del>-        handlePCMMessage<MessageInfo::storeUnattributed>(WTFMove(encodedMessage));
</del><ins>+        handlePCMMessageWithReply<MessageInfo::storeUnattributed>(WTFMove(encodedMessage), WTFMove(replySender));
</ins><span class="cx">         break;
</span><span class="cx">     case PCM::MessageType::HandleAttribution:
</span><span class="cx">         handlePCMMessage<MessageInfo::handleAttribution>(WTFMove(encodedMessage));
</span><span class="lines">@@ -260,9 +257,6 @@
</span><span class="cx">     case PCM::MessageType::MarkAttributedPrivateClickMeasurementsAsExpiredForTesting:
</span><span class="cx">         handlePCMMessageWithReply<MessageInfo::markAttributedPrivateClickMeasurementsAsExpiredForTesting>(WTFMove(encodedMessage), WTFMove(replySender));
</span><span class="cx">         break;
</span><del>-    case PCM::MessageType::SetEphemeralMeasurementForTesting:
-        handlePCMMessage<MessageInfo::setEphemeralMeasurementForTesting>(WTFMove(encodedMessage));
-        break;
</del><span class="cx">     case PCM::MessageType::SetPCMFraudPreventionValuesForTesting:
</span><span class="cx">         handlePCMMessage<MessageInfo::setPCMFraudPreventionValuesForTesting>(WTFMove(encodedMessage));
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.h (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.h     2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.h        2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     using SourceSite = WebCore::PrivateClickMeasurement::SourceSite;
</span><span class="cx">     using ApplicationBundleIdentifier = String;
</span><span class="cx"> 
</span><del>-    virtual void storeUnattributed(PrivateClickMeasurement&&) = 0;
</del><ins>+    virtual void storeUnattributed(PrivateClickMeasurement&&, CompletionHandler<void()>&&) = 0;
</ins><span class="cx">     virtual void handleAttribution(AttributionTriggerData&&, const URL& requestURL, WebCore::RegistrableDomain&& redirectDomain, const URL& firstPartyURL, const ApplicationBundleIdentifier&) = 0;
</span><span class="cx">     virtual void clear(CompletionHandler<void()>&&) = 0;
</span><span class="cx">     virtual void clearForRegistrableDomain(const RegistrableDomain&, CompletionHandler<void()>&&) = 0;
</span><span class="lines">@@ -65,7 +65,6 @@
</span><span class="cx">     virtual void setAttributionReportURLsForTesting(URL&& sourceURL, URL&& destinationURL) = 0;
</span><span class="cx">     virtual void markAllUnattributedAsExpiredForTesting() = 0;
</span><span class="cx">     virtual void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&) = 0;
</span><del>-    virtual void setEphemeralMeasurementForTesting(bool) = 0;
</del><span class="cx">     virtual void setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID) = 0;
</span><span class="cx">     virtual void startTimerImmediatelyForTesting() = 0;
</span><span class="cx">     virtual void setPrivateClickMeasurementAppBundleIDForTesting(ApplicationBundleIdentifier&&) = 0;
</span><span class="lines">@@ -90,7 +89,6 @@
</span><span class="cx">     SetAttributionReportURLsForTesting,
</span><span class="cx">     MarkAllUnattributedAsExpiredForTesting,
</span><span class="cx">     MarkAttributedPrivateClickMeasurementsAsExpiredForTesting,
</span><del>-    SetEphemeralMeasurementForTesting,
</del><span class="cx">     SetPCMFraudPreventionValuesForTesting,
</span><span class="cx">     StartTimerImmediatelyForTesting,
</span><span class="cx">     SetPrivateClickMeasurementAppBundleIDForTesting,
</span><span class="lines">@@ -127,7 +125,6 @@
</span><span class="cx">         WebKit::PCM::MessageType::SetAttributionReportURLsForTesting,
</span><span class="cx">         WebKit::PCM::MessageType::MarkAllUnattributedAsExpiredForTesting,
</span><span class="cx">         WebKit::PCM::MessageType::MarkAttributedPrivateClickMeasurementsAsExpiredForTesting,
</span><del>-        WebKit::PCM::MessageType::SetEphemeralMeasurementForTesting,
</del><span class="cx">         WebKit::PCM::MessageType::SetPCMFraudPreventionValuesForTesting,
</span><span class="cx">         WebKit::PCM::MessageType::StartTimerImmediatelyForTesting,
</span><span class="cx">         WebKit::PCM::MessageType::SetPrivateClickMeasurementAppBundleIDForTesting,
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp       2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp  2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -75,9 +75,9 @@
</span><span class="cx"> ManagerProxy::ManagerProxy(const String& machServiceName)
</span><span class="cx">     : m_connection(machServiceName.utf8()) { }
</span><span class="cx"> 
</span><del>-void ManagerProxy::storeUnattributed(WebCore::PrivateClickMeasurement&& pcm)
</del><ins>+void ManagerProxy::storeUnattributed(WebCore::PrivateClickMeasurement&& pcm, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    sendMessage<MessageType::StoreUnattributed>(pcm);
</del><ins>+    sendMessageWithReply<MessageType::StoreUnattributed>(WTFMove(completionHandler), pcm);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ManagerProxy::handleAttribution(WebCore::PrivateClickMeasurement::AttributionTriggerData&& triggerData, const URL& requestURL, WebCore::RegistrableDomain&& redirectDomain, const URL& firstPartyURL, const ApplicationBundleIdentifier& applicationBundleIdentifier)
</span><span class="lines">@@ -135,11 +135,6 @@
</span><span class="cx">     sendMessageWithReply<MessageType::MarkAttributedPrivateClickMeasurementsAsExpiredForTesting>(WTFMove(completionHandler));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ManagerProxy::setEphemeralMeasurementForTesting(bool value)
-{
-    sendMessage<MessageType::SetEphemeralMeasurementForTesting>(value);
-}
-
</del><span class="cx"> void ManagerProxy::setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID)
</span><span class="cx"> {
</span><span class="cx">     sendMessage<MessageType::SetPCMFraudPreventionValuesForTesting>(unlinkableToken, secretToken, signature, keyID);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.h (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.h 2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.h    2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx">     using ApplicationBundleIdentifier = String;
</span><span class="cx"> 
</span><del>-    void storeUnattributed(WebCore::PrivateClickMeasurement&&) final;
</del><ins>+    void storeUnattributed(WebCore::PrivateClickMeasurement&&, CompletionHandler<void()>&&) final;
</ins><span class="cx">     void handleAttribution(WebCore::PrivateClickMeasurement::AttributionTriggerData&&, const URL& requestURL, WebCore::RegistrableDomain&& redirectDomain, const URL& firstPartyURL, const ApplicationBundleIdentifier&) final;
</span><span class="cx">     void clear(CompletionHandler<void()>&&) final;
</span><span class="cx">     void clearForRegistrableDomain(const WebCore::RegistrableDomain&, CompletionHandler<void()>&&) final;
</span><span class="lines">@@ -54,7 +54,6 @@
</span><span class="cx">     void setAttributionReportURLsForTesting(URL&& sourceURL, URL&& destinationURL) final;
</span><span class="cx">     void markAllUnattributedAsExpiredForTesting() final;
</span><span class="cx">     void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&) final;
</span><del>-    void setEphemeralMeasurementForTesting(bool) final;
</del><span class="cx">     void setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID) final;
</span><span class="cx">     void startTimerImmediatelyForTesting() final;
</span><span class="cx">     void setPrivateClickMeasurementAppBundleIDForTesting(ApplicationBundleIdentifier&&) final;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp      2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp 2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -79,11 +79,12 @@
</span><span class="cx">     RunLoop::main().dispatch(WTFMove(reply));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Store::insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&& attribution, PrivateClickMeasurementAttributionType attributionType)
</del><ins>+void Store::insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&& attribution, PrivateClickMeasurementAttributionType attributionType, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    postTask([this, protectedThis = Ref { *this }, attribution = WTFMove(attribution), attributionType] () mutable {
</del><ins>+    postTask([this, protectedThis = Ref { *this }, attribution = WTFMove(attribution), attributionType, completionHandler = WTFMove(completionHandler)] () mutable {
</ins><span class="cx">         if (m_database)
</span><span class="cx">             m_database->insertPrivateClickMeasurement(WTFMove(attribution), attributionType);
</span><ins>+        postTaskReply(WTFMove(completionHandler));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -95,9 +96,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, std::optional<WebCore::PrivateClickMeasurement>&& ephemeralMeasurement, 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, 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), ephemeralMeasurement = crossThreadCopy(ephemeralMeasurement), completionHandler = WTFMove(completionHandler)] () mutable {
</del><ins>+    postTask([this, protectedThis = Ref { *this }, sourceSite = sourceSite.isolatedCopy(), destinationSite = destinationSite.isolatedCopy(), applicationBundleIdentifier = applicationBundleIdentifier.isolatedCopy(), attributionTriggerData = WTFMove(attributionTriggerData), 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">@@ -104,12 +105,6 @@
</span><span class="cx">             });
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        // Insert ephemeral measurement right before attribution.
-        if (ephemeralMeasurement) {
-            RELEASE_ASSERT(ephemeralMeasurement->isEphemeral());
-            m_database->insertPrivateClickMeasurement(WTFMove(*ephemeralMeasurement), PrivateClickMeasurementAttributionType::Unattributed);
-        }
-
</del><span class="cx">         auto [seconds, debugInfo] = m_database->attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData));
</span><span class="cx"> 
</span><span class="cx">         postTaskReply([seconds = WTFMove(seconds), debugInfo = debugInfo.isolatedCopy(), completionHandler = WTFMove(completionHandler)]() mutable {
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h (283382 => 283383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h        2021-10-01 18:07:05 UTC (rev 283382)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h   2021-10-01 18:13:51 UTC (rev 283383)
</span><span class="lines">@@ -52,8 +52,8 @@
</span><span class="cx">     static void prepareForProcessToSuspend(CompletionHandler<void()>&&);
</span><span class="cx">     static void processDidResume();
</span><span class="cx"> 
</span><del>-    void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, WebKit::PrivateClickMeasurementAttributionType);
-    void attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, std::optional<WebCore::PrivateClickMeasurement>&& ephemeralMeasurement, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&&);
</del><ins>+    void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, WebKit::PrivateClickMeasurementAttributionType, CompletionHandler<void()>&&);
+    void attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, 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>
</div>

</body>
</html>