Title: [273689] branches/safari-611.1.21.1-branch/Source
Revision
273689
Author
[email protected]
Date
2021-03-01 13:29:20 -0800 (Mon, 01 Mar 2021)

Log Message

Cherry-pick r273564. rdar://problem/74886917

    [Cocoa] Register VP9 decoders when PlatformMediaSessionManager is created
    https://bugs.webkit.org/show_bug.cgi?id=222473
    <rdar://problem/74790242>

    Reviewed by Eric Carlson.

    Source/WebCore:

    Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered
    when PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will
    then not be made unconditionally when creating a Web page, but delayed until required.

    No new tests, covered by existing tests.

    * platform/audio/PlatformMediaSessionManager.cpp:
    (WebCore::PlatformMediaSessionManager::setShouldEnableVP9Decoder):
    (WebCore::PlatformMediaSessionManager::shouldEnableVP9Decoder):
    (WebCore::PlatformMediaSessionManager::setShouldEnableVP8Decoder):
    (WebCore::PlatformMediaSessionManager::shouldEnableVP8Decoder):
    (WebCore::PlatformMediaSessionManager::setShouldEnableVP9SWDecoder):
    (WebCore::PlatformMediaSessionManager::shouldEnableVP9SWDecoder):
    * platform/audio/PlatformMediaSessionManager.h:
    * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
    (WebCore::MediaSessionManagerCocoa::MediaSessionManagerCocoa):

    Source/WebKit:

    Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered when
    PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will then not
    be made unconditionally when creating a Web page, but delayed until required.

    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::m_lastNavigationWasAppBound):
    * WebProcess/WebProcess.cpp:
    (WebKit::WebProcess::enableVP9Decoder): Deleted.
    (WebKit::WebProcess::enableVP8SWDecoder): Deleted.
    (WebKit::WebProcess::enableVP9SWDecoder): Deleted.
    * WebProcess/WebProcess.h:

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

Modified Paths

Diff

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/ChangeLog (273688 => 273689)


--- branches/safari-611.1.21.1-branch/Source/WebCore/ChangeLog	2021-03-01 21:27:39 UTC (rev 273688)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/ChangeLog	2021-03-01 21:29:20 UTC (rev 273689)
@@ -1,5 +1,75 @@
 2021-03-01  Alan Coon  <[email protected]>
 
+        Cherry-pick r273564. rdar://problem/74886917
+
+    [Cocoa] Register VP9 decoders when PlatformMediaSessionManager is created
+    https://bugs.webkit.org/show_bug.cgi?id=222473
+    <rdar://problem/74790242>
+    
+    Reviewed by Eric Carlson.
+    
+    Source/WebCore:
+    
+    Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered
+    when PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will
+    then not be made unconditionally when creating a Web page, but delayed until required.
+    
+    No new tests, covered by existing tests.
+    
+    * platform/audio/PlatformMediaSessionManager.cpp:
+    (WebCore::PlatformMediaSessionManager::setShouldEnableVP9Decoder):
+    (WebCore::PlatformMediaSessionManager::shouldEnableVP9Decoder):
+    (WebCore::PlatformMediaSessionManager::setShouldEnableVP8Decoder):
+    (WebCore::PlatformMediaSessionManager::shouldEnableVP8Decoder):
+    (WebCore::PlatformMediaSessionManager::setShouldEnableVP9SWDecoder):
+    (WebCore::PlatformMediaSessionManager::shouldEnableVP9SWDecoder):
+    * platform/audio/PlatformMediaSessionManager.h:
+    * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
+    (WebCore::MediaSessionManagerCocoa::MediaSessionManagerCocoa):
+    
+    Source/WebKit:
+    
+    Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered when
+    PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will then not
+    be made unconditionally when creating a Web page, but delayed until required.
+    
+    * WebProcess/WebPage/WebPage.cpp:
+    (WebKit::m_lastNavigationWasAppBound):
+    * WebProcess/WebProcess.cpp:
+    (WebKit::WebProcess::enableVP9Decoder): Deleted.
+    (WebKit::WebProcess::enableVP8SWDecoder): Deleted.
+    (WebKit::WebProcess::enableVP9SWDecoder): Deleted.
+    * WebProcess/WebProcess.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-26  Per Arne  <[email protected]>
+
+            [Cocoa] Register VP9 decoders when PlatformMediaSessionManager is created
+            https://bugs.webkit.org/show_bug.cgi?id=222473
+            <rdar://problem/74790242>
+
+            Reviewed by Eric Carlson.
+
+            Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered
+            when PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will
+            then not be made unconditionally when creating a Web page, but delayed until required.
+
+            No new tests, covered by existing tests.
+
+            * platform/audio/PlatformMediaSessionManager.cpp:
+            (WebCore::PlatformMediaSessionManager::setShouldEnableVP9Decoder):
+            (WebCore::PlatformMediaSessionManager::shouldEnableVP9Decoder):
+            (WebCore::PlatformMediaSessionManager::setShouldEnableVP8Decoder):
+            (WebCore::PlatformMediaSessionManager::shouldEnableVP8Decoder):
+            (WebCore::PlatformMediaSessionManager::setShouldEnableVP9SWDecoder):
+            (WebCore::PlatformMediaSessionManager::shouldEnableVP9SWDecoder):
+            * platform/audio/PlatformMediaSessionManager.h:
+            * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
+            (WebCore::MediaSessionManagerCocoa::MediaSessionManagerCocoa):
+
+2021-03-01  Alan Coon  <[email protected]>
+
         Cherry-pick r273656. rdar://problem/74883377
 
     REGRESSION(r272004): transform transition with delay doesn't behave correctly

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp (273688 => 273689)


