Diff
Modified: branches/safari-537-branch/Source/WebCore/ChangeLog (152252 => 152253)
--- branches/safari-537-branch/Source/WebCore/ChangeLog 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebCore/ChangeLog 2013-07-01 21:00:35 UTC (rev 152253)
@@ -1,5 +1,29 @@
2013-07-01 Lucas Forschler <[email protected]>
+ Merge r152234
+
+ 2013-06-27 Jer Noble <[email protected]>
+
+ Audio in apps which embed WebViews is corrupted.
+ https://bugs.webkit.org/show_bug.cgi?id=118163
+
+ Reviewed by Maciej Stachowiak.
+
+ Add a preference, which defaults to off, which controls whether the
+ AudioSessionManager will switch to a large audio buffer setting for
+ power-savings during <video> playback.
+
+ * WebCore.exp.in:
+ * page/Settings.cpp:
+ (WebCore::Settings::setLowPowerVideoAudioBufferSizeEnabled): Added. Simple setter.
+ * page/Settings.h:
+ (WebCore::Settings::lowPowerVideoAudioBufferSizeEnabled): Added. Simple getter.
+ * platform/audio/mac/AudioSessionManagerMac.cpp:
+ (AudioSessionManager::updateSessionState): Only set the large audio buffer
+ size if lowPowerVideoAudioBufferSize is enabled.
+
+2013-07-01 Lucas Forschler <[email protected]>
+
Merge r152231
2013-07-01 Roger Fong <[email protected]>
Modified: branches/safari-537-branch/Source/WebCore/WebCore.exp.in (152252 => 152253)
--- branches/safari-537-branch/Source/WebCore/WebCore.exp.in 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebCore/WebCore.exp.in 2013-07-01 21:00:35 UTC (rev 152253)
@@ -1120,6 +1120,7 @@
__ZN7WebCore8Settings32setScreenFontSubstitutionEnabledEb
__ZN7WebCore8Settings33setAggressiveTileRetentionEnabledEb
__ZN7WebCore8Settings37setScrollingPerformanceLoggingEnabledEb
+__ZN7WebCore8Settings38setLowPowerVideoAudioBufferSizeEnabledEb
__ZN7WebCore8Settings42setHiddenPageCSSAnimationSuspensionEnabledEb
__ZN7WebCore8Settings45setShouldRespectPriorityInCSSAttributeSettersEb
__ZN7WebCore8blankURLEv
Modified: branches/safari-537-branch/Source/WebCore/page/Settings.cpp (152252 => 152253)
--- branches/safari-537-branch/Source/WebCore/page/Settings.cpp 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebCore/page/Settings.cpp 2013-07-01 21:00:35 UTC (rev 152253)
@@ -89,6 +89,7 @@
#endif
bool Settings::gShouldRespectPriorityInCSSAttributeSetters = false;
+bool Settings::gLowPowerVideoAudioBufferSizeEnabled = false;
// NOTEs
// 1) EditingMacBehavior comprises Tiger, Leopard, SnowLeopard and iOS builds, as well as QtWebKit when built on Mac;
@@ -611,4 +612,9 @@
}
#endif
+void Settings::setLowPowerVideoAudioBufferSizeEnabled(bool flag)
+{
+ gLowPowerVideoAudioBufferSizeEnabled = flag;
+}
+
} // namespace WebCore
Modified: branches/safari-537-branch/Source/WebCore/page/Settings.h (152252 => 152253)
--- branches/safari-537-branch/Source/WebCore/page/Settings.h 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebCore/page/Settings.h 2013-07-01 21:00:35 UTC (rev 152253)
@@ -258,6 +258,9 @@
void setHiddenPageCSSAnimationSuspensionEnabled(bool);
#endif
+ static bool lowPowerVideoAudioBufferSizeEnabled() { return gLowPowerVideoAudioBufferSizeEnabled; }
+ static void setLowPowerVideoAudioBufferSizeEnabled(bool);
+
private:
explicit Settings(Page*);
@@ -315,7 +318,6 @@
#if ENABLE(PAGE_VISIBILITY_API)
bool m_hiddenPageCSSAnimationSuspensionEnabled : 1;
#endif
-
static double gDefaultMinDOMTimerInterval;
static double gDefaultDOMTimerAlignmentInterval;
@@ -339,6 +341,8 @@
static bool gShouldRespectPriorityInCSSAttributeSetters;
static double gHiddenPageDOMTimerAlignmentInterval;
+
+ static bool gLowPowerVideoAudioBufferSizeEnabled;
};
} // namespace WebCore
Modified: branches/safari-537-branch/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp (152252 => 152253)
--- branches/safari-537-branch/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp 2013-07-01 21:00:35 UTC (rev 152253)
@@ -29,6 +29,7 @@
#if USE(AUDIO_SESSION) && PLATFORM(MAC)
#include "Logging.h"
+#include "Settings.h"
using namespace WebCore;
@@ -44,7 +45,7 @@
// FIXME: <http://webkit.org/b/116725> Figure out why enabling the code below
// causes media LayoutTests to fail on 10.8.
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
- else if (has(Video) || has(Audio))
+ else if ((has(Video) || has(Audio)) && Settings::lowPowerVideoAudioBufferSizeEnabled())
AudioSession::sharedSession().setPreferredBufferSize(kLowPowerVideoBufferSize);
#endif
}
Modified: branches/safari-537-branch/Source/WebKit/mac/ChangeLog (152252 => 152253)
--- branches/safari-537-branch/Source/WebKit/mac/ChangeLog 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebKit/mac/ChangeLog 2013-07-01 21:00:35 UTC (rev 152253)
@@ -1,3 +1,25 @@
+2013-07-01 Lucas Forschler <[email protected]>
+
+ Merge r152234
+
+ 2013-06-27 Jer Noble <[email protected]>
+
+ Audio in apps which embed WebViews is corrupted.
+ https://bugs.webkit.org/show_bug.cgi?id=118163
+
+ Reviewed by Maciej Stachowiak.
+
+ Expose the WebCore lowPowerVideoAudioBufferSizeEnabled setting to WebKit clients.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences lowPowerVideoAudioBufferSizeEnabled]):
+ (-[WebPreferences setLowPowerVideoAudioBufferSizeEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]):
+
2013-06-26 Lucas Forschler <[email protected]>
Merge r151832
Modified: branches/safari-537-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (152252 => 152253)
--- branches/safari-537-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h 2013-07-01 21:00:35 UTC (rev 152253)
@@ -132,6 +132,7 @@
#define WebKitQTKitEnabledPreferenceKey @"WebKitQTKitEnabled"
#define WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey @"WebKitHiddenPageDOMTimerThrottlingEnabled"
#define WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey @"WebKitHiddenPageCSSAnimationSuspensionEnabled"
+#define WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey @"WebKitLowPowerVideoAudioBufferSizeEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
Modified: branches/safari-537-branch/Source/WebKit/mac/WebView/WebPreferences.mm (152252 => 152253)
--- branches/safari-537-branch/Source/WebKit/mac/WebView/WebPreferences.mm 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebKit/mac/WebView/WebPreferences.mm 2013-07-01 21:00:35 UTC (rev 152253)
@@ -418,6 +418,7 @@
[NSNumber numberWithBool:YES], WebKitQTKitEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
nil];
@@ -1829,6 +1830,16 @@
[self _setBoolValue:enabled forKey:WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey];
}
+- (BOOL)lowPowerVideoAudioBufferSizeEnabled
+{
+ return [self _boolValueForKey:WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey];
+}
+
+- (void)setLowPowerVideoAudioBufferSizeEnabled:(BOOL)enabled
+{
+ [self _setBoolValue:enabled forKey:WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey];
+}
+
@end
@implementation WebPreferences (WebInternal)
Modified: branches/safari-537-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (152252 => 152253)
--- branches/safari-537-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2013-07-01 21:00:35 UTC (rev 152253)
@@ -335,4 +335,8 @@
- (BOOL)hiddenPageCSSAnimationSuspensionEnabled;
- (void)setHiddenPageCSSAnimationSuspensionEnabled:(BOOL)flag;
+- (BOOL)lowPowerVideoAudioBufferSizeEnabled;
+- (void)setLowPowerVideoAudioBufferSizeEnabled:(BOOL)enabled;
+
+
@end
Modified: branches/safari-537-branch/Source/WebKit/mac/WebView/WebView.mm (152252 => 152253)
--- branches/safari-537-branch/Source/WebKit/mac/WebView/WebView.mm 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebKit/mac/WebView/WebView.mm 2013-07-01 21:00:35 UTC (rev 152253)
@@ -1547,6 +1547,7 @@
settings->setRequestAnimationFrameEnabled([preferences requestAnimationFrameEnabled]);
settings->setNeedsDidFinishLoadOrderQuirk(needsDidFinishLoadOrderQuirk());
settings->setDiagnosticLoggingEnabled([preferences diagnosticLoggingEnabled]);
+ settings->setLowPowerVideoAudioBufferSizeEnabled([preferences lowPowerVideoAudioBufferSizeEnabled]);
switch ([preferences storageBlockingPolicy]) {
case WebAllowAllStorage:
Modified: branches/safari-537-branch/Source/WebKit2/ChangeLog (152252 => 152253)
--- branches/safari-537-branch/Source/WebKit2/ChangeLog 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebKit2/ChangeLog 2013-07-01 21:00:35 UTC (rev 152253)
@@ -1,5 +1,22 @@
2013-07-01 Lucas Forschler <[email protected]>
+ Merge r152234
+
+ 2013-06-27 Jer Noble <[email protected]>
+
+ Audio in apps which embed WebViews is corrupted.
+ https://bugs.webkit.org/show_bug.cgi?id=118163
+
+ Reviewed by Maciej Stachowiak.
+
+ Expose the WebCore lowPowerVideoAudioBufferSizeEnabled setting to WebKit2 clients.
+
+ * Shared/WebPreferencesStore.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+
+2013-07-01 Lucas Forschler <[email protected]>
+
Merge r152190
2013-06-28 Tim Horton <[email protected]>
Modified: branches/safari-537-branch/Source/WebKit2/Shared/WebPreferencesStore.h (152252 => 152253)
--- branches/safari-537-branch/Source/WebKit2/Shared/WebPreferencesStore.h 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebKit2/Shared/WebPreferencesStore.h 2013-07-01 21:00:35 UTC (rev 152253)
@@ -160,6 +160,7 @@
macro(AcceleratedCompositingForOverflowScrollEnabled, acceleratedCompositingForOverflowScrollEnabled, Bool, bool, false) \
macro(HiddenPageDOMTimerThrottlingEnabled, hiddenPageDOMTimerThrottlingEnabled, Bool, bool, DEFAULT_HIDDEN_PAGE_DOM_TIMER_THROTTLING_ENABLED) \
macro(HiddenPageCSSAnimationSuspensionEnabled, hiddenPageCSSAnimationSuspensionEnabled, Bool, bool, DEFAULT_HIDDEN_PAGE_CSS_ANIMATION_SUSPENSION_ENABLED) \
+ macro(LowPowerVideoAudioBufferSizeEnabled, lowPowerVideoAudioBufferSizeEnabled, Bool, bool, false) \
\
#define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (152252 => 152253)
--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-07-01 20:57:06 UTC (rev 152252)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-07-01 21:00:35 UTC (rev 152253)
@@ -2572,6 +2572,8 @@
settings->setHiddenPageCSSAnimationSuspensionEnabled(store.getBoolValueForKey(WebPreferencesKey::hiddenPageCSSAnimationSuspensionEnabledKey()));
#endif
+ settings->setLowPowerVideoAudioBufferSizeEnabled(store.getBoolValueForKey(WebPreferencesKey::lowPowerVideoAudioBufferSizeEnabledKey()));
+
platformPreferencesDidChange(store);
if (m_drawingArea)