Title: [285239] branches/safari-612.3.3.0-branch

Diff

Modified: branches/safari-612.3.3.0-branch/Source/WebCore/ChangeLog (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebCore/ChangeLog	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebCore/ChangeLog	2021-11-03 22:52:31 UTC (rev 285239)
@@ -1,3 +1,24 @@
+2021-11-03  Russell Epstein  <repst...@apple.com>
+
+        Apply patch. rdar://problem/84982191
+
+    2021-11-03  Kate Cheney  <katherine_che...@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:
+
 2021-11-02  Russell Epstein  <repst...@apple.com>
 
         Cherry-pick r283732. rdar://problem/84944569

Modified: branches/safari-612.3.3.0-branch/Source/WebCore/loader/PrivateClickMeasurement.cpp (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebCore/loader/PrivateClickMeasurement.cpp	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebCore/loader/PrivateClickMeasurement.cpp	2021-11-03 22:52:31 UTC (rev 285239)
@@ -148,12 +148,12 @@
     m_sourceApplicationBundleID = appBundleIDForTesting;
 }
 
-static Seconds randomlyBetweenTwentyFourAndFortyEightHours()
+static Seconds randomlyBetweenTwentyFourAndFortyEightHours(PrivateClickMeasurement::IsRunningLayoutTest isRunningTest)
 {
-    return 24_h + Seconds(randomNumber() * (24_h).value());
+    return isRunningTest == PrivateClickMeasurement::IsRunningLayoutTest::Yes ? 1_s : 24_h + Seconds(randomNumber() * (24_h).value());
 }
 
-PrivateClickMeasurement::AttributionSecondsUntilSendData PrivateClickMeasurement::attributeAndGetEarliestTimeToSend(AttributionTriggerData&& attributionTriggerData)
+PrivateClickMeasurement::AttributionSecondsUntilSendData PrivateClickMeasurement::attributeAndGetEarliestTimeToSend(AttributionTriggerData&& attributionTriggerData, IsRunningLayoutTest isRunningTest)
 {
     if (!attributionTriggerData.isValid() || (m_attributionTriggerData && m_attributionTriggerData->priority >= attributionTriggerData.priority))
         return { };
@@ -161,8 +161,8 @@
     m_attributionTriggerData = WTFMove(attributionTriggerData);
     // 24-48 hour delay before sending. This helps privacy since the conversion and the attribution
     // requests are detached and the time of the attribution does not reveal the time of the conversion.
-    auto sourceSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours();
-    auto destinationSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours();
+    auto sourceSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours(isRunningTest);
+    auto destinationSecondsUntilSend = randomlyBetweenTwentyFourAndFortyEightHours(isRunningTest);
     m_timesToSend = { WallTime::now() + sourceSecondsUntilSend, WallTime::now() + destinationSecondsUntilSend };
 
     return AttributionSecondsUntilSendData { sourceSecondsUntilSend, destinationSecondsUntilSend };

Modified: branches/safari-612.3.3.0-branch/Source/WebCore/loader/PrivateClickMeasurement.h (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebCore/loader/PrivateClickMeasurement.h	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebCore/loader/PrivateClickMeasurement.h	2021-11-03 22:52:31 UTC (rev 285239)
@@ -55,6 +55,7 @@
 
     enum class PcmDataCarried : bool { NonPersonallyIdentifiable, PersonallyIdentifiable };
     enum class AttributionReportEndpoint : bool { Source, Destination };
+    enum class IsRunningLayoutTest : bool { No, Yes };
 
     struct SourceID {
         static constexpr uint32_t MaxEntropy = 255;
@@ -326,7 +327,7 @@
 
     WEBCORE_EXPORT static const Seconds maxAge();
     WEBCORE_EXPORT static Expected<AttributionTriggerData, String> parseAttributionRequest(const URL& redirectURL);
-    WEBCORE_EXPORT AttributionSecondsUntilSendData attributeAndGetEarliestTimeToSend(AttributionTriggerData&&);
+    WEBCORE_EXPORT AttributionSecondsUntilSendData attributeAndGetEarliestTimeToSend(AttributionTriggerData&&, IsRunningLayoutTest);
     WEBCORE_EXPORT bool hasHigherPriorityThan(const PrivateClickMeasurement&) const;
     WEBCORE_EXPORT URL attributionReportSourceURL() const;
     WEBCORE_EXPORT URL attributionReportAttributeOnURL() const;

Modified: branches/safari-612.3.3.0-branch/Source/WebKit/ChangeLog (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebKit/ChangeLog	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebKit/ChangeLog	2021-11-03 22:52:31 UTC (rev 285239)
@@ -1,3 +1,40 @@
+2021-11-03  Russell Epstein  <repst...@apple.com>
+
+        Apply patch. rdar://problem/84982191
+
+    2021-11-03  Kate Cheney  <katherine_che...@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:
+
 2021-10-26  Russell Epstein  <repst...@apple.com>
 
         Cherry-pick r284349. rdar://problem/81171560

Modified: branches/safari-612.3.3.0-branch/Source/WebKit/ChangeLog.orig (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebKit/ChangeLog.orig	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebKit/ChangeLog.orig	2021-11-03 22:52:31 UTC (rev 285239)
@@ -1,5 +1,1036 @@
+2021-10-26  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r284349. rdar://problem/81171560
+
+    Use-after-move of m_sockets in NetworkRTCProvider::close()
+    <https://webkit.org/b/231779>
+    <rdar://problem/84278026>
+    
+    Reviewed by Youenn Fablet.
+    
+    * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+    (WebKit::NetworkRTCProvider::close):
+    - Replace WTFMove() with std::exchange() to make it clear that
+      m_sockets will be emptied, then iterate on `sockets` to close
+      them.  Update ASSERT() to check that no sockets were added
+      to m_sockets during the loop.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-18  David Kilzer  <ddkil...@apple.com>
+
+            Use-after-move of m_sockets in NetworkRTCProvider::close()
+            <https://webkit.org/b/231779>
+            <rdar://problem/84278026>
+
+            Reviewed by Youenn Fablet.
+
+            * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+            (WebKit::NetworkRTCProvider::close):
+            - Replace WTFMove() with std::exchange() to make it clear that
+              m_sockets will be emptied, then iterate on `sockets` to close
+              them.  Update ASSERT() to check that no sockets were added
+              to m_sockets during the loop.
+
+2021-10-26  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r283797. rdar://problem/81171560
+
+    Bind the number of WebRTC sockets opened per process
+    https://bugs.webkit.org/show_bug.cgi?id=231171
+    
+    Reviewed by Alex Christensen.
+    
+    Migrate from HashMap to StdMap so that we can keep the order based on socket identifiers.
+    Take benefit of the ordering so that, above a certain size, we get the oldest socket, close it and remove it from the map.
+    We set the maximum size to 256 sockets per process.
+    Fix a potential bug in NetworkRTCTCPSocketCocoa to ensure we remove the socket from the map even if the nw connection is not live.
+    Manually tested.
+    
+    * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+    * NetworkProcess/webrtc/NetworkRTCProvider.h:
+    * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-08  Youenn Fablet  <you...@apple.com>
+
+            Bind the number of WebRTC sockets opened per process
+            https://bugs.webkit.org/show_bug.cgi?id=231171
+
+            Reviewed by Alex Christensen.
+
+            Migrate from HashMap to StdMap so that we can keep the order based on socket identifiers.
+            Take benefit of the ordering so that, above a certain size, we get the oldest socket, close it and remove it from the map.
+            We set the maximum size to 256 sockets per process.
+            Fix a potential bug in NetworkRTCTCPSocketCocoa to ensure we remove the socket from the map even if the nw connection is not live.
+            Manually tested.
+
+            * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+            * NetworkProcess/webrtc/NetworkRTCProvider.h:
+            * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm:
+
+2021-10-26  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r283604. rdar://problem/81171560
+
+    Close NetworkRTCProvider sockets explicitly when closing NetworkRTCProvider
+    https://bugs.webkit.org/show_bug.cgi?id=231228
+    <rdar://83237496>
+    
+    Reviewed by Eric Carlson.
+    
+    * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+    (WebKit::NetworkRTCProvider::close):
+    Make sure to explictly closing the socket before deleting it.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-06  Youenn Fablet  <you...@apple.com>
+
+            Close NetworkRTCProvider sockets explicitly when closing NetworkRTCProvider
+            https://bugs.webkit.org/show_bug.cgi?id=231228
+            <rdar://83237496>
+
+            Reviewed by Eric Carlson.
+
+            * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+            (WebKit::NetworkRTCProvider::close):
+            Make sure to explictly closing the socket before deleting it.
+
+2021-10-26  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r283703. rdar://problem/84629308
+
+    ScopedEGLDefaultDisplay should be removed
+    https://bugs.webkit.org/show_bug.cgi?id=231011
+    
+    Patch by Kimmo Kinnunen <kkinnu...@apple.com> on 2021-10-07
+    Reviewed by Kenneth Russell.
+    
+    Source/WebCore:
+    
+    Hard-coding the code to EGL_DEFAULT_DISPLAY only and using the scoped
+    holder is making the EGLDisplays harder to use than neccessary. The
+    implementation target, e.g. the ability to call EGLTerminate, was also a bit
+    more convoluted than needed.
+    
+    Move the "call EGLTerminate" logic from a bit convoluted refcount mechanism
+    in ScopedEGLDefaultDisplay to the explicit GraphicsContextGLOpenGL::releaseResources().
+    The callers are expected to do the refcounting anyway, as the existing client
+    WebKit::ScopedWebGLRenderingResourcesRequest already did.
+    
+    Make GraphicsContextGLOpenGL::releaseResources() available on all platforms.
+    It is implemented on all ANGLE implementations.
+    Platforms can augment the implementation by implementing
+    GraphicsContextGLOpenGL::platformReleaseResources(). For Cocoa, this function
+    resets the currentContext cache that is used to optimize making context current.
+    
+    No new tests, refactor.
+    
+    * CMakeLists.txt:
+    * Headers.cmake:
+    * PlatformMac.cmake:
+    * SourcesCocoa.txt:
+    * WebCore.xcodeproj/project.pbxproj:
+    * platform/graphics/angle/ANGLEUtilities.cpp: Renamed from Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLEEGLUtilities.h.
+    (WebCore::platformIsANGLEAvailable):
+    * platform/graphics/angle/ANGLEUtilities.h: Renamed from Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLEUtilities.h.
+    Rename GraphicsContextGLANGLEUtilities to simpler and more descriptive ANGLEUtilities.
+    Add the isANGLEAvailable to there.
+    
+    * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
+    (WebCore::GraphicsContextGLOpenGL::releaseResources):
+    (WebCore::GraphicsContextGLOpenGL::platformReleaseResources):
+    * platform/graphics/angle/GraphicsContextGLANGLEEGLUtilities.cpp: Removed.
+    (WebCore::refDefaultDisplay): Deleted.
+    (WebCore::unrefDefaultDisplayIfNeeded): Deleted.
+    (WebCore::ScopedEGLDefaultDisplay::operator=): Deleted.
+    (WebCore::ScopedEGLDefaultDisplay::ScopedEGLDefaultDisplay): Deleted.
+    (WebCore::ScopedEGLDefaultDisplay::~ScopedEGLDefaultDisplay): Deleted.
+    (WebCore::ScopedEGLDefaultDisplay::releaseAllResourcesIfUnused): Deleted.
+    * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
+    (WebCore::platformIsANGLEAvailable):
+    (WebCore::initializeEGLDisplay):
+    (WebCore::GraphicsContextGLOpenGL::platformReleaseResources):
+    (WebCore::isANGLEAvailable): Deleted.
+    (WebCore::GraphicsContextGLOpenGL::releaseCurrentContext): Deleted.
+    (WebCore::GraphicsContextGLOpenGL::releaseAllResourcesIfUnused): Deleted.
+    * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
+    (WebCore::GraphicsContextGLOpenGL::releaseResources):
+    (WebCore::GraphicsContextGLOpenGL::platformReleaseResources):
+    * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
+    * platform/ios/wak/WebCoreThread.mm:
+    
+    Source/WebKit:
+    
+    Implement the release of WebGL resources with the amended
+    GraphicsContextGLOpenGL::releaseResources() instead of
+    previous separate function GraphicsContextGLOpenGL::releaseAllResources().
+    
+    Use the resource release code path universally, as
+    GraphicsContextGLOpenGL::releaseResources() is now common code.
+    
+    * GPUProcess/graphics/ScopedWebGLRenderingResourcesRequest.cpp:
+    (WebKit::ScopedWebGLRenderingResourcesRequest::scheduleFreeWebGLRenderingResources):
+    (WebKit::ScopedWebGLRenderingResourcesRequest::freeWebGLRenderingResources):
+    * GPUProcess/graphics/ScopedWebGLRenderingResourcesRequest.h:
+    * GPUProcess/graphics/ScopedWebGLRenderingResourcesRequestCocoa.cpp: Removed.
+    (WebKit::ScopedWebGLRenderingResourcesRequest::scheduleFreeWebGLRenderingResources): Deleted.
+    (WebKit::ScopedWebGLRenderingResourcesRequest::freeWebGLRenderingResources): Deleted.
+    * SourcesCocoa.txt:
+    * WebKit.xcodeproj/project.pbxproj:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-07  Kimmo Kinnunen  <kkinnu...@apple.com>
+
+            ScopedEGLDefaultDisplay should be removed
+            https://bugs.webkit.org/show_bug.cgi?id=231011
+
+            Reviewed by Kenneth Russell.
+
+            Implement the release of WebGL resources with the amended
+            GraphicsContextGLOpenGL::releaseResources() instead of
+            previous separate function GraphicsContextGLOpenGL::releaseAllResources().
+
+            Use the resource release code path universally, as
+            GraphicsContextGLOpenGL::releaseResources() is now common code.
+
+            * GPUProcess/graphics/ScopedWebGLRenderingResourcesRequest.cpp:
+            (WebKit::ScopedWebGLRenderingResourcesRequest::scheduleFreeWebGLRenderingResources):
+            (WebKit::ScopedWebGLRenderingResourcesRequest::freeWebGLRenderingResources):
+            * GPUProcess/graphics/ScopedWebGLRenderingResourcesRequest.h:
+            * GPUProcess/graphics/ScopedWebGLRenderingResourcesRequestCocoa.cpp: Removed.
+            (WebKit::ScopedWebGLRenderingResourcesRequest::scheduleFreeWebGLRenderingResources): Deleted.
+            (WebKit::ScopedWebGLRenderingResourcesRequest::freeWebGLRenderingResources): Deleted.
+            * SourcesCocoa.txt:
+            * WebKit.xcodeproj/project.pbxproj:
+
+2021-10-26  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r284344. rdar://problem/84625558
+
+    Build fix #3: Adopt attribution AVCaptureSession SPI for GPU process
+    https://bugs.webkit.org/show_bug.cgi?id=231621
+    <rdar://problem/80748535>
+    
+    Unreviewed build fix.
+    
+    
+    Source/WebCore/PAL:
+    
+    * pal/spi/cocoa/TCCSPI.h:
+    - Use HAVE(TCC_IOS_14_BIG_SUR_SPI).
+    
+    Source/WebKit:
+    
+    * Shared/Cocoa/TCCSoftLink.h:
+    (tcc_identity_create):
+    * Shared/Cocoa/TCCSoftLink.mm:
+    (tcc_identity_create):
+    - Use HAVE(TCC_IOS_14_BIG_SUR_SPI).
+    
+    Source/WTF:
+    
+    * wtf/PlatformHave.h:
+    (HAVE_TCC_IOS_14_BIG_SUR_SPI): Add.
+    - Used for TCC.framework SPI available in iOS 14 and macOS 11
+      Big Sur and later.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-17  David Kilzer  <ddkil...@apple.com>
+
+            Build fix #3: Adopt attribution AVCaptureSession SPI for GPU process
+            https://bugs.webkit.org/show_bug.cgi?id=231621
+            <rdar://problem/80748535>
+
+            Unreviewed build fix.
+
+            * Shared/Cocoa/TCCSoftLink.h:
+            (tcc_identity_create):
+            * Shared/Cocoa/TCCSoftLink.mm:
+            (tcc_identity_create):
+            - Use HAVE(TCC_IOS_14_BIG_SUR_SPI).
+
+2021-10-26  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r284251. rdar://problem/84625558
+
+    Unreviewed maccatalyst build fix.
+    
+    * GPUProcess/cocoa/GPUConnectionToWebProcessCocoa.mm:
+    (WebKit::GPUConnectionToWebProcess::setTCCIdentity):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-15  Kate Cheney  <katherine_che...@apple.com>
+
+            Unreviewed maccatalyst build fix.
+
+            * GPUProcess/cocoa/GPUConnectionToWebProcessCocoa.mm:
+            (WebKit::GPUConnectionToWebProcess::setTCCIdentity):
+
+2021-10-26  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r284220. rdar://problem/84625558
+
+    Adopt attribution AVCaptureSession SPI for GPU process
+    https://bugs.webkit.org/show_bug.cgi?id=231621
+    <rdar://problem/80748535>
+    
+    Reviewed by Eric Carlson.
+    
+    Source/WebCore:
+    
+    No new tests. Manually tested by checking App Privacy Report data.
+    
+    * SourcesCocoa.txt:
+    * WebCore.xcodeproj/project.pbxproj:
+    * platform/mediastream/RealtimeMediaSourceCenter.h:
+    * platform/mediastream/mac/AVVideoCaptureSource.mm:
+    (WebCore::AVVideoCaptureSource::setupSession):
+    
+    Source/WebCore/PAL:
+    
+    * PAL.xcodeproj/project.pbxproj:
+    * pal/spi/cocoa/AVFoundationSPI.h:
+    * pal/spi/cocoa/TCCSPI.h: Renamed from Source/WebKit/Platform/spi/ios/TCCSPI.h.
+    
+    Source/WebKit:
+    
+    Add SPI to attribute camera access to host app in the GPU process.
+    
+    * GPUProcess/GPUConnectionToWebProcess.cpp:
+    * GPUProcess/GPUConnectionToWebProcess.h:
+    * GPUProcess/cocoa/GPUConnectionToWebProcessCocoa.mm:
+    (WebKit::GPUConnectionToWebProcess::setTCCIdentity):
+    * Shared/Cocoa/TCCSoftLink.h:
+    * Shared/Cocoa/TCCSoftLink.mm:
+    * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
+    (WebKit::UserMediaCaptureManagerProxy::startProducingData):
+    * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
+    (WebKit::UserMediaCaptureManagerProxy::ConnectionProxy::setTCCIdentity):
+    * WebKit.xcodeproj/project.pbxproj:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-14  Kate Cheney  <katherine_che...@apple.com>
+
+            Adopt attribution AVCaptureSession SPI for GPU process
+            https://bugs.webkit.org/show_bug.cgi?id=231621
+            <rdar://problem/80748535>
+
+            Reviewed by Eric Carlson.
+
+            Add SPI to attribute camera access to host app in the GPU process.
+
+            * GPUProcess/GPUConnectionToWebProcess.cpp:
+            * GPUProcess/GPUConnectionToWebProcess.h:
+            * GPUProcess/cocoa/GPUConnectionToWebProcessCocoa.mm:
+            (WebKit::GPUConnectionToWebProcess::setTCCIdentity):
+            * Shared/Cocoa/TCCSoftLink.h:
+            * Shared/Cocoa/TCCSoftLink.mm:
+            * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
+            (WebKit::UserMediaCaptureManagerProxy::startProducingData):
+            * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
+            (WebKit::UserMediaCaptureManagerProxy::ConnectionProxy::setTCCIdentity):
+            * WebKit.xcodeproj/project.pbxproj:
+
+2021-10-27  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r283662. rdar://problem/84717723
+
+    Fix watchOS, tvOS, and macCatalyst builds after r283592
+    https://bugs.webkit.org/show_bug.cgi?id=231300
+    rdar://83936867
+    
+    Reviewed by Wenson Hsieh.
+    
+    Source/WebKit:
+    
+    * Platform/spi/ios/PhotosUISPI.h:
+    * UIProcess/ios/forms/WKFileUploadPanel.mm:
+    (-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]):
+    
+    Source/WTF:
+    
+    * wtf/PlatformEnableCocoa.h:
+    * wtf/PlatformHave.h:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-06  Aditya Keerthi  <akeer...@apple.com>
+
+            Fix watchOS, tvOS, and macCatalyst builds after r283592
+            https://bugs.webkit.org/show_bug.cgi?id=231300
+            rdar://83936867
+
+            Reviewed by Wenson Hsieh.
+
+            * Platform/spi/ios/PhotosUISPI.h:
+            * UIProcess/ios/forms/WKFileUploadPanel.mm:
+            (-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]):
+
+2021-10-25  Null  <n...@apple.com>
+
+        Cherry-pick r284532. rdar://problem/84625267
+
+    Source/WebKit:
+    [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials
+    https://bugs.webkit.org/show_bug.cgi?id=219813
+    <rdar://problem/72484635>
+    
+    Patch by John Pascoe <j_pas...@apple.com> on 2021-10-20
+    Reviewed by Brent Fulgham.
+    
+    Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we
+    always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1
+    of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent
+    and return a different error depending on consent was obtained.
+    
+    A fixme to add this was inadvertently removed in https://bugs.webkit.org/attachment.cgi?id=393180&action=""
+    
+    Added api test TestWebKitAPI.WebAuthenticationPanel.LADuplicateCredentialWithConsent
+    
+    * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
+    (WebKit::LocalAuthenticator::makeCredential):
+    
+    Tools:
+    [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials
+    https://bugs.webkit.org/show_bug.cgi?id=219813
+    <rdar://problem/72484635>
+    
+    Patch by John Pascoe <j_pas...@apple.com> on 2021-10-20
+    Reviewed by Brent Fulgham.
+    
+    Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we
+    always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1
+    of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent
+    and return a different error depending on consent was obtained.
+    
+    This adds a test to confirm a different path is taken whenever consent is obtained.
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
+    (TestWebKitAPI::TEST):
+    
+    LayoutTests:
+    WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials
+    https://bugs.webkit.org/show_bug.cgi?id=219813
+    <rdar://problem/72484635>
+    
+    Patch by John Pascoe <j_pas...@apple.com> on 2021-10-20
+    Reviewed by Brent Fulgham.
+    
+    Modify layout tests to reflect different exception returned when consent is provided
+    
+    * http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html:
+    * http/wpt/webauthn/public-key-credential-create-failure-local.https.html:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-20  John Pascoe  <j_pas...@apple.com>
+            [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials
+            https://bugs.webkit.org/show_bug.cgi?id=219813
+            <rdar://problem/72484635>
+
+            Reviewed by Brent Fulgham.
+
+            Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we
+            always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1
+            of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent
+            and return a different error depending on consent was obtained.
+
+            A fixme to add this was inadvertently removed in https://bugs.webkit.org/attachment.cgi?id=393180&action=""
+
+            Added api test TestWebKitAPI.WebAuthenticationPanel.LADuplicateCredentialWithConsent
+
+            * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
+            (WebKit::LocalAuthenticator::makeCredential):
+
+2021-10-25  Null  <n...@apple.com>
+
+        Cherry-pick r284294. rdar://problem/84630302
+
+    [iOS] Screen Sharing doesn't switch to AirPlay when <video> enters fullscreen mode
+    https://bugs.webkit.org/show_bug.cgi?id=231807
+    <rdar://82995799>
+    
+    Reviewed by Eric Carlson.
+    
+    WebKit will allow AVPlayer to switch to AirPlay Video mode from Screen Sharing when a
+    <video> element is in fullscreen mode. However, the fullscreen state this code depends on
+    is not stored in the GPU process.
+    
+    Implement RemoteMediaPlayerProxy::mediaPlayerFullscreenMode()
+    and ::mediaPlayerIsVideoFullscreenStandby().
+    
+    * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+    (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenMode):
+    (WebKit::RemoteMediaPlayerProxy::videoFullscreenStandbyChanged):
+    (WebKit::RemoteMediaPlayerProxy::mediaPlayerFullscreenMode const):
+    (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideoFullscreenStandby const):
+    * GPUProcess/media/RemoteMediaPlayerProxy.h:
+    * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
+    * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
+    (WebKit::MediaPlayerPrivateRemote::videoFullscreenStandbyChanged):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-15  Jer Noble  <jer.no...@apple.com>
+
+            [iOS] Screen Sharing doesn't switch to AirPlay when <video> enters fullscreen mode
+            https://bugs.webkit.org/show_bug.cgi?id=231807
+            <rdar://82995799>
+
+            Reviewed by Eric Carlson.
+
+            WebKit will allow AVPlayer to switch to AirPlay Video mode from Screen Sharing when a
+            <video> element is in fullscreen mode. However, the fullscreen state this code depends on
+            is not stored in the GPU process.
+
+            Implement RemoteMediaPlayerProxy::mediaPlayerFullscreenMode()
+            and ::mediaPlayerIsVideoFullscreenStandby().
+
+            * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+            (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenMode):
+            (WebKit::RemoteMediaPlayerProxy::videoFullscreenStandbyChanged):
+            (WebKit::RemoteMediaPlayerProxy::mediaPlayerFullscreenMode const):
+            (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideoFullscreenStandby const):
+            * GPUProcess/media/RemoteMediaPlayerProxy.h:
+            * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
+            * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
+            (WebKit::MediaPlayerPrivateRemote::videoFullscreenStandbyChanged):
+
+2021-10-25  Null  <n...@apple.com>
+
+        Cherry-pick r284102. rdar://problem/84630200
+
+    WebGL video texture upload is very slow due to excessive transfer of the video pixel buffer
+    https://bugs.webkit.org/show_bug.cgi?id=231425
+    
+    Patch by Kimmo Kinnunen <kkinnu...@apple.com> on 2021-10-13
+    Reviewed by Youenn Fablet.
+    
+    Typical WebGL content requests the videos to be uploaded to a texture
+    once per render loop update, even though the video has not changed.
+    The video pixel buffer is slow to transfer across IPC. It should be transferred
+    only when it has changed.
+    
+    MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC hold
+    the last requested pixel buffer ref. They will update it or discard it only
+    when pixelBufferForCurrentTime() is called.
+    
+    Cache the pixel buffer to MediaPlayerPrivateRemote (GPUP side proxy)
+    Cache the pixel buffer to RemoteMediaPlayerProxy (WebP side proxy)
+    
+    The caches increase the total memory use only during the duration
+    of the call, since after the ref has been updated, it refers
+    to the one always held in the original objects (MediaPlayerPrivateAVFoundationObjC
+    and MediaPlayerPrivateMediaSourceAVFObjC)
+    
+    No new tests, fixes a perf regression wrt GPUP media.
+    
+    * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+    (WebKit::RemoteMediaPlayerProxy::invalidate):
+    * GPUProcess/media/RemoteMediaPlayerProxy.h:
+    * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
+    * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
+    (WebKit::RemoteMediaPlayerProxy::nativeImageForCurrentTime):
+    (WebKit::RemoteMediaPlayerProxy::pixelBufferForCurrentTimeIfChanged):
+    (WebKit::RemoteMediaPlayerProxy::pixelBufferForCurrentTime): Deleted.
+    * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
+    * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
+    (WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-13  Kimmo Kinnunen  <kkinnu...@apple.com>
+
+            WebGL video texture upload is very slow due to excessive transfer of the video pixel buffer
+            https://bugs.webkit.org/show_bug.cgi?id=231425
+
+            Reviewed by Youenn Fablet.
+
+            Typical WebGL content requests the videos to be uploaded to a texture
+            once per render loop update, even though the video has not changed.
+            The video pixel buffer is slow to transfer across IPC. It should be transferred
+            only when it has changed.
+
+            MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC hold
+            the last requested pixel buffer ref. They will update it or discard it only
+            when pixelBufferForCurrentTime() is called.
+
+            Cache the pixel buffer to MediaPlayerPrivateRemote (GPUP side proxy)
+            Cache the pixel buffer to RemoteMediaPlayerProxy (WebP side proxy)
+
+            The caches increase the total memory use only during the duration
+            of the call, since after the ref has been updated, it refers
+            to the one always held in the original objects (MediaPlayerPrivateAVFoundationObjC
+            and MediaPlayerPrivateMediaSourceAVFObjC)
+
+            No new tests, fixes a perf regression wrt GPUP media.
+
+            * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+            (WebKit::RemoteMediaPlayerProxy::invalidate):
+            * GPUProcess/media/RemoteMediaPlayerProxy.h:
+            * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
+            * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
+            (WebKit::RemoteMediaPlayerProxy::nativeImageForCurrentTime):
+            (WebKit::RemoteMediaPlayerProxy::pixelBufferForCurrentTimeIfChanged):
+            (WebKit::RemoteMediaPlayerProxy::pixelBufferForCurrentTime): Deleted.
+            * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
+            * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
+            (WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime):
+
+2021-10-25  Null  <n...@apple.com>
+
+        Cherry-pick r283975. rdar://problem/84630618
+
+    Error the encoder in case we cannot create a RemoteVideoSample
+    https://bugs.webkit.org/show_bug.cgi?id=231505
+    <rdar://83975229>
+    
+    Reviewed by Eric Carlson.
+    
+    * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:
+    (WebKit::LibWebRTCCodecs::encodeFrame):
+    RemoteVideoSample::create can return nullptr if we cannot get an IOSurface from the pixel buffer or if pixel buffer is null
+    due to VTPixelBufferConformerCopyConformedPixelBuffer failing.
+    In that case, we error the encoder instead of trying to encode the frame.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-12  Youenn Fablet  <you...@apple.com>
+
+            Error the encoder in case we cannot create a RemoteVideoSample
+            https://bugs.webkit.org/show_bug.cgi?id=231505
+            <rdar://83975229>
+
+            Reviewed by Eric Carlson.
+
+            * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:
+            (WebKit::LibWebRTCCodecs::encodeFrame):
+            RemoteVideoSample::create can return nullptr if we cannot get an IOSurface from the pixel buffer or if pixel buffer is null
+            due to VTPixelBufferConformerCopyConformedPixelBuffer failing.
+            In that case, we error the encoder instead of trying to encode the frame.
+
+2021-10-25  Null  <n...@apple.com>
+
+        Cherry-pick r283592. rdar://problem/84625519
+
+    [iOS] Transcode videos selected from UIImagePickerController
+    https://bugs.webkit.org/show_bug.cgi?id=230639
+    rdar://79665678
+    
+    Reviewed by Tim Horton.
+    
+    Source/WebCore:
+    
+    * en.lproj/Localizable.strings:
+    
+    Add a localizable string for the message displayed while transcoding
+    video.
+    
+    Source/WebCore/PAL:
+    
+    Add AVFoundation API needed to transcode video.
+    
+    * pal/cocoa/AVFoundationSoftLink.h:
+    * pal/cocoa/AVFoundationSoftLink.mm:
+    
+    Source/WebKit:
+    
+    File inputs on iOS allow users to choose images/videos from the system
+    photo picker, using UIImagePickerController. In single selection mode,
+    UIImagePickerController transcodes the selected video to H.264. However,
+    in multiple selection mode, video is not transcoded and is left in its
+    original format.
+    
+    Today, videos on most iOS devices are encoded with HEVC by default.
+    However, some sites, such as Twitter, only accept H.264 encoded video.
+    Thus, the current video upload behavior is problematic, as users may be
+    unable to upload video.
+    
+    Unfortunately, the photo picking functionality of UIImagePickerController
+    is deprecated. The best solution would be to adopt PHPickerViewController,
+    the replacement API, which performs transcoding when retrieving selected
+    items (regardless of single/multiple selection). However,
+    PHPickerViewController currently lacks other functionality that WebKit
+    requires, preventing adoption.
+    
+    Consequently, the short term solution is to transcode the videos in
+    WebKit, ensuring H.264 encoded video is always provided to sites. See
+    below for implementation details.
+    
+    * Platform/spi/ios/PhotosUISPI.h: Added.
+    * UIProcess/ios/forms/WKFileUploadPanel.mm:
+    (-[_WKFileUploadItem setFileURL:]):
+    
+    Add a setter to update the file URL. Called after transcoding a _WKFileUploadItem.
+    
+    (-[WKFileUploadMediaTranscoder initWithItems:videoCount:completionHandler:]):
+    
+    Introduce WKFileUploadMediaTranscoder to manage transcoding of videos
+    and the display of progress UI. Transcoding is performed serially
+    (one video at a time), but occurs off the main thread.
+    
+    (-[WKFileUploadMediaTranscoder start]):
+    
+    Begin transcoding. Run a timer to update the progress UI, as
+    AVAssetExportSession does not provide progress updates on its own.
+    
+    The progress UI is implemented using PUActivityProgressController, to
+    match system Photos UI.
+    
+    (-[WKFileUploadMediaTranscoder _processItemAtIndex:]):
+    
+    Transcode a single video, using AVAssetExportSession. If transcoding
+    fails for any reason, the original video is used as a fallback.
+    Transcoding can also be cancelled using the progress UI, in which case
+    no more videos are processed.
+    
+    (-[WKFileUploadMediaTranscoder _finishedProcessing]):
+    (-[WKFileUploadMediaTranscoder _dismissProgress]):
+    (-[WKFileUploadMediaTranscoder _updateProgress:]):
+    (-[WKFileUploadMediaTranscoder _temporaryDirectoryCreateIfNecessary]):
+    (-[WKFileUploadPanel _chooseMediaItems:]):
+    
+    Refactor the common aspects of single/multiple media selection into a
+    single method.
+    
+    (-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]):
+    (-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]):
+    (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
+    (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:successBlock:failureBlock:]):
+    (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
+    
+    Remove redundant platform conditional.
+    
+    (-[WKFileUploadPanel _uploadMediaItemsTranscodingVideo:]):
+    
+    If any videos were selected, transcode them prior to uploading.
+    
+    * WebKit.xcodeproj/project.pbxproj:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-05  Aditya Keerthi  <akeer...@apple.com>
+
+            [iOS] Transcode videos selected from UIImagePickerController
+            https://bugs.webkit.org/show_bug.cgi?id=230639
+            rdar://79665678
+
+            Reviewed by Tim Horton.
+
+            File inputs on iOS allow users to choose images/videos from the system
+            photo picker, using UIImagePickerController. In single selection mode,
+            UIImagePickerController transcodes the selected video to H.264. However,
+            in multiple selection mode, video is not transcoded and is left in its
+            original format.
+
+            Today, videos on most iOS devices are encoded with HEVC by default.
+            However, some sites, such as Twitter, only accept H.264 encoded video.
+            Thus, the current video upload behavior is problematic, as users may be
+            unable to upload video.
+
+            Unfortunately, the photo picking functionality of UIImagePickerController
+            is deprecated. The best solution would be to adopt PHPickerViewController,
+            the replacement API, which performs transcoding when retrieving selected
+            items (regardless of single/multiple selection). However,
+            PHPickerViewController currently lacks other functionality that WebKit
+            requires, preventing adoption.
+
+            Consequently, the short term solution is to transcode the videos in
+            WebKit, ensuring H.264 encoded video is always provided to sites. See
+            below for implementation details.
+
+            * Platform/spi/ios/PhotosUISPI.h: Added.
+            * UIProcess/ios/forms/WKFileUploadPanel.mm:
+            (-[_WKFileUploadItem setFileURL:]):
+
+            Add a setter to update the file URL. Called after transcoding a _WKFileUploadItem.
+
+            (-[WKFileUploadMediaTranscoder initWithItems:videoCount:completionHandler:]):
+
+            Introduce WKFileUploadMediaTranscoder to manage transcoding of videos
+            and the display of progress UI. Transcoding is performed serially
+            (one video at a time), but occurs off the main thread.
+
+            (-[WKFileUploadMediaTranscoder start]):
+
+            Begin transcoding. Run a timer to update the progress UI, as
+            AVAssetExportSession does not provide progress updates on its own.
+
+            The progress UI is implemented using PUActivityProgressController, to
+            match system Photos UI.
+
+            (-[WKFileUploadMediaTranscoder _processItemAtIndex:]):
+
+            Transcode a single video, using AVAssetExportSession. If transcoding
+            fails for any reason, the original video is used as a fallback.
+            Transcoding can also be cancelled using the progress UI, in which case
+            no more videos are processed.
+
+            (-[WKFileUploadMediaTranscoder _finishedProcessing]):
+            (-[WKFileUploadMediaTranscoder _dismissProgress]):
+            (-[WKFileUploadMediaTranscoder _updateProgress:]):
+            (-[WKFileUploadMediaTranscoder _temporaryDirectoryCreateIfNecessary]):
+            (-[WKFileUploadPanel _chooseMediaItems:]):
+
+            Refactor the common aspects of single/multiple media selection into a
+            single method.
+
+            (-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]):
+            (-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]):
+            (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
+            (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:successBlock:failureBlock:]):
+            (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
+
+            Remove redundant platform conditional.
+
+            (-[WKFileUploadPanel _uploadMediaItemsTranscodingVideo:]):
+
+            If any videos were selected, transcode them prior to uploading.
+
+            * WebKit.xcodeproj/project.pbxproj:
+
+2021-10-25  Null  <n...@apple.com>
+
+        Cherry-pick r283515. rdar://problem/84624826
+
+    [WebAuthn] Prefer internal user verification if available over pin entry.
+    https://bugs.webkit.org/show_bug.cgi?id=213903
+    <rdar://problem/65359269>
+    
+    Patch by John Pascoe <j_pas...@apple.com> on 2021-10-04
+    Reviewed by Brent Fulgham.
+    
+    Source/WebCore:
+    
+    This adds an option to mock internal user verification in tests.
+    
+    * testing/MockWebAuthenticationConfiguration.h:
+    (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::encode const):
+    (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode):
+    * testing/MockWebAuthenticationConfiguration.idl:
+    
+    Source/WebKit:
+    
+    * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
+    (WebKit::MockHidConnection::feedReports):
+    * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
+    (WebKit::CtapAuthenticator::makeCredential):
+    (WebKit::CtapAuthenticator::getAssertion):
+    (WebKit::fido::toStatus): Deleted.
+    (WebKit::fido::isPinError): Deleted.
+    
+    Tools:
+    
+    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+    * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
+    (TestWebKitAPI::TEST):
+    * TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-hid-internal-uv.html: Added.
+    * TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-internal-uv.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-04  John Pascoe  <j_pas...@apple.com>
+
+            [WebAuthn] Prefer internal user verification if available over pin entry.
+            https://bugs.webkit.org/show_bug.cgi?id=213903
+            <rdar://problem/65359269>
+
+            Reviewed by Brent Fulgham.
+
+            * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
+            (WebKit::MockHidConnection::feedReports):
+            * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
+            (WebKit::CtapAuthenticator::makeCredential):
+            (WebKit::CtapAuthenticator::getAssertion):
+            (WebKit::fido::toStatus): Deleted.
+            (WebKit::fido::isPinError): Deleted.
+
+2021-10-25  Null  <n...@apple.com>
+
+        Cherry-pick r284692. rdar://problem/84553142
+
+    Followup to r284652: ensure file handle is closed in web process
+    https://bugs.webkit.org/show_bug.cgi?id=232127
+    
+    Reviewed by Youenn Fablet.
+    
+    Source/WebCore:
+    
+    Covered by test: storage/filesystemaccess/sync-access-handle-close-worker.html
+    
+    * Modules/filesystemaccess/FileSystemSyncAccessHandle.cpp:
+    (WebCore::FileSystemSyncAccessHandle::~FileSystemSyncAccessHandle): make sure file handle is closed when
+    FileSystemSyncAccessHandle is destroyed.
+    (WebCore::FileSystemSyncAccessHandle::closeInternal):
+    (WebCore::FileSystemSyncAccessHandle::close):
+    * Modules/filesystemaccess/FileSystemSyncAccessHandle.h:
+    
+    Source/WebKit:
+    
+    * NetworkProcess/storage/FileSystemStorageHandle.cpp:
+    (WebKit::FileSystemStorageHandle::~FileSystemStorageHandle):
+    (WebKit::FileSystemStorageHandle::createSyncAccessHandle):
+    (WebKit::FileSystemStorageHandle::close):
+    * NetworkProcess/storage/FileSystemStorageHandle.h:
+    * Platform/IPC/cocoa/SharedFileHandleCocoa.cpp: an extra fd is created here and does not get closed.
+    (IPC::SharedFileHandle::decode):
+    
+    LayoutTests:
+    
+    * storage/filesystemaccess/resources/sync-access-handle-close.js:
+    (testSyncFunction):
+    (async testAsyncFunction):
+    (async testFunctions):
+    (async testMultipleHandles):
+    (async test):
+    * storage/filesystemaccess/sync-access-handle-close-worker-expected.txt:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-22  Sihui Liu  <sihui_...@apple.com>
+
+            Followup to r284652: ensure file handle is closed in web process
+            https://bugs.webkit.org/show_bug.cgi?id=232127
+
+            Reviewed by Youenn Fablet.
+
+            * NetworkProcess/storage/FileSystemStorageHandle.cpp:
+            (WebKit::FileSystemStorageHandle::~FileSystemStorageHandle):
+            (WebKit::FileSystemStorageHandle::createSyncAccessHandle):
+            (WebKit::FileSystemStorageHandle::close):
+            * NetworkProcess/storage/FileSystemStorageHandle.h:
+            * Platform/IPC/cocoa/SharedFileHandleCocoa.cpp: an extra fd is created here and does not get closed.
+            (IPC::SharedFileHandle::decode):
+
+2021-10-25  Null  <n...@apple.com>
+
+        Cherry-pick r284712. rdar://problem/81586485
+
+    AX: Inform AX when the injected bundle sends a synchronous message
+    https://bugs.webkit.org/show_bug.cgi?id=232159
+    
+    Reviewed by Andres Gonzalez.
+    
+    When an injected bundle sends a synchronous message we need to inform accessibility clients, so they don't get
+    stuck trying to message the WebContent process. This is already handled for synchronous messages
+    generated from the WebPage.
+    
+    * WebProcess/InjectedBundle/InjectedBundle.cpp:
+    (WebKit::InjectedBundle::postSynchronousMessage):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-22  Chris Fleizach  <cfleiz...@apple.com>
+
+            AX: Inform AX when the injected bundle sends a synchronous message
+            https://bugs.webkit.org/show_bug.cgi?id=232159
+
+            Reviewed by Andres Gonzalez.
+
+            When an injected bundle sends a synchronous message we need to inform accessibility clients, so they don't get
+            stuck trying to message the WebContent process. This is already handled for synchronous messages
+            generated from the WebPage.
+
+            * WebProcess/InjectedBundle/InjectedBundle.cpp:
+            (WebKit::InjectedBundle::postSynchronousMessage):
+
+2021-10-25  Null  <n...@apple.com>
+
+        Cherry-pick r284644. rdar://problem/84153991
+
+    Rare crash under DisplayLink::displayLinkCallback()
+    https://bugs.webkit.org/show_bug.cgi?id=232101
+    <rdar://84153991>
+    
+    Reviewed by Tim Horton.
+    
+    The crash was a divide by zero under m_currentUpdate.nextUpdate(), indicating that
+    m_currentUpdate.updatesPerSecond was zero. Previous assumptions that this was caused
+    by weird display configs were wrong. The actual issue is a race condition where
+    the callback can fire while we're still inside CVDisplayLinkStart(), or at least
+    before we've updated m_currentUpdate.
+    
+    The fix is to initialize m_currentUpdate before we call CVDisplayLinkStart().
+    
+    * UIProcess/mac/DisplayLink.cpp:
+    (WebKit::DisplayLink::addObserver):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-21  Simon Fraser  <simon.fra...@apple.com>
+
+            Rare crash under DisplayLink::displayLinkCallback()
+            https://bugs.webkit.org/show_bug.cgi?id=232101
+            <rdar://84153991>
+
+            Reviewed by Tim Horton.
+
+            The crash was a divide by zero under m_currentUpdate.nextUpdate(), indicating that
+            m_currentUpdate.updatesPerSecond was zero. Previous assumptions that this was caused
+            by weird display configs were wrong. The actual issue is a race condition where
+            the callback can fire while we're still inside CVDisplayLinkStart(), or at least
+            before we've updated m_currentUpdate.
+
+            The fix is to initialize m_currentUpdate before we call CVDisplayLinkStart().
+
+            * UIProcess/mac/DisplayLink.cpp:
+            (WebKit::DisplayLink::addObserver):
+
+2021-10-19  Russell Epstein  <repst...@apple.com>
+
+        Revert r283931. rdar://problem/83953710
+
 2021-10-18  Russell Epstein  <repst...@apple.com>
 
+        Apply patch. rdar://problem/84351866
+
+    2021-10-18  Alex Christensen  <achristen...@webkit.org>
+
+            Use attributedBundleIdentifier instead of applicationBundleIdentifier when present for handling PCM attribution
+            https://bugs.webkit.org/show_bug.cgi?id=231827
+
+            Reviewed by John Wilander.
+
+            This is the same identifier that SafariViewController uses in _setEphemeralUIEventAttribution:forApplicationWithBundleID:
+            If we don't do this, then SafariViewController looks in the database for PCMs from com.apple.SafariViewService and doesn't find any and doesn't send any reports.
+
+            * NetworkProcess/NetworkDataTask.cpp:
+            (WebKit::NetworkDataTask::attributedBundleIdentifier):
+            * NetworkProcess/NetworkDataTask.h:
+            * NetworkProcess/NetworkLoad.cpp:
+            (WebKit::NetworkLoad::attributedBundleIdentifier):
+            * NetworkProcess/NetworkLoad.h:
+            * NetworkProcess/NetworkResourceLoader.cpp:
+            (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
+            * NetworkProcess/NetworkResourceLoader.h:
+            * NetworkProcess/NetworkSession.cpp:
+            (WebKit::NetworkSession::handlePrivateClickMeasurementConversion):
+            * NetworkProcess/NetworkSession.h:
+            * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
+            * UIProcess/API/Cocoa/WKWebViewTesting.mm:
+            (-[WKWebView _addEventAttributionWithSourceID:destinationURL:sourceDescription:purchaser:reportEndpoint:optionalNonce:applicationBundleID:ephemeral:]):
+            (-[WKWebView _addEventAttributionWithSourceID:destinationURL:sourceDescription:purchaser:reportEndpoint:optionalNonce:applicationBundleID:]): Deleted.
+
+2021-10-18  Russell Epstein  <repst...@apple.com>
+
         Apply patch. rdar://problem/84313358
 
     2021-10-18  Alex Christensen  <achristen...@webkit.org>

Modified: branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp	2021-11-03 22:52:31 UTC (rev 285239)
@@ -273,7 +273,7 @@
     return std::make_pair(unattributedPrivateClickMeasurement, attributedPrivateClickMeasurement);
 }
 
-std::pair<std::optional<PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> Database::attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite& sourceSite, const WebCore::PrivateClickMeasurement::AttributionDestinationSite& destinationSite, const ApplicationBundleIdentifier& applicationBundleIdentifier, WebCore::PrivateClickMeasurement::AttributionTriggerData&& attributionTriggerData)
+std::pair<std::optional<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)
 {
     ASSERT(!RunLoop::isMain());
 
@@ -299,7 +299,7 @@
     if (previouslyUnattributed) {
         // Always convert the pending attribution and remove it from the unattributed map.
         removeUnattributed(*previouslyUnattributed);
-        secondsUntilSend = previouslyUnattributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData));
+        secondsUntilSend = previouslyUnattributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData), isRunningTest);
 
         // We should always have a valid secondsUntilSend value for a previouslyUnattributed value because there can be no previous attribution with a higher priority.
         if (!secondsUntilSend.hasValidSecondsUntilSendValues()) {
@@ -321,7 +321,7 @@
         // If we have no new attribution, re-attribute the old one to respect the new priority, but only if this report has
         // not been sent to the source or destination site yet.
         if (!previouslyAttributed.value().hasPreviouslyBeenReported()) {
-            auto secondsUntilSend = previouslyAttributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData));
+            auto secondsUntilSend = previouslyAttributed.value().attributeAndGetEarliestTimeToSend(WTFMove(attributionTriggerData), isRunningTest);
             if (!secondsUntilSend.hasValidSecondsUntilSendValues())
                 return { std::nullopt, WTFMove(debugInfo) };
 

Modified: branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h	2021-11-03 22:52:31 UTC (rev 285239)
@@ -46,7 +46,7 @@
     static void interruptAllDatabases();
 
     void insertPrivateClickMeasurement(WebCore::PrivateClickMeasurement&&, PrivateClickMeasurementAttributionType);
-    std::pair<std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>, DebugInfo> attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&);
+    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);
     Vector<WebCore::PrivateClickMeasurement> allAttributedPrivateClickMeasurement();
     void clearPrivateClickMeasurement(std::optional<WebCore::RegistrableDomain>);
     void clearExpiredPrivateClickMeasurement();

