Title: [169130] trunk/Source
Revision
169130
Author
[email protected]
Date
2014-05-20 13:52:17 -0700 (Tue, 20 May 2014)

Log Message

[Mac] do not deactivate an audio session that has running I/O
https://bugs.webkit.org/show_bug.cgi?id=133127

Reviewed by Jer Noble.

Source/WebCore:
* page/Settings.h:
(WebCore::Settings::setShouldManageAudioSessionCategory): Renamed from setShouldManageAudioSession.
(WebCore::Settings::shouldManageAudioSessionCategory): Renamed from shouldManageAudioSession.
(WebCore::Settings::setShouldManageAudioSession): Deleted.
(WebCore::Settings::shouldManageAudioSession): Deleted.

* platform/audio/mac/MediaSessionManagerMac.cpp:
(MediaSessionManager::updateSessionState): Don't deactivate the session if there are any
    Video or Audio sessions.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus): Drive-by change to log errors
    returned by -statusOfValueForKey:error: in debug builds.

Source/WebKit/mac:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]): Settings::setShouldManageAudioSession
    renamed to setShouldManageAudioSessionCategory, deal with it.

Source/WebKit2:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Settings::setShouldManageAudioSession renamed to
    setShouldManageAudioSessionCategory, deal with it.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169129 => 169130)


--- trunk/Source/WebCore/ChangeLog	2014-05-20 20:36:27 UTC (rev 169129)
+++ trunk/Source/WebCore/ChangeLog	2014-05-20 20:52:17 UTC (rev 169130)
@@ -1,3 +1,24 @@
+2014-05-20  Eric Carlson  <[email protected]>
+
+        [Mac] do not deactivate an audio session that has running I/O
+        https://bugs.webkit.org/show_bug.cgi?id=133127
+
+        Reviewed by Jer Noble.
+
+        * page/Settings.h:
+        (WebCore::Settings::setShouldManageAudioSessionCategory): Renamed from setShouldManageAudioSession.
+        (WebCore::Settings::shouldManageAudioSessionCategory): Renamed from shouldManageAudioSession.
+        (WebCore::Settings::setShouldManageAudioSession): Deleted.
+        (WebCore::Settings::shouldManageAudioSession): Deleted.
+
+        * platform/audio/mac/MediaSessionManagerMac.cpp:
+        (MediaSessionManager::updateSessionState): Don't deactivate the session if there are any
+            Video or Audio sessions.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus): Drive-by change to log errors 
+            returned by -statusOfValueForKey:error: in debug builds.
+
 2014-05-20  Beth Dakin  <[email protected]>
 
         REGRESSION: All non-mainframe scrollbars don't paint after r169065

Modified: trunk/Source/WebCore/page/Settings.h (169129 => 169130)


--- trunk/Source/WebCore/page/Settings.h	2014-05-20 20:36:27 UTC (rev 169129)
+++ trunk/Source/WebCore/page/Settings.h	2014-05-20 20:52:17 UTC (rev 169130)
@@ -263,8 +263,8 @@
     static void setShouldOptOutOfNetworkStateObservation(bool flag) { gShouldOptOutOfNetworkStateObservation = flag; }
     static bool shouldOptOutOfNetworkStateObservation() { return gShouldOptOutOfNetworkStateObservation; }
 
-    static void setShouldManageAudioSession(bool flag) { gManageAudioSession = flag; }
-    static bool shouldManageAudioSession() { return gManageAudioSession; }
+    static void setShouldManageAudioSessionCategory(bool flag) { gManageAudioSession = flag; }
+    static bool shouldManageAudioSessionCategory() { return gManageAudioSession; }
 #endif
 
 private:

Modified: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp (169129 => 169130)


--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp	2014-05-20 20:36:27 UTC (rev 169129)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp	2014-05-20 20:52:17 UTC (rev 169130)
@@ -55,12 +55,12 @@
 #endif
 
 #if PLATFORM(IOS)
