Changeset 280327 in webkit


Ignore:
Timestamp:
Jul 26, 2021, 5:06:18 PM (4 years ago)
Author:
jer.noble@apple.com
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:
Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r280318 r280327  
     12021-07-26  Jer Noble  <jer.noble@apple.com>
     2
     3        [Cocoa] WebKit is making GroupActivities API calls for all WebKit clients
     4        https://bugs.webkit.org/show_bug.cgi?id=228299
     5        <rdar://80802982>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * Scripts/Preferences/WebPreferencesExperimental.yaml:
     10
    1112021-07-26  Per Arne  <pvollan@apple.com>
    212
  • trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml

    r280239 r280327  
    677677      default: true
    678678    WebKit:
    679       default: true
     679      default: WebKit::defaultMediaSessionCoordinatorEnabled()
    680680    WebCore:
    681681      default: true
  • trunk/Source/WebKit/ChangeLog

    r280326 r280327  
     12021-07-26  Jer Noble  <jer.noble@apple.com>
     2
     3        [Cocoa] WebKit is making GroupActivities API calls for all WebKit clients
     4        https://bugs.webkit.org/show_bug.cgi?id=228299
     5        <rdar://80802982>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Tie registering for GroupActivities notifications to the MediaSessionCoordinatorEnabled
     10        WebPreference, and make the default value for that preference depend on having the
     11        "com.apple.developer.group-session.urlactivity" entitlement. All WebKit clients with
     12        that entitlement will have the preference enabled by default; all other clients will
     13        have that preference disabled by default.
     14
     15        * Shared/WebPreferencesDefaultValues.cpp:
     16        (WebKit::defaultMediaSessionCoordinatorEnabled):
     17        * Shared/WebPreferencesDefaultValues.h:
     18        * UIProcess/WebPageProxy.cpp:
     19        (WebKit::m_limitsNavigationsToAppBoundDomains):
     20        (WebKit::WebPageProxy::~WebPageProxy):
     21        (WebKit::WebPageProxy::didCommitLoadForFrame):
     22
    1232021-07-26  Jer Noble  <jer.noble@apple.com>
    224
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp

    r279974 r280327  
    3636#endif
    3737
     38#if ENABLE(MEDIA_SESSION_COORDINATOR)
     39#import <wtf/cocoa/Entitlements.h>
     40#endif
     41
    3842namespace WebKit {
    3943
     
    331335#endif // ENABLE(MEDIA_SOURCE)
    332336
     337#if ENABLE(MEDIA_SESSION_COORDINATOR)
     338bool defaultMediaSessionCoordinatorEnabled()
     339{
     340    static dispatch_once_t onceToken;
     341    static bool enabled { false };
     342    dispatch_once(&onceToken, ^{
     343        enabled = WTF::processHasEntitlement("com.apple.developer.group-session.urlactivity");
     344    });
     345    return enabled;
     346}
     347#endif
     348
    333349} // namespace WebKit
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h

    r279974 r280327  
    114114#endif
    115115
     116#if ENABLE(MEDIA_SESSION_COORDINATOR)
     117bool defaultMediaSessionCoordinatorEnabled();
     118#endif
     119
    116120} // namespace WebKit
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r280122 r280327  
    573573
    574574#if ENABLE(MEDIA_SESSION_COORDINATOR) && HAVE(GROUP_ACTIVITIES)
    575     GroupActivitiesSessionNotifier::sharedNotifier().addWebPage(*this);
     575    if (m_preferences->mediaSessionCoordinatorEnabled())
     576        GroupActivitiesSessionNotifier::sharedNotifier().addWebPage(*this);
    576577#endif
    577578}
     
    614615
    615616#if ENABLE(MEDIA_SESSION_COORDINATOR) && HAVE(GROUP_ACTIVITIES)
    616     GroupActivitiesSessionNotifier::sharedNotifier().removeWebPage(*this);
     617    if (m_preferences->mediaSessionCoordinatorEnabled())
     618        GroupActivitiesSessionNotifier::sharedNotifier().removeWebPage(*this);
    617619#endif
    618620}
     
    49454947
    49464948#if ENABLE(MEDIA_SESSION_COORDINATOR) && HAVE(GROUP_ACTIVITIES)
    4947     if (frame->isMainFrame())
     4949    if (frame->isMainFrame() && m_preferences->mediaSessionCoordinatorEnabled())
    49484950        GroupActivitiesSessionNotifier::sharedNotifier().webPageURLChanged(*this);
    49494951#endif
Note: See TracChangeset for help on using the changeset viewer.