Title: [266303] branches/safari-610.1.28.1-branch/Source/WebKit
Revision
266303
Author
[email protected]
Date
2020-08-28 15:57:54 -0700 (Fri, 28 Aug 2020)

Log Message

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

    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.1.28.1-branch/Source/WebKit/ChangeLog (266302 => 266303)


--- branches/safari-610.1.28.1-branch/Source/WebKit/ChangeLog	2020-08-28 22:57:50 UTC (rev 266302)
+++ branches/safari-610.1.28.1-branch/Source/WebKit/ChangeLog	2020-08-28 22:57:54 UTC (rev 266303)
@@ -1,3 +1,38 @@
+2020-08-28  Russell Epstein  <[email protected]>
+
+        Cherry-pick r266240. rdar://problem/67963545
+
+    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  <[email protected]>
+
+            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-08-27  Russell Epstein  <[email protected]>
 
         Apply patch. rdar://problem/67877085

Modified: branches/safari-610.1.28.1-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (266302 => 266303)


--- branches/safari-610.1.28.1-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-08-28 22:57:50 UTC (rev 266302)
+++ branches/safari-610.1.28.1-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-08-28 22:57:54 UTC (rev 266303)
@@ -1044,14 +1044,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;
@@ -1061,6 +1056,7 @@
         return screenSupportsHighDynamicRange(page->mainFrameView());
     });
     setShouldOverrideScreenSupportsHighDynamicRange(true, allPagesAreOnHDRScreens);
+#endif
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to