--- branches/safari-611.1.21.1-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp	2021-03-01 21:27:39 UTC (rev 273688)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp	2021-03-01 21:29:20 UTC (rev 273689)
@@ -43,6 +43,12 @@
 bool PlatformMediaSessionManager::m_vorbisDecoderEnabled;
 #endif
 
+#if ENABLE(VP9)
+bool PlatformMediaSessionManager::m_vp9DecoderEnabled;
+bool PlatformMediaSessionManager::m_vp8DecoderEnabled;
+bool PlatformMediaSessionManager::m_vp9SWDecoderEnabled;
+#endif
+
 static std::unique_ptr<PlatformMediaSessionManager>& sharedPlatformMediaSessionManager()
 {
     static NeverDestroyed<std::unique_ptr<PlatformMediaSessionManager>> platformMediaSessionManager;
@@ -654,6 +660,38 @@
 #endif
 }
 
+#if ENABLE(VP9)
+void PlatformMediaSessionManager::setShouldEnableVP9Decoder(bool vp9DecoderEnabled)
+{
+    m_vp9DecoderEnabled = vp9DecoderEnabled;
+}
+
+bool PlatformMediaSessionManager::shouldEnableVP9Decoder()
+{
+    return m_vp9DecoderEnabled;
+}
+
+void PlatformMediaSessionManager::setShouldEnableVP8Decoder(bool vp8DecoderEnabled)
+{
+    m_vp8DecoderEnabled = vp8DecoderEnabled;
+}
+
+bool PlatformMediaSessionManager::shouldEnableVP8Decoder()
+{
+    return m_vp8DecoderEnabled;
+}
+
+void PlatformMediaSessionManager::setShouldEnableVP9SWDecoder(bool vp9SWDecoderEnabled)
+{
+    m_vp9SWDecoderEnabled = vp9SWDecoderEnabled;
+}
+
+bool PlatformMediaSessionManager::shouldEnableVP9SWDecoder()
+{
+    return m_vp9SWDecoderEnabled;
+}
+#endif // ENABLE(VP9)
+
 #else // ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
 
 void PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary()

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h (273688 => 273689)


--- branches/safari-611.1.21.1-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h	2021-03-01 21:27:39 UTC (rev 273688)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h	2021-03-01 21:29:20 UTC (rev 273689)
@@ -63,6 +63,15 @@
     WEBCORE_EXPORT static void setVorbisDecoderEnabled(bool);
     WEBCORE_EXPORT static bool vorbisDecoderEnabled();
 
+#if ENABLE(VP9)
+    WEBCORE_EXPORT static void setShouldEnableVP9Decoder(bool);
+    WEBCORE_EXPORT static bool shouldEnableVP9Decoder();
+    WEBCORE_EXPORT static void setShouldEnableVP8Decoder(bool);
+    WEBCORE_EXPORT static bool shouldEnableVP8Decoder();
+    WEBCORE_EXPORT static void setShouldEnableVP9SWDecoder(bool);
+    WEBCORE_EXPORT static bool shouldEnableVP9SWDecoder();
+#endif
+
     virtual ~PlatformMediaSessionManager() = default;
 
     virtual void scheduleSessionStatusUpdate() { }
@@ -213,6 +222,12 @@
     static bool m_vorbisDecoderEnabled;
 #endif
 
