<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208939] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208939">208939</a></dd>
<dt>Author</dt> <dd>zandobersek@gmail.com</dd>
<dt>Date</dt> <dd>2016-11-20 22:22:39 -0800 (Sun, 20 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[EncryptedMedia] Make EME API runtime-enabled
https://bugs.webkit.org/show_bug.cgi?id=164927

Reviewed by Jer Noble.

Source/JavaScriptCore:

* runtime/CommonIdentifiers.h: Add the necessary identifiers.

Source/WebCore:

Update the EME API IDL definitions to use the EnabledAtRuntime
attribute on the relevant interfaces, attributes and operations.
EncryptedMediaAPI is used as the attribute value.

The corresponding getter, setter and member boolean are added to
the RuntimeEnabledFeatures class.

* Modules/encryptedmedia/MediaKeyMessageEvent.idl:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeyStatusMap.idl:
* Modules/encryptedmedia/MediaKeySystemAccess.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/encryptedmedia/NavigatorEME.idl:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setEncryptedMediaAPIEnabled):
(WebCore::RuntimeEnabledFeatures::encryptedMediaAPIEnabled):
* html/HTMLMediaElement.idl:
* html/MediaEncryptedEvent.idl:

Source/WebKit2:

Add the new EncryptedMediaAPI preference. Set the same feature
flag on the shared RuntimeEnabledFeatures object to the
corresponding value that's stored in the WebPreferencesStore.

InjectedBundle::overrideBoolPreferenceForTestRunner() does the
same when the 'WebKitEncryptedMediaAPIEnabled' preference is
overridden in WKTR for testing purposes.