Modified: branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp	2021-11-03 22:52:31 UTC (rev 285239)
@@ -95,9 +95,9 @@
     });
 }
 
-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)
+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, WebCore::PrivateClickMeasurement::IsRunningLayoutTest isRunningTest, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&& completionHandler)
 {
-    postTask([this, protectedThis = makeRef(*this), sourceSite = sourceSite.isolatedCopy(), destinationSite = destinationSite.isolatedCopy(), applicationBundleIdentifier = applicationBundleIdentifier.isolatedCopy(), attributionTriggerData = WTFMove(attributionTriggerData), ephemeralMeasurement = crossThreadCopy(ephemeralMeasurement), completionHandler = WTFMove(completionHandler)] () mutable {
+    postTask([this, protectedThis = makeRef(*this), sourceSite = sourceSite.isolatedCopy(), destinationSite = destinationSite.isolatedCopy(), applicationBundleIdentifier = applicationBundleIdentifier.isolatedCopy(), attributionTriggerData = WTFMove(attributionTriggerData), ephemeralMeasurement = crossThreadCopy(ephemeralMeasurement), isRunningTest, completionHandler = WTFMove(completionHandler)] () mutable {
         if (!m_database) {
             return postTaskReply([completionHandler = WTFMove(completionHandler)] () mutable {
                 completionHandler(std::nullopt, { });
@@ -110,7 +110,7 @@
             m_database->insertPrivateClickMeasurement(WTFMove(*ephemeralMeasurement), PrivateClickMeasurementAttributionType::Unattributed);
         }
 
-        auto [seconds, debugInfo] = m_database->attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData));
+        auto [seconds, debugInfo] = m_database->attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), isRunningTest);
 
         postTaskReply([seconds = WTFMove(seconds), debugInfo = debugInfo.isolatedCopy(), completionHandler = WTFMove(completionHandler)]() mutable {
             completionHandler(WTFMove(seconds), WTFMove(debugInfo));

Modified: branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h	2021-11-03 22:52:31 UTC (rev 285239)
@@ -53,7 +53,7 @@
     static void processDidResume();
 
     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&&)>&&);
+    void attributePrivateClickMeasurement(const WebCore::PrivateClickMeasurement::SourceSite&, const WebCore::PrivateClickMeasurement::AttributionDestinationSite&, const ApplicationBundleIdentifier&, WebCore::PrivateClickMeasurement::AttributionTriggerData&&, std::optional<WebCore::PrivateClickMeasurement>&& ephemeralMeasurement, WebCore::PrivateClickMeasurement::IsRunningLayoutTest, CompletionHandler<void(std::optional<WebCore::PrivateClickMeasurement::AttributionSecondsUntilSendData>&&, DebugInfo&&)>&&);
 
     void privateClickMeasurementToStringForTesting(CompletionHandler<void(String)>&&);
     void markAllUnattributedPrivateClickMeasurementAsExpiredForTesting();

Modified: branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2021-11-03 22:52:31 UTC (rev 285239)
@@ -288,7 +288,7 @@
 
 void PrivateClickMeasurementManager::startTimer(Seconds seconds)
 {
-    m_firePendingAttributionRequestsTimer.startOneShot(m_isRunningTest ? 0_s : seconds);
+    m_firePendingAttributionRequestsTimer.startOneShot(seconds);
 }
 
 void PrivateClickMeasurementManager::attribute(const SourceSite& sourceSite, const AttributionDestinationSite& destinationSite, AttributionTriggerData&& attributionTriggerData, const ApplicationBundleIdentifier& applicationBundleIdentifier)
@@ -306,7 +306,7 @@
     }
         
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics()) {
-        resourceLoadStatistics->privateClickMeasurementStore().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), std::exchange(m_ephemeralMeasurement, std::nullopt), [this, weakThis = makeWeakPtr(*this)] (auto attributionSecondsUntilSendData, auto debugInfo) {
+        resourceLoadStatistics->privateClickMeasurementStore().attributePrivateClickMeasurement(sourceSite, destinationSite, applicationBundleIdentifier, WTFMove(attributionTriggerData), std::exchange(m_ephemeralMeasurement, std::nullopt), m_isRunningTest ? WebCore::PrivateClickMeasurement::IsRunningLayoutTest::Yes : WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No, [this, weakThis = makeWeakPtr(*this)] (auto attributionSecondsUntilSendData, auto debugInfo) {
             if (!weakThis)
                 return;
             
@@ -413,6 +413,14 @@
 #endif
 }
 
+Seconds PrivateClickMeasurementManager::randomlyBetweenFifteenAndThirtyMinutes() const
+ {
+     if (m_isRunningTest)
+         return 0_s;
+ 
+     return debugModeEnabled() ? debugModeSecondsUntilSend : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
+ }
+
 void PrivateClickMeasurementManager::firePendingAttributionRequests()
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
@@ -444,8 +452,7 @@
                     // We've already sent an attribution this round. We should send additional overdue attributions at
                     // a random time between 15 and 30 minutes to avoid a burst of simultaneous attributions. If debug
                     // mode is enabled, this should be much shorter for easy testing.
-                    auto interval = debugModeEnabled() ? debugModeSecondsUntilSend : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
-                    startTimer(interval);
+                    startTimer(randomlyBetweenFifteenAndThirtyMinutes());
                     return;
                 }
 
@@ -456,9 +463,12 @@
 
                 // Update nextTimeToFire in case the later report time for this attribution is sooner than the scheduled next time to fire.
                 // Or, if debug mode is enabled, we should send the second report on a much shorter delay for easy testing.
-                if (laterTimeToSend)
-                    nextTimeToFire = debugModeEnabled() ? debugModeSecondsUntilSend : std::min(nextTimeToFire, laterTimeToSend.value().secondsSinceEpoch());
-
+                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);
+                 }
                 continue;
             }
 

