Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e10cb3c48fdc2ce116cf0d74cca3c96e931e7e6d
      
https://github.com/WebKit/WebKit/commit/e10cb3c48fdc2ce116cf0d74cca3c96e931e7e6d
  Author: Wenson Hsieh <[email protected]>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    R 
LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session-expected.txt
    R 
LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html
    A 
LayoutTests/http/tests/privateClickMeasurement/database-disabled-in-ephemeral-session-expected.txt
    A 
LayoutTests/http/tests/privateClickMeasurement/database-disabled-in-ephemeral-session.html
    R 
LayoutTests/http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session-expected.txt
    R 
LayoutTests/http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session.html
    A 
LayoutTests/http/tests/privateClickMeasurement/store-in-ephemeral-session-expected.txt
    A 
LayoutTests/http/tests/privateClickMeasurement/store-in-ephemeral-session.html
    M Source/WebCore/html/HTMLAnchorElement.cpp
    M Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
    M Source/WebKit/NetworkProcess/NetworkSession.cpp
    M 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClient.h
    M 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp
    M 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.h
    M 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDaemonClient.h
    A 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementEphemeralStore.cpp
    A 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementEphemeralStore.h
    M 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp
    M 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h
    M Source/WebKit/Sources.txt
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj

  Log Message:
  -----------
  Refactor Private Click Measurement support for ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=253600

Reviewed by John Wilander.

Refactor some support for the ephemeral version of Private Click Measurement 
(i.e., the version
currently used in Safari view controller), such that it's additionally 
compatible with ephemeral
browsing sessions.

* 
LayoutTests/http/tests/privateClickMeasurement/database-disabled-in-ephemeral-session-expected.txt:
 Renamed from 
LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session-expected.txt.
* 
LayoutTests/http/tests/privateClickMeasurement/database-disabled-in-ephemeral-session.html:
 Renamed from 
LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html.
* 
LayoutTests/http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session-expected.txt:
 Removed.
* 
LayoutTests/http/tests/privateClickMeasurement/store-in-ephemeral-session-expected.txt:
 Added.
* 
LayoutTests/http/tests/privateClickMeasurement/store-in-ephemeral-session.html: 
Renamed from 
LayoutTests/http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session.html.

Rename these tests to better reflect the new behavior in ephemeral sessions, 
and adjust the test
output to match.

* Source/WebCore/html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const):

Remove the early return here, and continue on call out to the client layer with 
PCM attribution
measurement data.

* Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::willSendRedirectedRequestInternal):

Additionally avoid going through with attribution, if the click measurement 
happened too long ago
(i.e. older than `PrivateClickMeasurement::maxAge`, which is currently 1 week).

* Source/WebKit/NetworkProcess/NetworkSession.cpp:
(WebKit::managerOrProxy):
(WebKit::NetworkSession::handlePrivateClickMeasurementConversion):
* 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClient.h:
* 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp:
(WebKit::PCM::ClientImpl::featureEnabled const):
(WebKit::PCM::ClientImpl::debugModeEnabled const):
(WebKit::PCM::ClientImpl::usesEphemeralDataStore const):

Enable the feature when using ephemeral sessions; however, add a new hook to 
return whether or not
we should actually attempt to persist entries to disk, or just keep them 
ephemerally in memory.

* 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.h:
* 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDaemonClient.h:
* 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementEphemeralStore.cpp:
 Added.

Add a subclass of `PCM::Store` that represents an ephemeral, single-use 
attribution measurement that
doesn't rely on any on-disk presence.

(WebKit::PCM::EphemeralStore::insertPrivateClickMeasurement):
(WebKit::PCM::EphemeralStore::markAllUnattributedPrivateClickMeasurementAsExpiredForTesting):
(WebKit::PCM::EphemeralStore::attributePrivateClickMeasurement):
(WebKit::PCM::EphemeralStore::privateClickMeasurementToStringForTesting const):
(WebKit::PCM::EphemeralStore::allAttributedPrivateClickMeasurement):
(WebKit::PCM::EphemeralStore::markAttributedPrivateClickMeasurementsAsExpiredForTesting):
(WebKit::PCM::EphemeralStore::clearExpiredPrivateClickMeasurement):
(WebKit::PCM::EphemeralStore::clearPrivateClickMeasurement):
(WebKit::PCM::EphemeralStore::reset):
(WebKit::PCM::EphemeralStore::clearPrivateClickMeasurementForRegistrableDomain):
(WebKit::PCM::EphemeralStore::clearSentAttribution):
(WebKit::PCM::EphemeralStore::close):
* 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementEphemeralStore.h:
 Added.
(WebKit::PCM::EphemeralStore::create):
* 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp:
(WebKit::PrivateClickMeasurementManager::initializeStore const):
(WebKit::PrivateClickMeasurementManager::store):
(WebKit::PrivateClickMeasurementManager::store const):

Make this create either a `PersistentStore` or `EphemeralStore`, depending on 
whether or not we're
in an ephemeral session.

* 
Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h:
* Source/WebKit/Sources.txt:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/261507@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to