⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283383 in webkit


Ignore:
Timestamp:
Oct 1, 2021, 11:13:51 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

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:
Location:
trunk/Source/WebKit
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r283378 r283383  
     12021-10-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Move ephemeral PCM storage from PCM manager to NetworkSession
     4        https://bugs.webkit.org/show_bug.cgi?id=231025
     5
     6        Reviewed by Kate Cheney.
     7
     8        With the daemon, we want the network process to hang on to an ephemeral PCM instead of the daemon,
     9        which is responsible for many network processes.  When attribution happens we insert the PCM then
     10        attribute it like we did before, but from the NetworkSession instead of from the PCM manager.
     11
     12        Functionality covered by existing tests.
     13        This just reduces state in the daemon.  All the other state in the PCM manager is only used for tests.
     14
     15        * NetworkProcess/NetworkSession.cpp:
     16        (WebKit::NetworkSession::storePrivateClickMeasurement):
     17        (WebKit::NetworkSession::handlePrivateClickMeasurementConversion):
     18        (WebKit::NetworkSession::clearPrivateClickMeasurement):
     19        (WebKit::NetworkSession::setPrivateClickMeasurementEphemeralMeasurementForTesting):
     20        * NetworkProcess/NetworkSession.h:
     21        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp:
     22        (WebKit::PrivateClickMeasurementManager::storeUnattributed):
     23        (WebKit::PrivateClickMeasurementManager::getSignedUnlinkableToken):
     24        (WebKit::PrivateClickMeasurementManager::insertPrivateClickMeasurement):
     25        (WebKit::PrivateClickMeasurementManager::migratePrivateClickMeasurementFromLegacyStorage):
     26        (WebKit::PrivateClickMeasurementManager::attribute):
     27        (WebKit::PrivateClickMeasurementManager::clear):
     28        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h:
     29        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp:
     30        (WebKit::PCM::messageTypeSendsReply):
     31        (WebKit::PCM::decodeMessageAndSendToManager):
     32        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.h:
     33        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp:
     34        (WebKit::PCM::ManagerProxy::storeUnattributed):
     35        (WebKit::PCM::ManagerProxy::setEphemeralMeasurementForTesting): Deleted.
     36        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.h:
     37        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp:
     38        (WebKit::PCM::Store::insertPrivateClickMeasurement):
     39        (WebKit::PCM::Store::attributePrivateClickMeasurement):
     40        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h:
     41
    1422021-10-01  Per Arne Vollan <pvollan@apple.com>
    243
  • trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp

    r283316 r283383  
    322322void NetworkSession::storePrivateClickMeasurement(WebCore::PrivateClickMeasurement&& unattributedPrivateClickMeasurement)
    323323{
    324     privateClickMeasurement().storeUnattributed(WTFMove(unattributedPrivateClickMeasurement));
     324    if (m_isRunningEphemeralMeasurementTest)
     325        unattributedPrivateClickMeasurement.setEphemeral(PrivateClickMeasurement::AttributionEphemeral::Yes);
     326    if (unattributedPrivateClickMeasurement.isEphemeral()) {
     327        m_ephemeralMeasurement = WTFMove(unattributedPrivateClickMeasurement);
     328        return;
     329    }
     330    privateClickMeasurement().storeUnattributed(WTFMove(unattributedPrivateClickMeasurement), [] { });
    325331}
    326332
     
    332338    auto appBundleID = String();
    333339#endif
     340
     341    if (m_ephemeralMeasurement) {
     342        auto ephemeralMeasurement = *std::exchange(m_ephemeralMeasurement, std::nullopt);
     343
     344        auto redirectDomain = RegistrableDomain(redirectRequest.url());
     345        auto firstPartyForCookies = redirectRequest.firstPartyForCookies();
     346
     347        // Ephemeral measurement can only have one pending click.
     348        if (ephemeralMeasurement.sourceSite().registrableDomain != redirectDomain)
     349            return;
     350        if (ephemeralMeasurement.destinationSite().registrableDomain != RegistrableDomain(firstPartyForCookies))
     351            return;
     352
     353        // Insert ephemeral measurement right before attribution.
     354        privateClickMeasurement().storeUnattributed(WTFMove(ephemeralMeasurement), [this, weakThis = makeWeakPtr(*this), attributionTriggerData = WTFMove(attributionTriggerData), requestURL, redirectDomain = WTFMove(redirectDomain), firstPartyForCookies = WTFMove(firstPartyForCookies), appBundleID = WTFMove(appBundleID)] () mutable {
     355            if (!weakThis)
     356                return;
     357            privateClickMeasurement().handleAttribution(WTFMove(attributionTriggerData), requestURL, WTFMove(redirectDomain), firstPartyForCookies, appBundleID);
     358        });
     359        return;
     360    }
     361
    334362    privateClickMeasurement().handleAttribution(WTFMove(attributionTriggerData), requestURL, RegistrableDomain(redirectRequest.url()), redirectRequest.firstPartyForCookies(), appBundleID);
    335363}
     
    343371{
    344372    privateClickMeasurement().clear(WTFMove(completionHandler));
     373    m_ephemeralMeasurement = std::nullopt;
     374    m_isRunningEphemeralMeasurementTest = false;
    345375}
    346376
     
    382412void NetworkSession::setPrivateClickMeasurementEphemeralMeasurementForTesting(bool value)
    383413{
    384     privateClickMeasurement().setEphemeralMeasurementForTesting(value);
     414    m_isRunningEphemeralMeasurementTest = value;
    385415}
    386416
  • trunk/Source/WebKit/NetworkProcess/NetworkSession.h

    r283316 r283383  
    216216    bool m_isStaleWhileRevalidateEnabled { false };
    217217    UniqueRef<PCM::ManagerInterface> m_privateClickMeasurement;
     218    std::optional<WebCore::PrivateClickMeasurement> m_ephemeralMeasurement;
     219    bool m_isRunningEphemeralMeasurementTest { false };
    218220
    219221    HashSet<Ref<NetworkResourceLoader>> m_keptAliveLoads;
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp

    r283316 r283383  
    7171}
    7272
    73 void PrivateClickMeasurementManager::storeUnattributed(PrivateClickMeasurement&& measurement)
    74 {
    75     if (!featureEnabled())
    76         return;
     73void PrivateClickMeasurementManager::storeUnattributed(PrivateClickMeasurement&& measurement, CompletionHandler<void()>&& completionHandler)
     74{
     75    if (!featureEnabled())
     76        return completionHandler();
    7777
    7878    clearExpired();
     
    110110    m_client->broadcastConsoleMessage(MessageLevel::Log, "[Private Click Measurement] Storing a click."_s);
    111111
    112     insertPrivateClickMeasurement(WTFMove(measurement), PrivateClickMeasurementAttributionType::Unattributed);
     112    insertPrivateClickMeasurement(WTFMove(measurement), PrivateClickMeasurementAttributionType::Unattributed, WTFMove(completionHandler));
    113113}
    114114
     
    213213        m_client->broadcastConsoleMessage(MessageLevel::Log, "[Private Click Measurement] Storing a secret token."_s);
    214214
    215         insertPrivateClickMeasurement(WTFMove(measurement), PrivateClickMeasurementAttributionType::Unattributed);
    216     });
    217 
    218 }
    219 
    220 void PrivateClickMeasurementManager::insertPrivateClickMeasurement(PrivateClickMeasurement&& measurement, PrivateClickMeasurementAttributionType type)
    221 {
    222     if (m_isRunningEphemeralMeasurementTest)
    223         measurement.setEphemeral(PrivateClickMeasurement::AttributionEphemeral::Yes);
    224     if (measurement.isEphemeral()) {
    225         m_ephemeralMeasurement = WTFMove(measurement);
    226         return;
    227     }
    228     store().insertPrivateClickMeasurement(WTFMove(measurement), type);
     215        insertPrivateClickMeasurement(WTFMove(measurement), PrivateClickMeasurementAttributionType::Unattributed, [] { });
     216    });
     217
     218}
     219
     220void PrivateClickMeasurementManager::insertPrivateClickMeasurement(PrivateClickMeasurement&& measurement, PrivateClickMeasurementAttributionType type, CompletionHandler<void()>&& completionHandler)
     221{
     222    store().insertPrivateClickMeasurement(WTFMove(measurement), type, WTFMove(completionHandler));
    229223}
    230224
    231225void PrivateClickMeasurementManager::migratePrivateClickMeasurementFromLegacyStorage(PrivateClickMeasurement&& measurement, PrivateClickMeasurementAttributionType type)
    232226{
    233     store().insertPrivateClickMeasurement(WTFMove(measurement), type);
     227    store().insertPrivateClickMeasurement(WTFMove(measurement), type, [] { });
    234228}
    235229
     
    277271        return;
    278272
    279     if (m_ephemeralMeasurement) {
    280         // Ephemeral measurement can only have one pending click.
    281         if (m_ephemeralMeasurement->sourceSite() != sourceSite)
    282             return;
    283         if (m_ephemeralMeasurement->destinationSite() != destinationSite)
    284             return;
    285     }
    286        
    287     store().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), std::exchange(m_ephemeralMeasurement, std::nullopt), [this, weakThis = makeWeakPtr(*this)] (auto attributionSecondsUntilSendData, auto debugInfo) {
     273    store().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), [this, weakThis = makeWeakPtr(*this)] (auto attributionSecondsUntilSendData, auto debugInfo) {
    288274        if (!weakThis)
    289275            return;
     
    446432{
    447433    m_firePendingAttributionRequestsTimer.stop();
    448     m_ephemeralMeasurement = std::nullopt;
    449     m_isRunningEphemeralMeasurementTest = false;
    450434    m_privateClickMeasurementAppBundleIDForTesting = std::nullopt;
    451435
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h

    r283316 r283383  
    4848    using ApplicationBundleIdentifier = String;
    4949
    50     void storeUnattributed(PrivateClickMeasurement&&) final;
     50    void storeUnattributed(PrivateClickMeasurement&&, CompletionHandler<void()>&&) final;
    5151    void handleAttribution(AttributionTriggerData&&, const URL& requestURL, WebCore::RegistrableDomain&& redirectDomain, const URL& firstPartyURL, const ApplicationBundleIdentifier&) final;
    5252    void clear(CompletionHandler<void()>&&) final;
     
    6161    void markAllUnattributedAsExpiredForTesting() final;
    6262    void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&) final;
    63     void setEphemeralMeasurementForTesting(bool value) final { m_isRunningEphemeralMeasurementTest = value; }
    6463    void setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID) final;
    6564    void startTimerImmediatelyForTesting() final;
     
    7473    void getTokenPublicKey(PrivateClickMeasurement&&, PrivateClickMeasurement::AttributionReportEndpoint, PrivateClickMeasurement::PcmDataCarried, Function<void(PrivateClickMeasurement&& attribution, const String& publicKeyBase64URL)>&&);
    7574    void getSignedUnlinkableToken(PrivateClickMeasurement&&);
    76     void insertPrivateClickMeasurement(PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType);
     75    void insertPrivateClickMeasurement(PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType, CompletionHandler<void()>&&);
    7776    void clearSentAttribution(PrivateClickMeasurement&&, PrivateClickMeasurement::AttributionReportEndpoint);
    7877    void attribute(const SourceSite&, const AttributionDestinationSite&, AttributionTriggerData&&, const ApplicationBundleIdentifier&);
     
    8483    bool debugModeEnabled() const;
    8584
    86     std::optional<PrivateClickMeasurement> m_ephemeralMeasurement;
    8785    WebCore::Timer m_firePendingAttributionRequestsTimer;
    8886    bool m_isRunningTest { false };
    89     bool m_isRunningEphemeralMeasurementTest { false };
    9087    std::optional<URL> m_tokenPublicKeyURLForTesting;
    9188    std::optional<URL> m_tokenSignatureURLForTesting;
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp

    r283316 r283383  
    4949FUNCTION(storeUnattributed)
    5050ARGUMENTS(WebCore::PrivateClickMeasurement)
     51REPLY()
    5152END
    5253
     
    9798ARGUMENTS()
    9899REPLY()
    99 END
    100 
    101 FUNCTION(setEphemeralMeasurementForTesting)
    102 ARGUMENTS(bool)
    103100END
    104101
     
    134131EMPTY_REPLY(markAttributedPrivateClickMeasurementsAsExpiredForTesting);
    135132EMPTY_REPLY(destroyStoreForTesting);
     133EMPTY_REPLY(storeUnattributed);
    136134#undef EMPTY_REPLY
    137135
     
    148146{
    149147    switch (messageType) {
    150     case MessageType::StoreUnattributed:
    151148    case MessageType::HandleAttribution:
    152149    case MessageType::MigratePrivateClickMeasurementFromLegacyStorage:
     
    156153    case MessageType::SetAttributionReportURLsForTesting:
    157154    case MessageType::MarkAllUnattributedAsExpiredForTesting:
    158     case MessageType::SetEphemeralMeasurementForTesting:
    159155    case MessageType::SetPCMFraudPreventionValuesForTesting:
    160156    case MessageType::StartTimerImmediatelyForTesting:
     
    162158    case MessageType::AllowTLSCertificateChainForLocalPCMTesting:
    163159        return false;
     160    case MessageType::StoreUnattributed:
    164161    case MessageType::MarkAttributedPrivateClickMeasurementsAsExpiredForTesting:
    165162    case MessageType::DestroyStoreForTesting:
     
    226223    switch (messageType) {
    227224    case PCM::MessageType::StoreUnattributed:
    228         handlePCMMessage<MessageInfo::storeUnattributed>(WTFMove(encodedMessage));
     225        handlePCMMessageWithReply<MessageInfo::storeUnattributed>(WTFMove(encodedMessage), WTFMove(replySender));
    229226        break;
    230227    case PCM::MessageType::HandleAttribution:
     
    261258        handlePCMMessageWithReply<MessageInfo::markAttributedPrivateClickMeasurementsAsExpiredForTesting>(WTFMove(encodedMessage), WTFMove(replySender));
    262259        break;
    263     case PCM::MessageType::SetEphemeralMeasurementForTesting:
    264         handlePCMMessage<MessageInfo::setEphemeralMeasurementForTesting>(WTFMove(encodedMessage));
    265         break;
    266260    case PCM::MessageType::SetPCMFraudPreventionValuesForTesting:
    267261        handlePCMMessage<MessageInfo::setPCMFraudPreventionValuesForTesting>(WTFMove(encodedMessage));
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.h

    r283316 r283383  
    5353    using ApplicationBundleIdentifier = String;
    5454
    55     virtual void storeUnattributed(PrivateClickMeasurement&&) = 0;
     55    virtual void storeUnattributed(PrivateClickMeasurement&&, CompletionHandler<void()>&&) = 0;
    5656    virtual void handleAttribution(AttributionTriggerData&&, const URL& requestURL, WebCore::RegistrableDomain&& redirectDomain, const URL& firstPartyURL, const ApplicationBundleIdentifier&) = 0;
    5757    virtual void clear(CompletionHandler<void()>&&) = 0;
     
    6666    virtual void markAllUnattributedAsExpiredForTesting() = 0;
    6767    virtual void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&) = 0;
    68     virtual void setEphemeralMeasurementForTesting(bool) = 0;
    6968    virtual void setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID) = 0;
    7069    virtual void startTimerImmediatelyForTesting() = 0;
     
    9190    MarkAllUnattributedAsExpiredForTesting,
    9291    MarkAttributedPrivateClickMeasurementsAsExpiredForTesting,
    93     SetEphemeralMeasurementForTesting,
    9492    SetPCMFraudPreventionValuesForTesting,
    9593    StartTimerImmediatelyForTesting,
     
    128126        WebKit::PCM::MessageType::MarkAllUnattributedAsExpiredForTesting,
    129127        WebKit::PCM::MessageType::MarkAttributedPrivateClickMeasurementsAsExpiredForTesting,
    130         WebKit::PCM::MessageType::SetEphemeralMeasurementForTesting,
    131128        WebKit::PCM::MessageType::SetPCMFraudPreventionValuesForTesting,
    132129        WebKit::PCM::MessageType::StartTimerImmediatelyForTesting,
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp

    r283316 r283383  
    7676    : m_connection(machServiceName.utf8()) { }
    7777
    78 void ManagerProxy::storeUnattributed(WebCore::PrivateClickMeasurement&& pcm)
     78void ManagerProxy::storeUnattributed(WebCore::PrivateClickMeasurement&& pcm, CompletionHandler<void()>&& completionHandler)
    7979{
    80     sendMessage<MessageType::StoreUnattributed>(pcm);
     80    sendMessageWithReply<MessageType::StoreUnattributed>(WTFMove(completionHandler), pcm);
    8181}
    8282
     
    136136}
    137137
    138 void ManagerProxy::setEphemeralMeasurementForTesting(bool value)
    139 {
    140     sendMessage<MessageType::SetEphemeralMeasurementForTesting>(value);
    141 }
    142 
    143138void ManagerProxy::setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID)
    144139{
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.h

    r283316 r283383  
    4242    using ApplicationBundleIdentifier = String;
    4343
    44     void storeUnattributed(WebCore::PrivateClickMeasurement&&) final;
     44    void storeUnattributed(WebCore::PrivateClickMeasurement&&, CompletionHandler<void()>&&) final;
    4545    void handleAttribution(WebCore::PrivateClickMeasurement::AttributionTriggerData&&, const URL& requestURL, WebCore::RegistrableDomain&& redirectDomain, const URL& firstPartyURL, const ApplicationBundleIdentifier&) final;
    4646    void clear(CompletionHandler<void()>&&) final;
     
    5555    void markAllUnattributedAsExpiredForTesting() final;
    5656    void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&) final;
    57     void setEphemeralMeasurementForTesting(bool) final;
    5857    void setPCMFraudPreventionValuesForTesting(String&& unlinkableToken, String&& secretToken, String&& signature, String&& keyID) final;
    5958    void startTimerImmediatelyForTesting() final;
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp

    r283316 r283383  
    8080}
    8181
    82 void Store::insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&& attribution, PrivateClickMeasurementAttributionType attributionType)
     82void Store::insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&& attribution, PrivateClickMeasurementAttributionType attributionType, CompletionHandler<void()>&& completionHandler)
    8383{
    84     postTask([this, protectedThis = Ref { *this }, attribution = WTFMove(attribution), attributionType] () mutable {
     84    postTask([this, protectedThis = Ref { *this }, attribution = WTFMove(attribution), attributionType, completionHandler = WTFMove(completionHandler)] () mutable {
    8585        if (m_database)
    8686            m_database->insertPrivateClickMeasurement(WTFMove(attribution), attributionType);
     87        postTaskReply(WTFMove(completionHandler));
    8788    });
    8889}
     
    9697}
    9798
    98 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)
     99void 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)
    99100{
    100     postTask([this, protectedThis = Ref { *this }, sourceSite = sourceSite.isolatedCopy(), destinationSite = destinationSite.isolatedCopy(), applicationBundleIdentifier = applicationBundleIdentifier.isolatedCopy(), attributionTriggerData = WTFMove(attributionTriggerData), ephemeralMeasurement = crossThreadCopy(ephemeralMeasurement), completionHandler = WTFMove(completionHandler)] () mutable {
     101    postTask([this, protectedThis = Ref { *this }, sourceSite = sourceSite.isolatedCopy(), destinationSite = destinationSite.isolatedCopy(), applicationBundleIdentifier = applicationBundleIdentifier.isolatedCopy(), attributionTriggerData = WTFMove(attributionTriggerData), completionHandler = WTFMove(completionHandler)] () mutable {
    101102        if (!m_database) {
    102103            return postTaskReply([completionHandler = WTFMove(completionHandler)] () mutable {
    103104                completionHandler(std::nullopt, { });
    104105            });
    105         }
    106 
    107         // Insert ephemeral measurement right before attribution.
    108         if (ephemeralMeasurement) {
    109             RELEASE_ASSERT(ephemeralMeasurement->isEphemeral());
    110             m_database->insertPrivateClickMeasurement(WTFMove(*ephemeralMeasurement), PrivateClickMeasurementAttributionType::Unattributed);
    111106        }
    112107
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h

    r283316 r283383  
    5353    static void processDidResume();
    5454
    55     void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, WebKit::PrivateClickMeasurementAttributionType);
    56     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&&)>&&);
     55    void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, WebKit::PrivateClickMeasurementAttributionType, CompletionHandler<void()>&&);
     56    void attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&&);
    5757
    5858    void privateClickMeasurementToStringForTesting(CompletionHandler<void(String)>&&) const;
Note: See TracChangeset for help on using the changeset viewer.