-    if (has(MediaSession::WebAudio))
+    if (has(MediaSession::WebAudio) || has(MediaSession::Video) || has(MediaSession::Audio))
         AudioSession::sharedSession().setActive(true);
     else
         AudioSession::sharedSession().setActive(false);
 
-    if (!Settings::shouldManageAudioSession())
+    if (!Settings::shouldManageAudioSessionCategory())
         return;
 
     if (has(MediaSession::Video) || has(MediaSession::Audio))

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (169129 => 169130)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-05-20 20:36:27 UTC (rev 169129)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-05-20 20:52:17 UTC (rev 169130)
@@ -1189,7 +1189,12 @@
         return MediaPlayerAVAssetStatusDoesNotExist;
 
     for (NSString *keyName in assetMetadataKeyNames()) {
-        AVKeyValueStatus keyStatus = [m_avAsset.get() statusOfValueForKey:keyName error:nil];
+        NSError *error = nil;
+        AVKeyValueStatus keyStatus = [m_avAsset.get() statusOfValueForKey:keyName error:&error];
+#if !LOG_DISABLED
+        if (error)
+            LOG(Media, "MediaPlayerPrivateAVFoundation::assetStatus - statusOfValueForKey failed for %s, error = %s", [keyName UTF8String], [[error localizedDescription] UTF8String]);
+#endif
 
         if (keyStatus < AVKeyValueStatusLoaded)
             return MediaPlayerAVAssetStatusLoading;// At least one key is not loaded yet.

Modified: trunk/Source/WebKit/mac/ChangeLog (169129 => 169130)


--- trunk/Source/WebKit/mac/ChangeLog	2014-05-20 20:36:27 UTC (rev 169129)
+++ trunk/Source/WebKit/mac/ChangeLog	2014-05-20 20:52:17 UTC (rev 169130)
@@ -1,3 +1,14 @@
+2014-05-20  Eric Carlson  <[email protected]>
+
+        [Mac] do not deactivate an audio session that has running I/O
+        https://bugs.webkit.org/show_bug.cgi?id=133127
+
+        Reviewed by Jer Noble.
+
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]): Settings::setShouldManageAudioSession
+            renamed to setShouldManageAudioSessionCategory, deal with it.
+
 2014-05-19  Brady Eidson  <[email protected]>
 
         Use different AppKit API for image control menus.

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (169129 => 169130)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2014-05-20 20:36:27 UTC (rev 169129)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2014-05-20 20:52:17 UTC (rev 169130)
@@ -903,7 +903,7 @@
 
 #if PLATFORM(IOS)
         if (applicationIsMobileSafari())
-            Settings::setShouldManageAudioSession(true);
+            Settings::setShouldManageAudioSessionCategory(true);
 #endif
 
         didOneTimeInitialization = true;

Modified: trunk/Source/WebKit2/ChangeLog (169129 => 169130)


--- trunk/Source/WebKit2/ChangeLog	2014-05-20 20:36:27 UTC (rev 169129)
+++ trunk/Source/WebKit2/ChangeLog	2014-05-20 20:52:17 UTC (rev 169130)
@@ -1,3 +1,14 @@
+2014-05-20  Eric Carlson  <[email protected]>
+
+        [Mac] do not deactivate an audio session that has running I/O
+        https://bugs.webkit.org/show_bug.cgi?id=133127
+
+        Reviewed by Jer Noble.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage): Settings::setShouldManageAudioSession renamed to 
+            setShouldManageAudioSessionCategory, deal with it.
+
 2014-05-19  Simon Fraser  <[email protected]>
 
         REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (169129 => 169130)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-05-20 20:36:27 UTC (rev 169129)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-05-20 20:52:17 UTC (rev 169130)
@@ -320,7 +320,7 @@
     Settings::setDefaultMinDOMTimerInterval(0.004);
 
 #if PLATFORM(IOS)
-    Settings::setShouldManageAudioSession(true);
+    Settings::setShouldManageAudioSessionCategory(true);
 #endif
 
     Page::PageClients pageClients;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to