Title: [280327] trunk/Source
Revision
280327
Author
[email protected]
Date
2021-07-26 17:06:18 -0700 (Mon, 26 Jul 2021)

Log Message

[Cocoa] WebKit is making GroupActivities API calls for all WebKit clients
https://bugs.webkit.org/show_bug.cgi?id=228299
<rdar://80802982>

Reviewed by Eric Carlson.

Source/WebKit:

Tie registering for GroupActivities notifications to the MediaSessionCoordinatorEnabled
WebPreference, and make the default value for that preference depend on having the
"com.apple.developer.group-session.urlactivity" entitlement. All WebKit clients with
that entitlement will have the preference enabled by default; all other clients will
have that preference disabled by default.

* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultMediaSessionCoordinatorEnabled):
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::m_limitsNavigationsToAppBoundDomains):
(WebKit::WebPageProxy::~WebPageProxy):
(WebKit::WebPageProxy::didCommitLoadForFrame):

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (280326 => 280327)


--- trunk/Source/WTF/ChangeLog	2021-07-27 00:02:30 UTC (rev 280326)
+++ trunk/Source/WTF/ChangeLog	2021-07-27 00:06:18 UTC (rev 280327)
@@ -1,3 +1,13 @@
+2021-07-26  Jer Noble  <[email protected]>
+
+        [Cocoa] WebKit is making GroupActivities API calls for all WebKit clients
+        https://bugs.webkit.org/show_bug.cgi?id=228299
+        <rdar://80802982>
+
+        Reviewed by Eric Carlson.
+
+        * Scripts/Preferences/WebPreferencesExperimental.yaml:
+
 2021-07-26  Per Arne  <[email protected]>
 
         The layout test fast/images/heic-as-background-image.html is a constant failure

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (280326 => 280327)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2021-07-27 00:02:30 UTC (rev 280326)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2021-07-27 00:06:18 UTC (rev 280327)
@@ -676,7 +676,7 @@
     WebKitLegacy:
       default: true
     WebKit:
-      default: true
+      default: WebKit::defaultMediaSessionCoordinatorEnabled()
     WebCore:
       default: true
 

Modified: trunk/Source/WebKit/ChangeLog (280326 => 280327)


--- trunk/Source/WebKit/ChangeLog	2021-07-27 00:02:30 UTC (rev 280326)
+++ trunk/Source/WebKit/ChangeLog	2021-07-27 00:06:18 UTC (rev 280327)
@@ -1,5 +1,27 @@
 2021-07-26  Jer Noble  <[email protected]>
 
+        [Cocoa] WebKit is making GroupActivities API calls for all WebKit clients
+        https://bugs.webkit.org/show_bug.cgi?id=228299
+        <rdar://80802982>
+
+        Reviewed by Eric Carlson.
+
+        Tie registering for GroupActivities notifications to the MediaSessionCoordinatorEnabled
+        WebPreference, and make the default value for that preference depend on having the 
+        "com.apple.developer.group-session.urlactivity" entitlement. All WebKit clients with
+        that entitlement will have the preference enabled by default; all other clients will
+        have that preference disabled by default.
+
+        * Shared/WebPreferencesDefaultValues.cpp:
+        (WebKit::defaultMediaSessionCoordinatorEnabled):
+        * Shared/WebPreferencesDefaultValues.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::m_limitsNavigationsToAppBoundDomains):
+        (WebKit::WebPageProxy::~WebPageProxy):
+        (WebKit::WebPageProxy::didCommitLoadForFrame):
+
+2021-07-26  Jer Noble  <[email protected]>
+
         REGRESSION: [iOS] ASSERTION FAILED: !m_useCount in WebKit::SandboxExtension::~SandboxExtension()
         https://bugs.webkit.org/show_bug.cgi?id=228171
         <rdar://problem/80926509>

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (280326 => 280327)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2021-07-27 00:02:30 UTC (rev 280326)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2021-07-27 00:06:18 UTC (rev 280327)
@@ -35,6 +35,10 @@
 #include <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
 #endif
 
+#if ENABLE(MEDIA_SESSION_COORDINATOR)
+#import <wtf/cocoa/Entitlements.h>
+#endif
+
 namespace WebKit {
 
 #if PLATFORM(IOS_FAMILY)
@@ -330,4 +334,16 @@
 
 #endif // ENABLE(MEDIA_SOURCE)
 
+#if ENABLE(MEDIA_SESSION_COORDINATOR)
+bool defaultMediaSessionCoordinatorEnabled()
+{
+    static dispatch_once_t onceToken;
+    static bool enabled { false };
+    dispatch_once(&onceToken, ^{
+        enabled = WTF::processHasEntitlement("com.apple.developer.group-session.urlactivity");
+    });
+    return enabled;
+}
+#endif
+
 } // namespace WebKit

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (280326 => 280327)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2021-07-27 00:02:30 UTC (rev 280326)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2021-07-27 00:06:18 UTC (rev 280327)
@@ -113,4 +113,8 @@
 bool defaultWebMParserEnabled();
 #endif
 
+#if ENABLE(MEDIA_SESSION_COORDINATOR)
+bool defaultMediaSessionCoordinatorEnabled();
+#endif
+
 } // namespace WebKit

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (280326 => 280327)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2021-07-27 00:02:30 UTC (rev 280326)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2021-07-27 00:06:18 UTC (rev 280327)
@@ -572,7 +572,8 @@
 #endif
 
 #if ENABLE(MEDIA_SESSION_COORDINATOR) && HAVE(GROUP_ACTIVITIES)
-    GroupActivitiesSessionNotifier::sharedNotifier().addWebPage(*this);
+    if (m_preferences->mediaSessionCoordinatorEnabled())
+        GroupActivitiesSessionNotifier::sharedNotifier().addWebPage(*this);
 #endif
 }
 
@@ -613,7 +614,8 @@
     websiteDataStore().networkProcess().send(Messages::NetworkProcess::RemoveWebPageNetworkParameters(sessionID(), m_identifier), 0);
 
 #if ENABLE(MEDIA_SESSION_COORDINATOR) && HAVE(GROUP_ACTIVITIES)
-    GroupActivitiesSessionNotifier::sharedNotifier().removeWebPage(*this);
+    if (m_preferences->mediaSessionCoordinatorEnabled())
+        GroupActivitiesSessionNotifier::sharedNotifier().removeWebPage(*this);
 #endif
 }
 
@@ -4944,7 +4946,7 @@
     }
 
 #if ENABLE(MEDIA_SESSION_COORDINATOR) && HAVE(GROUP_ACTIVITIES)
-    if (frame->isMainFrame())
+    if (frame->isMainFrame() && m_preferences->mediaSessionCoordinatorEnabled())
         GroupActivitiesSessionNotifier::sharedNotifier().webPageURLChanged(*this);
 #endif
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to