Modified: branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.h (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.h	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.h	2021-11-03 22:52:31 UTC (rev 285239)
@@ -83,6 +83,7 @@
     void clearExpired();
     bool featureEnabled() const;
     bool debugModeEnabled() const;
+    Seconds randomlyBetweenFifteenAndThirtyMinutes() const;
 
     std::optional<PrivateClickMeasurement> m_ephemeralMeasurement;
     WebCore::Timer m_firePendingAttributionRequestsTimer;

Modified: branches/safari-612.3.3.0-branch/Tools/ChangeLog (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Tools/ChangeLog	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Tools/ChangeLog	2021-11-03 22:52:31 UTC (rev 285239)
@@ -1,3 +1,18 @@
+2021-11-03  Russell Epstein  <repst...@apple.com>
+
+        Apply patch. rdar://problem/84982191
+
+    2021-11-03  Kate Cheney  <katherine_che...@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):
+
 2021-10-26  Russell Epstein  <repst...@apple.com>
 
         Cherry-pick r284669. rdar://problem/83971417

Modified: branches/safari-612.3.3.0-branch/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp (285238 => 285239)


--- branches/safari-612.3.3.0-branch/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp	2021-11-03 22:41:25 UTC (rev 285238)
+++ branches/safari-612.3.3.0-branch/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp	2021-11-03 22:52:31 UTC (rev 285239)
@@ -45,7 +45,7 @@
 TEST(PrivateClickMeasurement, WellKnownURLs)
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(min6BitValue), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier" };
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
 
     auto attributionSourceURL = attribution.attributionReportSourceURL();
     ASSERT_EQ(attributionSourceURL.string(), "https://webkit.org/.well-known/private-click-measurement/report-attribution/");
@@ -56,7 +56,7 @@
 TEST(PrivateClickMeasurement, ValidMinValues)
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(min6BitValue), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier" };
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(min6BitValue, PrivateClickMeasurement::Priority(min6BitValue)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
 
     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}");
 }
