Title: [264359] trunk/Source/WebCore
Revision
264359
Author
pvol...@apple.com
Date
2020-07-14 11:40:17 -0700 (Tue, 14 Jul 2020)

Log Message

[iOS] Avoid loading media libraries in Document::visibilityStateChanged() if not needed
https://bugs.webkit.org/show_bug.cgi?id=214304
<rdar://problem/65005038>

Reviewed by Darin Adler.

When the shared PlatformMediaSessionManager is created and accessed for the first time, some media libraries are loaded. There should be
no need to access the shared PlatformMediaSessionManager if no manager has been created in Document::visibilityStateChanged().

No new tests, since this patch does not change behavior.

* dom/Document.cpp:
(WebCore::Document::visibilityStateChanged):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264358 => 264359)


--- trunk/Source/WebCore/ChangeLog	2020-07-14 18:38:46 UTC (rev 264358)
+++ trunk/Source/WebCore/ChangeLog	2020-07-14 18:40:17 UTC (rev 264359)
@@ -1,3 +1,19 @@
+2020-07-14  Per Arne Vollan  <pvol...@apple.com>
+
+        [iOS] Avoid loading media libraries in Document::visibilityStateChanged() if not needed
+        https://bugs.webkit.org/show_bug.cgi?id=214304
+        <rdar://problem/65005038>
+
+        Reviewed by Darin Adler.
+
+        When the shared PlatformMediaSessionManager is created and accessed for the first time, some media libraries are loaded. There should be
+        no need to access the shared PlatformMediaSessionManager if no manager has been created in Document::visibilityStateChanged().
+
+        No new tests, since this patch does not change behavior.
+
+        * dom/Document.cpp:
+        (WebCore::Document::visibilityStateChanged):
+
 2020-07-14  Jonathan Bedard  <jbed...@apple.com>
 
         [watchOS] Support armv7k build

Modified: trunk/Source/WebCore/dom/Document.cpp (264358 => 264359)


--- trunk/Source/WebCore/dom/Document.cpp	2020-07-14 18:38:46 UTC (rev 264358)
+++ trunk/Source/WebCore/dom/Document.cpp	2020-07-14 18:40:17 UTC (rev 264359)
@@ -1758,8 +1758,10 @@
         client->visibilityStateChanged();
 
 #if ENABLE(MEDIA_STREAM) && PLATFORM(IOS_FAMILY)
-    if (!PlatformMediaSessionManager::sharedManager().isInterrupted())
-        MediaStreamTrack::updateCaptureAccordingToMutedState(*this);
+    if (PlatformMediaSessionManager::sharedManagerIfExists()) {
+        if (!PlatformMediaSessionManager::sharedManager().isInterrupted())
+            MediaStreamTrack::updateCaptureAccordingToMutedState(*this);
+    }
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to