+#if ENABLE(VP9)
+    static bool m_vp9DecoderEnabled;
+    static bool m_vp8DecoderEnabled;
+    static bool m_vp9SWDecoderEnabled;
+#endif
+
 #if !RELEASE_LOG_DISABLED
     Ref<AggregateLogger> m_logger;
 #endif

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm (273688 => 273689)


--- branches/safari-611.1.21.1-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm	2021-03-01 21:27:39 UTC (rev 273688)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm	2021-03-01 21:29:20 UTC (rev 273689)
@@ -38,6 +38,7 @@
 #import "NowPlayingInfo.h"
 #import "PlatformMediaSession.h"
 #import "PlatformStrategies.h"
+#import "VP9UtilitiesCocoa.h"
 #import <wtf/BlockObjCExceptions.h>
 #import <wtf/Function.h>
 
@@ -57,6 +58,14 @@
 MediaSessionManagerCocoa::MediaSessionManagerCocoa()
     : m_systemSleepListener(PAL::SystemSleepListener::create(*this))
 {
+#if ENABLE(VP9)
+    if (shouldEnableVP9Decoder())
+        registerSupplementalVP9Decoder();
+    if (shouldEnableVP8Decoder())
+        registerWebKitVP8Decoder();
+    if (shouldEnableVP9SWDecoder())
+        registerWebKitVP9Decoder();
+#endif
 }
 
 void MediaSessionManagerCocoa::updateSessionState()

Modified: branches/safari-611.1.21.1-branch/Source/WebKit/ChangeLog (273688 => 273689)


--- branches/safari-611.1.21.1-branch/Source/WebKit/ChangeLog	2021-03-01 21:27:39 UTC (rev 273688)
+++ branches/safari-611.1.21.1-branch/Source/WebKit/ChangeLog	2021-03-01 21:29:20 UTC (rev 273689)
@@ -1,3 +1,68 @@
+2021-03-01  Alan Coon  <[email protected]>
+
+        Cherry-pick r273564. rdar://problem/74886917
+
+    [Cocoa] Register VP9 decoders when PlatformMediaSessionManager is created
+    https://bugs.webkit.org/show_bug.cgi?id=222473
+    <rdar://problem/74790242>
+    
+    Reviewed by Eric Carlson.
+    
+    Source/WebCore:
+    
+    Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered
+    when PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will
+    then not be made unconditionally when creating a Web page, but delayed until required.
+    
+    No new tests, covered by existing tests.
+    
+    * platform/audio/PlatformMediaSessionManager.cpp:
+    (WebCore::PlatformMediaSessionManager::setShouldEnableVP9Decoder):
+    (WebCore::PlatformMediaSessionManager::shouldEnableVP9Decoder):
+    (WebCore::PlatformMediaSessionManager::setShouldEnableVP8Decoder):
+    (WebCore::PlatformMediaSessionManager::shouldEnableVP8Decoder):
+    (WebCore::PlatformMediaSessionManager::setShouldEnableVP9SWDecoder):
+    (WebCore::PlatformMediaSessionManager::shouldEnableVP9SWDecoder):
+    * platform/audio/PlatformMediaSessionManager.h:
+    * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
+    (WebCore::MediaSessionManagerCocoa::MediaSessionManagerCocoa):
+    
+    Source/WebKit:
+    
+    Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered when
+    PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will then not
+    be made unconditionally when creating a Web page, but delayed until required.
+    
+    * WebProcess/WebPage/WebPage.cpp:
+    (WebKit::m_lastNavigationWasAppBound):
+    * WebProcess/WebProcess.cpp:
+    (WebKit::WebProcess::enableVP9Decoder): Deleted.
+    (WebKit::WebProcess::enableVP8SWDecoder): Deleted.
+    (WebKit::WebProcess::enableVP9SWDecoder): Deleted.
+    * WebProcess/WebProcess.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-26  Per Arne  <[email protected]>
+
+            [Cocoa] Register VP9 decoders when PlatformMediaSessionManager is created
+            https://bugs.webkit.org/show_bug.cgi?id=222473
+            <rdar://problem/74790242>
+
+            Reviewed by Eric Carlson.
+
+            Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered when
+            PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will then not
+            be made unconditionally when creating a Web page, but delayed until required.
+
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::m_lastNavigationWasAppBound):
+            * WebProcess/WebProcess.cpp:
+            (WebKit::WebProcess::enableVP9Decoder): Deleted.
+            (WebKit::WebProcess::enableVP8SWDecoder): Deleted.
+            (WebKit::WebProcess::enableVP9SWDecoder): Deleted.
+            * WebProcess/WebProcess.h:
+
 2021-03-01  Kocsen Chung  <[email protected]>
 
         Cherry-pick r273590. rdar://problem/74881385