@@ -64,7 +64,7 @@
 TEST(PrivateClickMeasurement, ValidMidValues)
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID((uint32_t)192), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier" };
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((uint32_t)9, PrivateClickMeasurement::Priority((uint32_t)22)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((uint32_t)9, PrivateClickMeasurement::Priority((uint32_t)22)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
 
     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}");
 }
@@ -72,7 +72,7 @@
 TEST(PrivateClickMeasurement, ValidMaxValues)
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier" };
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
 
     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}");
 }
@@ -81,7 +81,7 @@
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier" };
     auto now = WallTime::now();
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
     auto earliestTimeToSend = attribution.timesToSend();
     ASSERT_TRUE(earliestTimeToSend.sourceEarliestTimeToSend && earliestTimeToSend.destinationEarliestTimeToSend);
     ASSERT_TRUE(earliestTimeToSend.sourceEarliestTimeToSend.value().secondsSinceEpoch() - 24_h >= now.secondsSinceEpoch());
@@ -135,7 +135,7 @@
 TEST(PrivateClickMeasurement, InvalidSourceID)
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy + 1), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier" };
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
 
     ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
     ASSERT_TRUE(attribution.attributionReportAttributeOnURL().isEmpty());
@@ -144,7 +144,7 @@
 TEST(PrivateClickMeasurement, InvalidSourceHost)
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { emptyURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier" };
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
 
     ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
     ASSERT_TRUE(attribution.attributionReportAttributeOnURL().isEmpty());
@@ -153,7 +153,7 @@
 TEST(PrivateClickMeasurement, InvalidDestinationHost)
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy + 1), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { emptyURL }, "test.bundle.identifier" };
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
 
     ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
     ASSERT_TRUE(attribution.attributionReportAttributeOnURL().isEmpty());