* Shared/WebPreferencesDefinitions.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Enable the EME API via the WKTR InjectedBundle whenever testing
commences. This does not have any effect unless the EME feature
is enabled at compile-time, but it's still added to match other
features and for future use.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setEncryptedMediaAPIEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonIdentifiersh">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventidl">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeySessionidl">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyStatusMapidl">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeySystemAccessidl">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeysidl">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaNavigatorEMEidl">trunk/Source/WebCore/Modules/encryptedmedia/NavigatorEME.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh">trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementidl">trunk/Source/WebCore/html/HTMLMediaElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaEncryptedEventidl">trunk/Source/WebCore/html/MediaEncryptedEvent.idl</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-11-20  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
+
+        [EncryptedMedia] Make EME API runtime-enabled
+        https://bugs.webkit.org/show_bug.cgi?id=164927
+
+        Reviewed by Jer Noble.
+
+        * runtime/CommonIdentifiers.h: Add the necessary identifiers.
+
</ins><span class="cx"> 2016-11-20  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix exception scope verification failures in ConstructData.cpp.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifiersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -70,6 +70,12 @@
</span><span class="cx">     macro(Map)\
</span><span class="cx">     macro(MapIterator)\
</span><span class="cx">     macro(Math) \
</span><ins>+    macro(MediaEncryptedEvent) \
+    macro(MediaKeyMessageEvent) \
+    macro(MediaKeySession) \
+    macro(MediaKeyStatusMap) \
+    macro(MediaKeySystemAccess) \
+    macro(MediaKeys) \
</ins><span class="cx">     macro(ModernMediaControls) \
</span><span class="cx">     macro(NaN) \
</span><span class="cx">     macro(Number) \
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/ChangeLog        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2016-11-20  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
+
+        [EncryptedMedia] Make EME API runtime-enabled
+        https://bugs.webkit.org/show_bug.cgi?id=164927
+
+        Reviewed by Jer Noble.
+
+        Update the EME API IDL definitions to use the EnabledAtRuntime
+        attribute on the relevant interfaces, attributes and operations.
+        EncryptedMediaAPI is used as the attribute value.
+
+        The corresponding getter, setter and member boolean are added to
+        the RuntimeEnabledFeatures class.
+
+        * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
+        * Modules/encryptedmedia/MediaKeySession.idl:
+        * Modules/encryptedmedia/MediaKeyStatusMap.idl:
+        * Modules/encryptedmedia/MediaKeySystemAccess.idl:
+        * Modules/encryptedmedia/MediaKeys.idl:
+        * Modules/encryptedmedia/NavigatorEME.idl:
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setEncryptedMediaAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::encryptedMediaAPIEnabled):
+        * html/HTMLMediaElement.idl:
+        * html/MediaEncryptedEvent.idl:
+
</ins><span class="cx"> 2016-11-20  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r208606?): LayoutTest fast/mediastream/enumerating-crash.html is a flaky crash
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=ENCRYPTED_MEDIA,
</span><span class="cx">     Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict),
</span><ins>+    EnabledAtRuntime=EncryptedMediaAPI
</ins><span class="cx"> ] interface MediaKeyMessageEvent : Event {
</span><span class="cx">     readonly attribute MediaKeyMessageType messageType;
</span><span class="cx">     readonly attribute ArrayBuffer message;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeySessionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=ENCRYPTED_MEDIA,
</span><ins>+    EnabledAtRuntime=EncryptedMediaAPI
</ins><span class="cx"> ] interface MediaKeySession : EventTarget {
</span><span class="cx">     readonly attribute DOMString sessionId;
</span><span class="cx">     readonly attribute unrestricted double expiration;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyStatusMapidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.idl (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.idl        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.idl        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -37,7 +37,8 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    Conditional=ENCRYPTED_MEDIA
</del><ins>+    Conditional=ENCRYPTED_MEDIA,
+    EnabledAtRuntime=EncryptedMediaAPI
</ins><span class="cx"> ] interface MediaKeyStatusMap {
</span><span class="cx">     iterable&lt;BufferSource, MediaKeyStatus&gt;;
</span><span class="cx">     readonly attribute unsigned long size;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeySystemAccessidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.idl (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.idl        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.idl        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -27,7 +27,8 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    Conditional=ENCRYPTED_MEDIA
</del><ins>+    Conditional=ENCRYPTED_MEDIA,
+    EnabledAtRuntime=EncryptedMediaAPI
</ins><span class="cx"> ] interface MediaKeySystemAccess {
</span><span class="cx">     readonly attribute DOMString keySystem;
</span><span class="cx">     [Custom] MediaKeySystemConfiguration getConfiguration();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeysidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.idl (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.idl        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.idl        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx">  
</span><span class="cx"> [
</span><span class="cx">     Conditional=ENCRYPTED_MEDIA,
</span><ins>+    EnabledAtRuntime=EncryptedMediaAPI
</ins><span class="cx"> ] interface MediaKeys {
</span><span class="cx">     [MayThrowException] MediaKeySession createSession(optional MediaKeySessionType sessionType = &quot;temporary&quot;);
</span><span class="cx">     Promise&lt;bool&gt; setServerCertificate(BufferSource serverCertificate);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaNavigatorEMEidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/NavigatorEME.idl (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/NavigatorEME.idl        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/Modules/encryptedmedia/NavigatorEME.idl        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -27,7 +27,8 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    Conditional=ENCRYPTED_MEDIA
</del><ins>+    Conditional=ENCRYPTED_MEDIA,
+    EnabledAtRuntime=EncryptedMediaAPI
</ins><span class="cx"> ] partial interface Navigator {
</span><span class="cx">     Promise&lt;MediaKeySystemAccess&gt; requestMediaKeySystemAccess(DOMString keySystem, sequence&lt;MediaKeySystemConfiguration&gt; supportedConfiguration);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -230,6 +230,11 @@
</span><span class="cx">     void setModernMediaControlsEnabled(bool areEnabled) { m_areModernMediaControlsEnabled = areEnabled; }
</span><span class="cx">     bool modernMediaControlsEnabled() const { return m_areModernMediaControlsEnabled; }
</span><span class="cx"> 
</span><ins>+#if ENABLE(ENCRYPTED_MEDIA)
+    void setEncryptedMediaAPIEnabled(bool isEnabled) { m_encryptedMediaAPIEnabled = isEnabled; }
+    bool encryptedMediaAPIEnabled() const { return m_encryptedMediaAPIEnabled; }
+#endif
+
</ins><span class="cx">     WEBCORE_EXPORT static RuntimeEnabledFeatures&amp; sharedFeatures();
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void reset();
</span><span class="lines">@@ -344,6 +349,10 @@
</span><span class="cx">     bool m_cssGridLayoutEnabled;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(ENCRYPTED_MEDIA)
+    bool m_encryptedMediaAPIEnabled { false };
+#endif
+
</ins><span class="cx">     friend class WTF::NeverDestroyed&lt;RuntimeEnabledFeatures&gt;;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.idl        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -93,10 +93,10 @@
</span><span class="cx"> 
</span><span class="cx">     [Conditional=LEGACY_ENCRYPTED_MEDIA] readonly attribute WebKitMediaKeys webkitKeys;
</span><span class="cx">     [Conditional=LEGACY_ENCRYPTED_MEDIA] void webkitSetMediaKeys(WebKitMediaKeys? mediaKeys);
</span><del>-    [Conditional=ENCRYPTED_MEDIA] readonly attribute MediaKeys mediaKeys;
-    [Conditional=ENCRYPTED_MEDIA] attribute EventHandler onencrypted;
-    [Conditional=ENCRYPTED_MEDIA] attribute EventHandler onwaitingforkey;
-    [Conditional=ENCRYPTED_MEDIA] Promise&lt;void&gt; setMediaKeys(MediaKeys? mediaKeys);
</del><ins>+    [Conditional=ENCRYPTED_MEDIA, EnabledAtRuntime=EncryptedMediaAPI] readonly attribute MediaKeys mediaKeys;
+    [Conditional=ENCRYPTED_MEDIA, EnabledAtRuntime=EncryptedMediaAPI] attribute EventHandler onencrypted;
+    [Conditional=ENCRYPTED_MEDIA, EnabledAtRuntime=EncryptedMediaAPI] attribute EventHandler onwaitingforkey;
+    [Conditional=ENCRYPTED_MEDIA, EnabledAtRuntime=EncryptedMediaAPI] Promise&lt;void&gt; setMediaKeys(MediaKeys? mediaKeys);
</ins><span class="cx"> 
</span><span class="cx">     [Conditional=VIDEO_TRACK, MayThrowException] TextTrack addTextTrack(DOMString kind, optional DOMString label = &quot;&quot;, optional DOMString language = &quot;&quot;);
</span><span class="cx">     [Conditional=VIDEO_TRACK] readonly attribute AudioTrackList audioTracks;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaEncryptedEventidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaEncryptedEvent.idl (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaEncryptedEvent.idl        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebCore/html/MediaEncryptedEvent.idl        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -33,7 +33,8 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=ENCRYPTED_MEDIA,
</span><del>-    Constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict)
</del><ins>+    Constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict),
+    EnabledAtRuntime=EncryptedMediaAPI
</ins><span class="cx"> ] interface MediaEncryptedEvent : Event {
</span><span class="cx">     readonly attribute DOMString initDataType;
</span><span class="cx">     readonly attribute ArrayBuffer? initData;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebKit2/ChangeLog        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-11-20  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
+
+        [EncryptedMedia] Make EME API runtime-enabled
+        https://bugs.webkit.org/show_bug.cgi?id=164927
+
+        Reviewed by Jer Noble.
+
+        Add the new EncryptedMediaAPI preference. Set the same feature
+        flag on the shared RuntimeEnabledFeatures object to the
+        corresponding value that's stored in the WebPreferencesStore.
+
+        InjectedBundle::overrideBoolPreferenceForTestRunner() does the
+        same when the 'WebKitEncryptedMediaAPIEnabled' preference is
+        overridden in WKTR for testing purposes.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
</ins><span class="cx"> 2016-11-19  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Salt network cache hashes
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -236,6 +236,7 @@
</span><span class="cx">     macro(NeedsStorageAccessFromFileURLsQuirk, needsStorageAccessFromFileURLsQuirk, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(AsyncImageDecodingEnabled, asyncImageDecodingEnabled, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(CustomElementsEnabled, customElementsEnabled, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</span><ins>+    macro(EncryptedMediaAPIEnabled, encryptedMediaAPIEnabled, Bool, bool, false, &quot;&quot;, &quot;&quot;) \
</ins><span class="cx">     \
</span><span class="cx"> 
</span><span class="cx"> #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -216,6 +216,11 @@
</span><span class="cx">     if (preference == &quot;WebKitModernMediaControlsEnabled&quot;)
</span><span class="cx">         RuntimeEnabledFeatures::sharedFeatures().setModernMediaControlsEnabled(enabled);
</span><span class="cx"> 
</span><ins>+#if ENABLE(ENCRYPTED_MEDIA)
+    if (preference == &quot;WebKitEncryptedMediaAPIEnabled&quot;)
+        RuntimeEnabledFeatures::sharedFeatures().setEncryptedMediaAPIEnabled(enabled);
+#endif
+
</ins><span class="cx">     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
</span><span class="cx"> #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
</span><span class="cx">     macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -3187,6 +3187,10 @@
</span><span class="cx"> 
</span><span class="cx">     RuntimeEnabledFeatures::sharedFeatures().setModernMediaControlsEnabled(store.getBoolValueForKey(WebPreferencesKey::modernMediaControlsEnabledKey()));
</span><span class="cx"> 
</span><ins>+#if ENABLE(ENCRYPTED_MEDIA)
+    RuntimeEnabledFeatures::sharedFeatures().setEncryptedMediaAPIEnabled(store.getBoolValueForKey(WebPreferencesKey::encryptedMediaAPIEnabledKey()));
+#endif
+
</ins><span class="cx">     platformPreferencesDidChange(store);
</span><span class="cx"> 
</span><span class="cx">     if (m_drawingArea)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Tools/ChangeLog        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-11-20  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
+
+        [EncryptedMedia] Make EME API runtime-enabled
+        https://bugs.webkit.org/show_bug.cgi?id=164927
+
+        Reviewed by Jer Noble.
+
+        Enable the EME API via the WKTR InjectedBundle whenever testing
+        commences. This does not have any effect unless the EME feature
+        is enabled at compile-time, but it's still added to match other
+        features and for future use.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setEncryptedMediaAPIEnabled):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
</ins><span class="cx"> 2016-11-19  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix the Mac and iOS bulds.
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -330,6 +330,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_testRunner-&gt;setES6ModulesEnabled(true);
</span><span class="cx"> 
</span><ins>+    m_testRunner-&gt;setEncryptedMediaAPIEnabled(true);
+
</ins><span class="cx">     m_testRunner-&gt;setCloseRemainingWindowsWhenComplete(false);
</span><span class="cx">     m_testRunner-&gt;setAcceptsEditing(true);
</span><span class="cx">     m_testRunner-&gt;setTabKeyCyclesThroughElements(true);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -396,6 +396,13 @@
</span><span class="cx">     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestRunner::setEncryptedMediaAPIEnabled(bool enabled)
+{
+    WKRetainPtr&lt;WKStringRef&gt; key(AdoptWK, WKStringCreateWithUTF8CString(&quot;WebKitEncryptedMediaAPIEnabled&quot;));
+    auto&amp; injectedBundle = InjectedBundle::singleton();
+    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
</ins><span class="cx"> void TestRunner::setAllowsAnySSLCertificate(bool enabled)
</span><span class="cx"> {
</span><span class="cx">     InjectedBundle::singleton().setAllowsAnySSLCertificate(enabled);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (208938 => 208939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2016-11-21 04:38:42 UTC (rev 208938)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2016-11-21 06:22:39 UTC (rev 208939)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx">     void setDownloadAttributeEnabled(bool);
</span><span class="cx">     void setAllowsAnySSLCertificate(bool);
</span><span class="cx">     void setES6ModulesEnabled(bool);
</span><ins>+    void setEncryptedMediaAPIEnabled(bool);
</ins><span class="cx"> 
</span><span class="cx">     // Special DOM functions.
</span><span class="cx">     void clearBackForwardList();
</span></span></pre>
</div>
</div>

</body>
</html>