Skip to content
Permalink
Browse files
[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.


Canonical link: https://commits.webkit.org/151154@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eric-carlson committed May 20, 2014
1 parent 18445fe commit 395edff6f140b7ce6d53da3d8713214047c86fb2
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 7 deletions.
@@ -1,3 +1,24 @@
2014-05-20 Eric Carlson <eric.carlson@apple.com>

[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 <bdakin@apple.com>

REGRESSION: All non-mainframe scrollbars don't paint after r169065
@@ -263,8 +263,8 @@ class Settings : public RefCounted<Settings> {
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:
@@ -55,12 +55,12 @@ void MediaSessionManager::updateSessionState()
#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))
@@ -1189,7 +1189,12 @@ static dispatch_queue_t globalPullDelegateQueue()
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.
@@ -1,3 +1,14 @@
2014-05-20 Eric Carlson <eric.carlson@apple.com>

[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 <beidson@apple.com>

Use different AppKit API for image control menus.
@@ -903,7 +903,7 @@ - (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSSt

#if PLATFORM(IOS)
if (applicationIsMobileSafari())
Settings::setShouldManageAudioSession(true);
Settings::setShouldManageAudioSessionCategory(true);
#endif

didOneTimeInitialization = true;
@@ -1,3 +1,14 @@
2014-05-20 Eric Carlson <eric.carlson@apple.com>

[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 <simon.fraser@apple.com>

REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
@@ -320,7 +320,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
Settings::setDefaultMinDOMTimerInterval(0.004);

#if PLATFORM(IOS)
Settings::setShouldManageAudioSession(true);
Settings::setShouldManageAudioSessionCategory(true);
#endif

Page::PageClients pageClients;

0 comments on commit 395edff

Please sign in to comment.