Diff
Modified: trunk/Source/WebKit/ChangeLog (265532 => 265533)
--- trunk/Source/WebKit/ChangeLog 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/ChangeLog 2020-08-11 23:07:51 UTC (rev 265533)
@@ -1,3 +1,28 @@
+2020-08-11 Jer Noble <[email protected]>
+
+ [Mac] Add Experimental Feature preference for SW VP9
+ https://bugs.webkit.org/show_bug.cgi?id=215043
+ <rdar://problem/66400034>
+
+ Reviewed by Beth Dakin.
+
+ * FeatureFlags/WebKit.plist:
+ * Shared/WebPageCreationParameters.cpp:
+ (WebKit::WebPageCreationParameters::encode const):
+ * Shared/WebPageCreationParameters.h:
+ * Shared/WebPreferences.yaml:
+ * Shared/WebPreferencesDefaultValues.cpp:
+ (WebKit::defaultVP9SWDecoderEnabledOnBattery):
+ * Shared/WebPreferencesDefaultValues.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::creationParameters):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::m_limitsNavigationsToAppBoundDomains):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::enableVP9Decoder):
+ (WebKit::WebProcess::enableVP9SWDecoder):
+ * WebProcess/WebProcess.h:
+
2020-08-11 Brady Eidson <[email protected]>
Add a "use stored credentials" setting to WKWebView.
Modified: trunk/Source/WebKit/FeatureFlags/WebKit.plist (265532 => 265533)
--- trunk/Source/WebKit/FeatureFlags/WebKit.plist 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/FeatureFlags/WebKit.plist 2020-08-11 23:07:51 UTC (rev 265533)
@@ -52,6 +52,11 @@
<key>Enabled</key>
<true/>
</dict>
+ <key>sw_vp9_decoder_on_battery</key>
+ <dict>
+ <key>Enabled</key>
+ <false/>
+ </dict>
<key>webm_parser</key>
<dict>
<key>Enabled</key>
Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp (265532 => 265533)
--- trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp 2020-08-11 23:07:51 UTC (rev 265533)
@@ -154,6 +154,7 @@
encoder << shouldCaptureDisplayInUIProcess;
encoder << shouldRenderCanvasInGPUProcess;
encoder << shouldEnableVP9Decoder;
+ encoder << shouldEnableVP9SWDecoder;
encoder << needsInAppBrowserPrivacyQuirks;
encoder << limitsNavigationsToAppBoundDomains;
encoder << shouldRelaxThirdPartyCookieBlocking;
@@ -496,6 +497,9 @@
if (!decoder.decode(parameters.shouldEnableVP9Decoder))
return WTF::nullopt;
+ if (!decoder.decode(parameters.shouldEnableVP9SWDecoder))
+ return WTF::nullopt;
+
if (!decoder.decode(parameters.needsInAppBrowserPrivacyQuirks))
return WTF::nullopt;
Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.h (265532 => 265533)
--- trunk/Source/WebKit/Shared/WebPageCreationParameters.h 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.h 2020-08-11 23:07:51 UTC (rev 265533)
@@ -227,6 +227,7 @@
bool shouldCaptureDisplayInUIProcess { false };
bool shouldRenderCanvasInGPUProcess { false };
bool shouldEnableVP9Decoder { false };
+ bool shouldEnableVP9SWDecoder { false };
bool needsInAppBrowserPrivacyQuirks { false };
bool limitsNavigationsToAppBoundDomains { false };
bool canUseCredentialStorage { true };
Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (265532 => 265533)
--- trunk/Source/WebKit/Shared/WebPreferences.yaml 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml 2020-08-11 23:07:51 UTC (rev 265533)
@@ -677,6 +677,15 @@
category: experimental
condition: ENABLE(VP9)
+VP9SWDecoderEnabledOnBattery:
+ type: bool
+ defaultValue: defaultVP9SWDecoderEnabledOnBattery()
+ webcoreBinding: none
+ humanReadableName: "VP9 SW decoder on battery"
+ humanReadableDescription: "Enable VP9 SW decoder on battery"
+ category: experimental
+ condition: ENABLE(VP9)
+
WebMParserEnabled:
type: bool
defaultValue: defaultWebMParserEnabled()
Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (265532 => 265533)
--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp 2020-08-11 23:07:51 UTC (rev 265533)
@@ -254,6 +254,17 @@
}
#endif
+#if ENABLE(VP9)
+bool defaultVP9SWDecoderEnabledOnBattery()
+{
+#if HAVE(SYSTEM_FEATURE_FLAGS)
+ return isFeatureFlagEnabled("SW_vp9_decoder_on_battery");
+#endif
+
+ return false;
+}
+#endif
+
#if ENABLE(MEDIA_SOURCE) && ENABLE(VP9)
bool defaultWebMParserEnabled()
{
Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (265532 => 265533)
--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h 2020-08-11 23:07:51 UTC (rev 265533)
@@ -364,6 +364,7 @@
#if ENABLE(VP9)
bool defaultVP9DecoderEnabled();
+bool defaultVP9SWDecoderEnabledOnBattery();
#endif
#if ENABLE(MEDIA_SOURCE) && ENABLE(VP9)
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (265532 => 265533)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-08-11 23:07:51 UTC (rev 265533)
@@ -211,6 +211,7 @@
#include "VideoFullscreenManagerProxyMessages.h"
#include <WebCore/AttributedString.h>
#include <WebCore/RunLoopObserver.h>
+#include <WebCore/SystemBattery.h>
#include <WebCore/TextIndicatorWindow.h>
#include <wtf/MachSendRight.h>
#include <wtf/cocoa/Entitlements.h>
@@ -7869,6 +7870,9 @@
parameters.shouldCaptureVideoInGPUProcess = preferences().captureVideoInGPUProcessEnabled();
parameters.shouldRenderCanvasInGPUProcess = preferences().renderCanvasInGPUProcessEnabled();
parameters.shouldEnableVP9Decoder = preferences().vp9DecoderEnabled();
+#if PLATFORM(COCOA)
+ parameters.shouldEnableVP9SWDecoder = preferences().vp9DecoderEnabled() && (!WebCore::systemHasBattery() || preferences().vp9SWDecoderEnabledOnBattery());
+#endif
parameters.shouldCaptureDisplayInUIProcess = m_process->processPool().configuration().shouldCaptureDisplayInUIProcess();
parameters.limitsNavigationsToAppBoundDomains = m_limitsNavigationsToAppBoundDomains;
parameters.shouldRelaxThirdPartyCookieBlocking = m_configuration->shouldRelaxThirdPartyCookieBlocking();
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (265532 => 265533)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-08-11 23:07:51 UTC (rev 265533)
@@ -780,6 +780,9 @@
if (parameters.shouldEnableVP9Decoder)
WebProcess::singleton().enableVP9Decoder();
+ if (parameters.shouldEnableVP9SWDecoder)
+ WebProcess::singleton().enableVP9SWDecoder();
+
m_page->setCanUseCredentialStorage(parameters.canUseCredentialStorage);
updateThrottleState();
Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (265532 => 265533)
--- trunk/Source/WebKit/WebProcess/WebProcess.cpp 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp 2020-08-11 23:07:51 UTC (rev 265533)
@@ -1967,6 +1967,15 @@
#endif
}
+void WebProcess::enableVP9SWDecoder()
+{
+ if (m_vp9SWDecoderEnabled)
+ return;
+
+ m_vp9SWDecoderEnabled = true;
+ LibWebRTCProvider::registerWebKitVP9Decoder();
+}
+
} // namespace WebKit
#undef RELEASE_LOG_SESSION_ID
Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (265532 => 265533)
--- trunk/Source/WebKit/WebProcess/WebProcess.h 2020-08-11 23:05:40 UTC (rev 265532)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h 2020-08-11 23:07:51 UTC (rev 265533)
@@ -333,6 +333,7 @@
#endif
void enableVP9Decoder();
+ void enableVP9SWDecoder();
#if PLATFORM(COCOA)
void willWriteToPasteboardAsynchronously(const String& pasteboardName);
@@ -660,6 +661,7 @@
bool m_useGPUProcessForMedia { false };
bool m_vp9DecoderEnabled { false };
+ bool m_vp9SWDecoderEnabled { false };
};
} // namespace WebKit