Title: [266546] branches/safari-610-branch/Source/WebKit
Revision
266546
Author
alanc...@apple.com
Date
2020-09-03 14:30:46 -0700 (Thu, 03 Sep 2020)

Log Message

Cherry-pick r266240. rdar://problem/67963550

    REGRESSION(r264710): Initializing the AVPlayer Obj-C class at process start up causes a regression in power-use tests
    https://bugs.webkit.org/show_bug.cgi?id=215861

    Reviewed by Eric Carlson.

    Calling +instancesRespondToSelector: will cause the underyling Obj-C class to be initialized, which in the case of
    AVPlayer does a bunch of work which shows up on power-use tests. Because the API being checked for will always exist
    in macOS 11, and that code is already protected by a HAVE(AVPLAYER_VIDEORANGEOVERRIDE) pragma, just return early
    here without running the +instancesRespondToSelector: check.

    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::updatePageScreenProperties):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266240 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610-branch/Source/WebKit/ChangeLog (266545 => 266546)


--- branches/safari-610-branch/Source/WebKit/ChangeLog	2020-09-03 21:30:44 UTC (rev 266545)
+++ branches/safari-610-branch/Source/WebKit/ChangeLog	2020-09-03 21:30:46 UTC (rev 266546)
@@ -1,3 +1,38 @@
+2020-09-03  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r266240. rdar://problem/67963550
+
+    REGRESSION(r264710): Initializing the AVPlayer Obj-C class at process start up causes a regression in power-use tests
+    https://bugs.webkit.org/show_bug.cgi?id=215861
+    
+    Reviewed by Eric Carlson.
+    
+    Calling +instancesRespondToSelector: will cause the underyling Obj-C class to be initialized, which in the case of
+    AVPlayer does a bunch of work which shows up on power-use tests. Because the API being checked for will always exist
+    in macOS 11, and that code is already protected by a HAVE(AVPLAYER_VIDEORANGEOVERRIDE) pragma, just return early
+    here without running the +instancesRespondToSelector: check.
+    
+    * WebProcess/cocoa/WebProcessCocoa.mm:
+    (WebKit::WebProcess::updatePageScreenProperties):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266240 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-08-27  Jer Noble  <jer.no...@apple.com>
+
+            REGRESSION(r264710): Initializing the AVPlayer Obj-C class at process start up causes a regression in power-use tests
+            https://bugs.webkit.org/show_bug.cgi?id=215861
+
+            Reviewed by Eric Carlson.
+
+            Calling +instancesRespondToSelector: will cause the underyling Obj-C class to be initialized, which in the case of
+            AVPlayer does a bunch of work which shows up on power-use tests. Because the API being checked for will always exist
+            in macOS 11, and that code is already protected by a HAVE(AVPLAYER_VIDEORANGEOVERRIDE) pragma, just return early
+            here without running the +instancesRespondToSelector: check.
+
+            * WebProcess/cocoa/WebProcessCocoa.mm:
+            (WebKit::WebProcess::updatePageScreenProperties):
+
 2020-09-01  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r266301. rdar://problem/68177648

Modified: branches/safari-610-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (266545 => 266546)


--- branches/safari-610-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-09-03 21:30:44 UTC (rev 266545)
+++ branches/safari-610-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-09-03 21:30:46 UTC (rev 266546)
@@ -1016,14 +1016,9 @@
 #if PLATFORM(MAC)
 void WebProcess::updatePageScreenProperties()
 {
-#if HAVE(AVPLAYER_VIDEORANGEOVERRIDE)
-    // If AVPlayer.videoRangeOverride support is present, there's no need to override HDR mode
-    // at the MediaToolbox level, as the MediaToolbox override functionality is both duplicative
-    // and process global.
-    if (PAL::isAVFoundationFrameworkAvailable() && [PAL::getAVPlayerClass() instancesRespondToSelector:@selector(setVideoRangeOverride:)])
-        return;
-#endif
-
+#if !HAVE(AVPLAYER_VIDEORANGEOVERRIDE)
+    // Only override HDR support at the MediaToolbox level if AVPlayer.videoRangeOverride support is
+    // not present, as the MediaToolbox override functionality is both duplicative and process global.
     if (hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)) {
         setShouldOverrideScreenSupportsHighDynamicRange(false, false);
         return;
@@ -1033,6 +1028,7 @@
         return screenSupportsHighDynamicRange(page->mainFrameView());
     });
     setShouldOverrideScreenSupportsHighDynamicRange(true, allPagesAreOnHDRScreens);
+#endif
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to