@@ -162,7 +162,7 @@
 TEST(PrivateClickMeasurement, AttributionTriggerData)
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier" };
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((PrivateClickMeasurement::AttributionTriggerData::MaxEntropy + 1), PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData((PrivateClickMeasurement::AttributionTriggerData::MaxEntropy + 1), PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
 
     ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
     ASSERT_TRUE(attribution.attributionReportAttributeOnURL().isEmpty());
@@ -171,7 +171,7 @@
 TEST(PrivateClickMeasurement, InvalidPriority)
 {
     PrivateClickMeasurement attribution { PrivateClickMeasurement::SourceID(PrivateClickMeasurement::SourceID::MaxEntropy), PrivateClickMeasurement::SourceSite { webKitURL }, PrivateClickMeasurement::AttributionDestinationSite { exampleURL }, "test.bundle.identifier" };
-    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy + 1)));
+    attribution.attributeAndGetEarliestTimeToSend(PrivateClickMeasurement::AttributionTriggerData(PrivateClickMeasurement::AttributionTriggerData::MaxEntropy, PrivateClickMeasurement::Priority(PrivateClickMeasurement::Priority::MaxEntropy + 1)), WebCore::PrivateClickMeasurement::IsRunningLayoutTest::No);
 
     ASSERT_TRUE(attribution.attributionReportSourceURL().isEmpty());
     ASSERT_TRUE(attribution.attributionReportAttributeOnURL().isEmpty());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to