Modified: branches/safari-611.1.21.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp (273688 => 273689)


--- branches/safari-611.1.21.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-03-01 21:27:39 UTC (rev 273688)
+++ branches/safari-611.1.21.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-03-01 21:29:20 UTC (rev 273689)
@@ -825,14 +825,9 @@
 #endif
 
 #if ENABLE(VP9)
-    if (parameters.shouldEnableVP9Decoder)
-        WebProcess::singleton().enableVP9Decoder();
-
-    if (parameters.shouldEnableVP8Decoder)
-        WebProcess::singleton().enableVP8SWDecoder();
-
-    if (parameters.shouldEnableVP9SWDecoder)
-        WebProcess::singleton().enableVP9SWDecoder();
+    PlatformMediaSessionManager::setShouldEnableVP9Decoder(parameters.shouldEnableVP9Decoder);
+    PlatformMediaSessionManager::setShouldEnableVP8Decoder(parameters.shouldEnableVP8Decoder);
+    PlatformMediaSessionManager::setShouldEnableVP9SWDecoder(parameters.shouldEnableVP9SWDecoder);
 #endif
 
     m_page->setCanUseCredentialStorage(parameters.canUseCredentialStorage);

Modified: branches/safari-611.1.21.1-branch/Source/WebKit/WebProcess/WebProcess.cpp (273688 => 273689)


--- branches/safari-611.1.21.1-branch/Source/WebKit/WebProcess/WebProcess.cpp	2021-03-01 21:27:39 UTC (rev 273688)
+++ branches/safari-611.1.21.1-branch/Source/WebKit/WebProcess/WebProcess.cpp	2021-03-01 21:29:20 UTC (rev 273689)
@@ -1975,42 +1975,6 @@
 
 #endif
 
-#if ENABLE(VP9)
-void WebProcess::enableVP9Decoder()
-{
-    if (m_vp9DecoderEnabled)
-        return;
-
-    m_vp9DecoderEnabled = true;
-
-#if PLATFORM(COCOA)
-    WebCore::registerSupplementalVP9Decoder();
-#endif
-}
-
-void WebProcess::enableVP8SWDecoder()
-{
-    if (m_vp9SWDecoderEnabled)
-        return;
-
-    m_vp8SWDecoderEnabled = true;
-#if PLATFORM(COCOA)
-    WebCore::registerWebKitVP8Decoder();
-#endif
-}
-
-void WebProcess::enableVP9SWDecoder()
-{
-    if (m_vp9SWDecoderEnabled)
-        return;
-
-    m_vp9SWDecoderEnabled = true;
-#if PLATFORM(COCOA)
-    WebCore::registerWebKitVP9Decoder();
-#endif
-}
-#endif
-
 #if ENABLE(MEDIA_STREAM)
 SpeechRecognitionRealtimeMediaSourceManager& WebProcess::ensureSpeechRecognitionRealtimeMediaSourceManager()
 {

Modified: branches/safari-611.1.21.1-branch/Source/WebKit/WebProcess/WebProcess.h (273688 => 273689)


--- branches/safari-611.1.21.1-branch/Source/WebKit/WebProcess/WebProcess.h	2021-03-01 21:27:39 UTC (rev 273688)
+++ branches/safari-611.1.21.1-branch/Source/WebKit/WebProcess/WebProcess.h	2021-03-01 21:29:20 UTC (rev 273689)
@@ -357,12 +357,6 @@
 #endif
 #endif
 
-#if ENABLE(VP9)
-    void enableVP9Decoder();
-    void enableVP8SWDecoder();
-    void enableVP9SWDecoder();
-#endif
-
 #if PLATFORM(COCOA)
     void willWriteToPasteboardAsynchronously(const String& pasteboardName);
     void waitForPendingPasteboardWritesToFinish(const String& pasteboardName);
@@ -707,12 +701,6 @@
 #endif
 #endif
 
-#if ENABLE(VP9)
-    bool m_vp9DecoderEnabled { false };
-    bool m_vp8SWDecoderEnabled { false };
-    bool m_vp9SWDecoderEnabled { false };
-#endif
-
 #if ENABLE(MEDIA_STREAM)
     std::unique_ptr<SpeechRecognitionRealtimeMediaSourceManager> m_speechRecognitionRealtimeMediaSourceManager;
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to