<!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>[206983] 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/206983">206983</a></dd>
<dt>Author</dt> <dd>zandobersek@gmail.com</dd>
<dt>Date</dt> <dd>2016-10-09 23:21:52 -0700 (Sun, 09 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>ENABLE_LEGACY_ENCRYPTED_MEDIA interfaces should have a hard-coded WebKit prefix
https://bugs.webkit.org/show_bug.cgi?id=162982

Reviewed by Jer Noble.

Have the Web-exposed interfaces guarded by ENABLE_LEGACY_ENCRYPTED_MEDIA also use
the WebKit prefix in the implementations. This will prevent conflicts between
interfaces with same names in both the legacy API and the future EME API.

Most of the interfaces in this legacy API already used the WebKit prefix when
exposed via JS bindings. The only exception is MediaKeyNeededEvent, which gets
prefixed in this patch.

The interface implementations for this legacy API are also moved under the
Modules/encryptedmedia/legacy/ directory.

No new tests -- covered by existing tests (with the relevant changes reflected
in the updated baselines).

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::generateKeyRequest):
(WebCore::CDMSessionClearKey::update):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp.
(WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
(WebCore::WebKitMediaKeyMessageEvent::~WebKitMediaKeyMessageEvent):
(WebCore::WebKitMediaKeyMessageEvent::eventInterface):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h.
(WebCore::WebKitMediaKeyMessageEvent::create):
(WebCore::WebKitMediaKeyMessageEvent::createForBindings):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp.
(WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
(WebCore::WebKitMediaKeyNeededEvent::~WebKitMediaKeyNeededEvent):
(WebCore::WebKitMediaKeyNeededEvent::eventInterface):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h.
(WebCore::WebKitMediaKeyNeededEvent::create):
(WebCore::WebKitMediaKeyNeededEvent::createForBindings):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp.
(WebCore::WebKitMediaKeySession::create):
(WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::setError):
(WebCore::WebKitMediaKeySession::close):
(WebCore::WebKitMediaKeySession::cachedKeyForKeyId):
(WebCore::WebKitMediaKeySession::sessionId):
(WebCore::WebKitMediaKeySession::generateKeyRequest):
(WebCore::WebKitMediaKeySession::keyRequestTimerFired):
(WebCore::WebKitMediaKeySession::update):
(WebCore::WebKitMediaKeySession::addKeyTimerFired):
(WebCore::WebKitMediaKeySession::sendMessage):
(WebCore::WebKitMediaKeySession::sendError):
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
(WebCore::WebKitMediaKeySession::hasPendingActivity):
(WebCore::WebKitMediaKeySession::stop):
(WebCore::WebKitMediaKeySession::activeDOMObjectName):
(WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp.
(WebCore::WebKitMediaKeys::create):
(WebCore::WebKitMediaKeys::WebKitMediaKeys):
(WebCore::WebKitMediaKeys::~WebKitMediaKeys):
(WebCore::WebKitMediaKeys::createSession):
(WebCore::WebKitMediaKeys::isTypeSupported):
(WebCore::WebKitMediaKeys::setMediaElement):
(WebCore::WebKitMediaKeys::cdmMediaPlayer):
(WebCore::WebKitMediaKeys::keyAdded):
(WebCore::WebKitMediaKeys::cachedKeyForKeyId):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.idl.
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::setMediaKeys):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::keys):
* html/HTMLMediaElement.idl:
* html/WebKitMediaKeyError.h: Renamed from Source/WebCore/html/MediaKeyError.h.
(WebCore::WebKitMediaKeyError::create):
(WebCore::WebKitMediaKeyError::WebKitMediaKeyError):
* html/WebKitMediaKeyError.idl: Renamed from Source/WebCore/html/MediaKeyError.idl.
* testing/MockCDM.cpp:
(WebCore::MockCDMSession::generateKeyRequest):
(WebCore::MockCDMSession::update):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformefljsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacjsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1jsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacyosemitejsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformwinjsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMcpp">trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeycpp">trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDictionarycpp">trunk/Source/WebCore/bindings/js/JSDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDictionaryh">trunk/Source/WebCore/bindings/js/JSDictionary.h</a></li>
<li><a href="#trunkSourceWebCoredomEventNamesin">trunk/Source/WebCore/dom/EventNames.in</a></li>
<li><a href="#trunkSourceWebCoredomEventTargetFactoryin">trunk/Source/WebCore/dom/EventTargetFactory.in</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementidl">trunk/Source/WebCore/html/HTMLMediaElement.idl</a></li>
<li><a href="#trunkSourceWebCoretestingMockCDMcpp">trunk/Source/WebCore/testing/MockCDM.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/Modules/encryptedmedia/legacy/</li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyMessageEventcpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyMessageEventh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyMessageEventidl">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyNeededEventcpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyNeededEventh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyNeededEventidl">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessioncpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionidl">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyscpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeysh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeysidl">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlWebKitMediaKeyErrorh">trunk/Source/WebCore/html/WebKitMediaKeyError.h</a></li>
<li><a href="#trunkSourceWebCorehtmlWebKitMediaKeyErroridl">trunk/Source/WebCore/html/WebKitMediaKeyError.idl</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventcpp">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventh">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventidl">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyNeededEventcpp">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyNeededEventh">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyNeededEventidl">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeySessioncpp">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeySessionh">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeySessionidl">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyscpp">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeysh">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeysidl">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaKeyErrorh">trunk/Source/WebCore/html/MediaKeyError.h</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaKeyErroridl">trunk/Source/WebCore/html/MediaKeyError.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsplatformefljsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -838,11 +838,6 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').configurable is true
</span><del>-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').value is MediaKeyNeededEvent
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').configurable is true
</del><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').value is MediaList
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('set') is false
</span><span class="lines">@@ -2073,6 +2068,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').value is WebKitMediaKeyNeededEvent
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').value is WebKitMediaKeySession
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacjsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -973,11 +973,6 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').configurable is true
</span><del>-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').value is MediaKeyNeededEvent
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').configurable is true
</del><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').value is MediaList
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('set') is false
</span><span class="lines">@@ -2338,6 +2333,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').value is WebKitMediaKeyNeededEvent
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').value is WebKitMediaKeySession
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1jsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -958,11 +958,6 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').configurable is true
</span><del>-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').value is MediaKeyNeededEvent
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').configurable is true
</del><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').value is MediaList
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('set') is false
</span><span class="lines">@@ -2323,6 +2318,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').value is WebKitMediaKeyNeededEvent
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').value is WebKitMediaKeySession
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacyosemitejsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -973,11 +973,6 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').configurable is true
</span><del>-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').value is MediaKeyNeededEvent
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').configurable is true
</del><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').value is MediaList
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('set') is false
</span><span class="lines">@@ -2338,6 +2333,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').value is WebKitMediaKeyNeededEvent
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').value is WebKitMediaKeySession
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinjsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -748,11 +748,6 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaError').configurable is true
</span><del>-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').value is MediaKeyNeededEvent
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'MediaKeyNeededEvent').configurable is true
</del><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').value is MediaList
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'MediaList').hasOwnProperty('set') is false
</span><span class="lines">@@ -1793,6 +1788,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyMessageEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').value is WebKitMediaKeyNeededEvent
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyNeededEvent').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').value is WebKitMediaKeySession
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeySession').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -8,6 +8,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/applepay&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/battery&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/encryptedmedia&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/Modules/encryptedmedia/legacy&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/Modules/fetch&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/geolocation&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/indexeddb&quot;
</span><span class="lines">@@ -138,7 +139,7 @@
</span><span class="cx"> 
</span><span class="cx">     Modules/airplay
</span><span class="cx">     Modules/battery
</span><del>-    Modules/encryptedmedia
</del><ins>+    Modules/encryptedmedia/legacy
</ins><span class="cx">     Modules/fetch
</span><span class="cx">     Modules/geolocation
</span><span class="cx">     Modules/indexeddb
</span><span class="lines">@@ -2998,21 +2999,22 @@
</span><span class="cx">         Modules/encryptedmedia/CDMPrivateClearKey.cpp
</span><span class="cx">         Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp
</span><span class="cx">         Modules/encryptedmedia/CDMSessionClearKey.cpp
</span><del>-        Modules/encryptedmedia/MediaKeyMessageEvent.cpp
-        Modules/encryptedmedia/MediaKeyNeededEvent.cpp
-        Modules/encryptedmedia/MediaKeySession.cpp
-        Modules/encryptedmedia/MediaKeys.cpp
</del><ins>+
+        Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp
+        Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp
+        Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
+        Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp
</ins><span class="cx">     )
</span><span class="cx">     list(APPEND WebCoreTestSupport_SOURCES
</span><span class="cx">         testing/MockCDM.cpp
</span><span class="cx">     )
</span><span class="cx">     list(APPEND WebCore_IDL_FILES
</span><del>-        Modules/encryptedmedia/MediaKeyMessageEvent.idl
-        Modules/encryptedmedia/MediaKeyNeededEvent.idl
-        Modules/encryptedmedia/MediaKeySession.idl
-        Modules/encryptedmedia/MediaKeys.idl
</del><ins>+        Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl
+        Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl
+        Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl
+        Modules/encryptedmedia/legacy/WebKitMediaKeys.idl
</ins><span class="cx"> 
</span><del>-        html/MediaKeyError.idl
</del><ins>+        html/WebKitMediaKeyError.idl
</ins><span class="cx">     )
</span><span class="cx"> endif ()
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/ChangeLog        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,5 +1,101 @@
</span><span class="cx"> 2016-10-09  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        ENABLE_LEGACY_ENCRYPTED_MEDIA interfaces should have a hard-coded WebKit prefix
+        https://bugs.webkit.org/show_bug.cgi?id=162982
+
+        Reviewed by Jer Noble.
+
+        Have the Web-exposed interfaces guarded by ENABLE_LEGACY_ENCRYPTED_MEDIA also use
+        the WebKit prefix in the implementations. This will prevent conflicts between
+        interfaces with same names in both the legacy API and the future EME API.
+
+        Most of the interfaces in this legacy API already used the WebKit prefix when
+        exposed via JS bindings. The only exception is MediaKeyNeededEvent, which gets
+        prefixed in this patch.
+
+        The interface implementations for this legacy API are also moved under the
+        Modules/encryptedmedia/legacy/ directory.
+
+        No new tests -- covered by existing tests (with the relevant changes reflected
+        in the updated baselines).
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * Modules/encryptedmedia/CDM.cpp:
+        * Modules/encryptedmedia/CDMSessionClearKey.cpp:
+        (WebCore::CDMSessionClearKey::generateKeyRequest):
+        (WebCore::CDMSessionClearKey::update):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp.
+        (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
+        (WebCore::WebKitMediaKeyMessageEvent::~WebKitMediaKeyMessageEvent):
+        (WebCore::WebKitMediaKeyMessageEvent::eventInterface):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h.
+        (WebCore::WebKitMediaKeyMessageEvent::create):
+        (WebCore::WebKitMediaKeyMessageEvent::createForBindings):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl.
+        * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp.
+        (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
+        (WebCore::WebKitMediaKeyNeededEvent::~WebKitMediaKeyNeededEvent):
+        (WebCore::WebKitMediaKeyNeededEvent::eventInterface):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h.
+        (WebCore::WebKitMediaKeyNeededEvent::create):
+        (WebCore::WebKitMediaKeyNeededEvent::createForBindings):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl.
+        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp.
+        (WebCore::WebKitMediaKeySession::create):
+        (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
+        (WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
+        (WebCore::WebKitMediaKeySession::setError):
+        (WebCore::WebKitMediaKeySession::close):
+        (WebCore::WebKitMediaKeySession::cachedKeyForKeyId):
+        (WebCore::WebKitMediaKeySession::sessionId):
+        (WebCore::WebKitMediaKeySession::generateKeyRequest):
+        (WebCore::WebKitMediaKeySession::keyRequestTimerFired):
+        (WebCore::WebKitMediaKeySession::update):
+        (WebCore::WebKitMediaKeySession::addKeyTimerFired):
+        (WebCore::WebKitMediaKeySession::sendMessage):
+        (WebCore::WebKitMediaKeySession::sendError):
+        (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
+        (WebCore::WebKitMediaKeySession::hasPendingActivity):
+        (WebCore::WebKitMediaKeySession::stop):
+        (WebCore::WebKitMediaKeySession::activeDOMObjectName):
+        (WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.h.
+        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl.
+        * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp.
+        (WebCore::WebKitMediaKeys::create):
+        (WebCore::WebKitMediaKeys::WebKitMediaKeys):
+        (WebCore::WebKitMediaKeys::~WebKitMediaKeys):
+        (WebCore::WebKitMediaKeys::createSession):
+        (WebCore::WebKitMediaKeys::isTypeSupported):
+        (WebCore::WebKitMediaKeys::setMediaElement):
+        (WebCore::WebKitMediaKeys::cdmMediaPlayer):
+        (WebCore::WebKitMediaKeys::keyAdded):
+        (WebCore::WebKitMediaKeys::cachedKeyForKeyId):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
+        * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.idl.
+        * bindings/js/JSDictionary.cpp:
+        (WebCore::JSDictionary::convertValue):
+        * bindings/js/JSDictionary.h:
+        * dom/EventNames.in:
+        * dom/EventTargetFactory.in:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
+        (WebCore::HTMLMediaElement::setMediaKeys):
+        * html/HTMLMediaElement.h:
+        (WebCore::HTMLMediaElement::keys):
+        * html/HTMLMediaElement.idl:
+        * html/WebKitMediaKeyError.h: Renamed from Source/WebCore/html/MediaKeyError.h.
+        (WebCore::WebKitMediaKeyError::create):
+        (WebCore::WebKitMediaKeyError::WebKitMediaKeyError):
+        * html/WebKitMediaKeyError.idl: Renamed from Source/WebCore/html/MediaKeyError.idl.
+        * testing/MockCDM.cpp:
+        (WebCore::MockCDMSession::generateKeyRequest):
+        (WebCore::MockCDMSession::update):
+
+2016-10-09  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
+
</ins><span class="cx">         Remove stale ENABLE(ENCRYPTED_MEDIA) code in HTMLMediaElement
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=163111
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -329,13 +329,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> #include &quot;JSMediaError.cpp&quot;
</span><span class="cx"> #include &quot;JSMediaList.cpp&quot;
</span><del>-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-#include &quot;JSMediaKeyError.cpp&quot;
-#include &quot;JSMediaKeyMessageEvent.cpp&quot;
-#include &quot;JSMediaKeyNeededEvent.cpp&quot;
-#include &quot;JSMediaKeySession.cpp&quot;
-#include &quot;JSMediaKeys.cpp&quot;
-#endif
</del><span class="cx"> #include &quot;JSMediaQueryList.cpp&quot;
</span><span class="cx"> #include &quot;JSMediaQueryListListener.cpp&quot;
</span><span class="cx"> #include &quot;JSMediaRemoteControls.cpp&quot;
</span><span class="lines">@@ -649,6 +642,13 @@
</span><span class="cx"> #include &quot;JSWebKitCSSMatrix.cpp&quot;
</span><span class="cx"> #include &quot;JSWebKitCSSRegionRule.cpp&quot;
</span><span class="cx"> #include &quot;JSWebKitCSSViewportRule.cpp&quot;
</span><ins>+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+#include &quot;JSWebKitMediaKeyError.cpp&quot;
+#include &quot;JSWebKitMediaKeyMessageEvent.cpp&quot;
+#include &quot;JSWebKitMediaKeyNeededEvent.cpp&quot;
+#include &quot;JSWebKitMediaKeySession.cpp&quot;
+#include &quot;JSWebKitMediaKeys.cpp&quot;
+#endif
</ins><span class="cx"> #include &quot;JSWebKitNamedFlow.cpp&quot;
</span><span class="cx"> #include &quot;JSWebKitPlaybackTargetAvailabilityEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSWebKitPoint.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/DerivedSources.make        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx">     $(WebCore) \
</span><span class="cx">     $(WebCore)/Modules/airplay \
</span><span class="cx">     $(WebCore)/Modules/applepay \
</span><del>-    $(WebCore)/Modules/encryptedmedia \
</del><ins>+    $(WebCore)/Modules/encryptedmedia/legacy \
</ins><span class="cx">     $(WebCore)/Modules/fetch \
</span><span class="cx">     $(WebCore)/Modules/gamepad \
</span><span class="cx">     $(WebCore)/Modules/geolocation \
</span><span class="lines">@@ -82,10 +82,10 @@
</span><span class="cx">     $(WebCore)/Modules/applepay/ApplePayShippingContactSelectedEvent.idl \
</span><span class="cx">     $(WebCore)/Modules/applepay/ApplePayShippingMethodSelectedEvent.idl \
</span><span class="cx">     $(WebCore)/Modules/applepay/ApplePayValidateMerchantEvent.idl \
</span><del>-    $(WebCore)/Modules/encryptedmedia/MediaKeyMessageEvent.idl \
-    $(WebCore)/Modules/encryptedmedia/MediaKeyNeededEvent.idl \
-    $(WebCore)/Modules/encryptedmedia/MediaKeySession.idl \
-    $(WebCore)/Modules/encryptedmedia/MediaKeys.idl \
</del><ins>+    $(WebCore)/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl \
+    $(WebCore)/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl \
+    $(WebCore)/Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl \
+    $(WebCore)/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl \
</ins><span class="cx">     $(WebCore)/Modules/fetch/DOMWindowFetch.idl \
</span><span class="cx">     $(WebCore)/Modules/fetch/FetchBody.idl \
</span><span class="cx">     $(WebCore)/Modules/fetch/FetchHeaders.idl \
</span><span class="lines">@@ -447,7 +447,6 @@
</span><span class="cx">     $(WebCore)/html/ImageData.idl \
</span><span class="cx">     $(WebCore)/html/MediaController.idl \
</span><span class="cx">     $(WebCore)/html/MediaError.idl \
</span><del>-    $(WebCore)/html/MediaKeyError.idl \
</del><span class="cx">     $(WebCore)/html/RadioNodeList.idl \
</span><span class="cx">     $(WebCore)/html/TextMetrics.idl \
</span><span class="cx">     $(WebCore)/html/TimeRanges.idl \
</span><span class="lines">@@ -455,6 +454,7 @@
</span><span class="cx">     $(WebCore)/html/URLUtils.idl \
</span><span class="cx">     $(WebCore)/html/ValidityState.idl \
</span><span class="cx">     $(WebCore)/html/VoidCallback.idl \
</span><ins>+    $(WebCore)/html/WebKitMediaKeyError.idl \
</ins><span class="cx">     $(WebCore)/html/canvas/ANGLEInstancedArrays.idl \
</span><span class="cx">     $(WebCore)/html/canvas/CanvasGradient.idl \
</span><span class="cx">     $(WebCore)/html/canvas/CanvasPath.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -32,9 +32,8 @@
</span><span class="cx"> #include &quot;CDMPrivateClearKey.h&quot;
</span><span class="cx"> #include &quot;CDMPrivateMediaPlayer.h&quot;
</span><span class="cx"> #include &quot;CDMSession.h&quot;
</span><del>-#include &quot;MediaKeyError.h&quot;
-#include &quot;MediaKeys.h&quot;
</del><span class="cx"> #include &quot;MediaPlayer.h&quot;
</span><ins>+#include &quot;WebKitMediaKeys.h&quot;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -34,9 +34,9 @@
</span><span class="cx"> #include &quot;Dictionary.h&quot;
</span><span class="cx"> #include &quot;JSMainThreadExecState.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><del>-#include &quot;MediaKeyError.h&quot;
</del><span class="cx"> #include &quot;TextEncoding.h&quot;
</span><span class="cx"> #include &quot;UUID.h&quot;
</span><ins>+#include &quot;WebKitMediaKeyError.h&quot;
</ins><span class="cx"> #include &lt;runtime/JSGlobalObject.h&gt;
</span><span class="cx"> #include &lt;runtime/JSLock.h&gt;
</span><span class="cx"> #include &lt;runtime/JSONObject.h&gt;
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     UNUSED_PARAM(systemCode);
</span><span class="cx"> 
</span><span class="cx">     if (!initData) {
</span><del>-        errorCode = MediaKeyError::MEDIA_KEYERR_CLIENT;
</del><ins>+        errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx">     m_initData = initData;
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx">     bool sawError = false;
</span><span class="cx">     String keyID = UTF8Encoding().decode(reinterpret_cast_ptr&lt;char*&gt;(m_initData-&gt;baseAddress()), m_initData-&gt;byteLength(), true, sawError);
</span><span class="cx">     if (sawError) {
</span><del>-        errorCode = MediaKeyError::MEDIA_KEYERR_CLIENT;
</del><ins>+        errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> 
</span><span class="cx">     } while (false);
</span><span class="cx"> 
</span><del>-    errorCode = MediaKeyError::MEDIA_KEYERR_CLIENT;
</del><ins>+    errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include &quot;config.h&quot;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;MediaKeyMessageEvent.h&quot;
-
-#include &quot;EventNames.h&quot;
-#include &lt;runtime/Uint8Array.h&gt;
-
-namespace WebCore {
-
-MediaKeyMessageEvent::MediaKeyMessageEvent(const AtomicString&amp; type, Uint8Array* message, const String&amp; destinationURL)
-    : Event(type, false, false)
-    , m_message(message)
-    , m_destinationURL(destinationURL)
-{
-}
-
-
-MediaKeyMessageEvent::MediaKeyMessageEvent(const AtomicString&amp; type, const MediaKeyMessageEventInit&amp; initializer)
-    : Event(type, initializer)
-    , m_message(initializer.message)
-    , m_destinationURL(initializer.destinationURL)
-{
-}
-
-MediaKeyMessageEvent::~MediaKeyMessageEvent()
-{
-}
-
-EventInterface MediaKeyMessageEvent::eventInterface() const
-{
-    return MediaKeyMessageEventInterfaceType;
-}
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,72 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc.  All rights reserved.
- * Copyright (C) 2013 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef MediaKeyMessageEvent_h
-#define MediaKeyMessageEvent_h
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;Event.h&quot;
-#include &quot;MediaKeyError.h&quot;
-
-namespace WebCore {
-
-struct MediaKeyMessageEventInit : public EventInit {
-    RefPtr&lt;Uint8Array&gt; message;
-    String destinationURL;
-};
-
-class MediaKeyMessageEvent : public Event {
-public:
-    virtual ~MediaKeyMessageEvent();
-
-    static Ref&lt;MediaKeyMessageEvent&gt; create(const AtomicString&amp; type, Uint8Array* message, const String&amp; destinationURL)
-    {
-        return adoptRef(*new MediaKeyMessageEvent(type, message, destinationURL));
-    }
-
-    static Ref&lt;MediaKeyMessageEvent&gt; createForBindings(const AtomicString&amp; type, const MediaKeyMessageEventInit&amp; initializer)
-    {
-        return adoptRef(*new MediaKeyMessageEvent(type, initializer));
-    }
-
-    EventInterface eventInterface() const override;
-
-    Uint8Array* message() const { return m_message.get(); }
-    String destinationURL() const { return m_destinationURL; }
-
-private:
-    MediaKeyMessageEvent(const AtomicString&amp; type, Uint8Array* message, const String&amp; destinationURL);
-    MediaKeyMessageEvent(const AtomicString&amp; type, const MediaKeyMessageEventInit&amp; initializer);
-
-    RefPtr&lt;Uint8Array&gt; m_message;
-    String m_destinationURL;
-};
-
-} // namespace WebCore
-
-#endif
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-[
-    Conditional=LEGACY_ENCRYPTED_MEDIA,
-    ConstructorTemplate=Event,
-    InterfaceName=WebKitMediaKeyMessageEvent
-] interface MediaKeyMessageEvent : Event {
-    readonly attribute Uint8Array message;
-    [InitializedByEventConstructor] readonly attribute DOMString destinationURL;
-};
-
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyNeededEventcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,60 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include &quot;config.h&quot;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;MediaKeyNeededEvent.h&quot;
-
-#include &quot;EventNames.h&quot;
-#include &lt;runtime/Uint8Array.h&gt;
-
-namespace WebCore {
-
-MediaKeyNeededEvent::MediaKeyNeededEvent(const AtomicString&amp; type, Uint8Array* initData)
-    : Event(type, false, false)
-    , m_initData(initData)
-{
-}
-
-MediaKeyNeededEvent::MediaKeyNeededEvent(const AtomicString&amp; type, const MediaKeyNeededEventInit&amp; initializer)
-    : Event(type, initializer)
-    , m_initData(initializer.initData)
-{
-}
-
-MediaKeyNeededEvent::~MediaKeyNeededEvent()
-{
-}
-
-EventInterface MediaKeyNeededEvent::eventInterface() const
-{
-    return MediaKeyNeededEventInterfaceType;
-}
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyNeededEventh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,68 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef MediaKeyNeededEvent_h
-#define MediaKeyNeededEvent_h
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;Event.h&quot;
-#include &quot;MediaKeyError.h&quot;
-
-namespace WebCore {
-
-struct MediaKeyNeededEventInit : public EventInit {
-    RefPtr&lt;Uint8Array&gt; initData;
-};
-
-class MediaKeyNeededEvent : public Event {
-public:
-    virtual ~MediaKeyNeededEvent();
-
-    static Ref&lt;MediaKeyNeededEvent&gt; create(const AtomicString&amp; type, Uint8Array* initData)
-    {
-        return adoptRef(*new MediaKeyNeededEvent(type, initData));
-    }
-
-    static Ref&lt;MediaKeyNeededEvent&gt; createForBindings(const AtomicString&amp; type, const MediaKeyNeededEventInit&amp; initializer)
-    {
-        return adoptRef(*new MediaKeyNeededEvent(type, initializer));
-    }
-
-    EventInterface eventInterface() const override;
-
-    Uint8Array* initData() const { return m_initData.get(); }
-
-private:
-    MediaKeyNeededEvent(const AtomicString&amp; type, Uint8Array* initData);
-    MediaKeyNeededEvent(const AtomicString&amp; type, const MediaKeyNeededEventInit&amp; initializer);
-
-    RefPtr&lt;Uint8Array&gt; m_initData;
-};
-
-} // namespace WebCore
-
-#endif
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyNeededEventidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-[
-    Conditional=LEGACY_ENCRYPTED_MEDIA,
-    ConstructorTemplate=Event 
-] interface MediaKeyNeededEvent : Event {
-    readonly attribute Uint8Array initData;
-};
-
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeySessioncpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,273 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;MediaKeySession.h&quot;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDM.h&quot;
-#include &quot;CDMSession.h&quot;
-#include &quot;Document.h&quot;
-#include &quot;Event.h&quot;
-#include &quot;EventNames.h&quot;
-#include &quot;FileSystem.h&quot;
-#include &quot;GenericEventQueue.h&quot;
-#include &quot;MediaKeyError.h&quot;
-#include &quot;MediaKeyMessageEvent.h&quot;
-#include &quot;MediaKeys.h&quot;
-#include &quot;Settings.h&quot;
-
-namespace WebCore {
-
-Ref&lt;MediaKeySession&gt; MediaKeySession::create(ScriptExecutionContext&amp; context, MediaKeys* keys, const String&amp; keySystem)
-{
-    auto session = adoptRef(*new MediaKeySession(context, keys, keySystem));
-    session-&gt;suspendIfNeeded();
-    return session;
-}
-
-MediaKeySession::MediaKeySession(ScriptExecutionContext&amp; context, MediaKeys* keys, const String&amp; keySystem)
-    : ActiveDOMObject(&amp;context)
-    , m_keys(keys)
-    , m_keySystem(keySystem)
-    , m_asyncEventQueue(*this)
-    , m_session(keys-&gt;cdm()-&gt;createSession(this))
-    , m_keyRequestTimer(*this, &amp;MediaKeySession::keyRequestTimerFired)
-    , m_addKeyTimer(*this, &amp;MediaKeySession::addKeyTimerFired)
-{
-}
-
-MediaKeySession::~MediaKeySession()
-{
-    if (m_session) {
-        m_session-&gt;setClient(nullptr);
-        m_session = nullptr;
-    }
-
-    m_asyncEventQueue.cancelAllEvents();
-}
-
-void MediaKeySession::setError(MediaKeyError* error)
-{
-    m_error = error;
-}
-
-void MediaKeySession::close()
-{
-    if (m_session)
-        m_session-&gt;releaseKeys();
-}
-
-RefPtr&lt;ArrayBuffer&gt; MediaKeySession::cachedKeyForKeyId(const String&amp; keyId) const
-{
-    return m_session ? m_session-&gt;cachedKeyForKeyID(keyId) : nullptr;
-}
-
-const String&amp; MediaKeySession::sessionId() const
-{
-    return m_session-&gt;sessionId();
-}
-
-void MediaKeySession::generateKeyRequest(const String&amp; mimeType, Ref&lt;Uint8Array&gt;&amp;&amp; initData)
-{
-    m_pendingKeyRequests.append({ mimeType, WTFMove(initData) });
-    m_keyRequestTimer.startOneShot(0);
-}
-
-void MediaKeySession::keyRequestTimerFired()
-{
-    ASSERT(m_pendingKeyRequests.size());
-    if (!m_session)
-        return;
-
-    while (!m_pendingKeyRequests.isEmpty()) {
-        PendingKeyRequest request = m_pendingKeyRequests.takeFirst();
-
-        // NOTE: Continued from step 5 in MediaKeys::createSession().
-        // The user agent will asynchronously execute the following steps in the task:
-
-        // 1. Let cdm be the cdm loaded in the MediaKeys constructor.
-        // 2. Let destinationURL be null.
-        String destinationURL;
-        MediaKeyError::Code errorCode = 0;
-        uint32_t systemCode = 0;
-
-        // 3. Use cdm to generate a key request and follow the steps for the first matching condition from the following list:
-
-        RefPtr&lt;Uint8Array&gt; keyRequest = m_session-&gt;generateKeyRequest(request.mimeType, request.initData.ptr(), destinationURL, errorCode, systemCode);
-
-        // Otherwise [if a request is not successfully generated]:
-        if (errorCode) {
-            // 3.1. Create a new MediaKeyError object with the following attributes:
-            //      code = the appropriate MediaKeyError code
-            //      systemCode = a Key System-specific value, if provided, and 0 otherwise
-            // 3.2. Set the MediaKeySession object's error attribute to the error object created in the previous step.
-            // 3.3. queue a task to fire a simple event named keyerror at the MediaKeySession object.
-            sendError(errorCode, systemCode);
-            // 3.4. Abort the task.
-            continue;
-        }
-
-        // 4. queue a task to fire a simple event named keymessage at the new object
-        //    The event is of type MediaKeyMessageEvent and has:
-        //    message = key request
-        //    destinationURL = destinationURL
-        if (keyRequest)
-            sendMessage(keyRequest.get(), destinationURL);
-    }
-}
-
-void MediaKeySession::update(Ref&lt;Uint8Array&gt;&amp;&amp; key, ExceptionCode&amp; ec)
-{
-    // From &lt;http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-addkey&gt;:
-    // The addKey(key) method must run the following steps:
-    // 1. If the first or second argument [sic] is an empty array, throw an INVALID_ACCESS_ERR.
-    // NOTE: the reference to a &quot;second argument&quot; is a spec bug.
-    if (!key-&gt;length()) {
-        ec = INVALID_ACCESS_ERR;
-        return;
-    }
-
-    // 2. Schedule a task to handle the call, providing key.
-    m_pendingKeys.append(WTFMove(key));
-    m_addKeyTimer.startOneShot(0);
-}
-
-void MediaKeySession::addKeyTimerFired()
-{
-    ASSERT(m_pendingKeys.size());
-    if (!m_session)
-        return;
-
-    while (!m_pendingKeys.isEmpty()) {
-        auto pendingKey = m_pendingKeys.takeFirst();
-        unsigned short errorCode = 0;
-        uint32_t systemCode = 0;
-
-        // NOTE: Continued from step 2. of MediaKeySession::update()
-        // 2.1. Let cdm be the cdm loaded in the MediaKeys constructor.
-        // NOTE: This is m_session.
-        // 2.2. Let 'did store key' be false.
-        bool didStoreKey = false;
-        // 2.3. Let 'next message' be null.
-        RefPtr&lt;Uint8Array&gt; nextMessage;
-        // 2.4. Use cdm to handle key.
-        didStoreKey = m_session-&gt;update(pendingKey.ptr(), nextMessage, errorCode, systemCode);
-        // 2.5. If did store key is true and the media element is waiting for a key, queue a task to attempt to resume playback.
-        // TODO: Find and restart the media element
-
-        // 2.6. If next message is not null, queue a task to fire a simple event named keymessage at the MediaKeySession object.
-        //      The event is of type MediaKeyMessageEvent and has:
-        //      message = next message
-        //      destinationURL = null
-        if (nextMessage)
-            sendMessage(nextMessage.get(), emptyString());
-
-        // 2.7. If did store key is true, queue a task to fire a simple event named keyadded at the MediaKeySession object.
-        if (didStoreKey) {
-            auto keyaddedEvent = Event::create(eventNames().webkitkeyaddedEvent, false, false);
-            keyaddedEvent-&gt;setTarget(this);
-            m_asyncEventQueue.enqueueEvent(WTFMove(keyaddedEvent));
-
-            keys()-&gt;keyAdded();
-        }
-
-        // 2.8. If any of the preceding steps in the task failed
-        if (errorCode) {
-            // 2.8.1. Create a new MediaKeyError object with the following attributes:
-            //        code = the appropriate MediaKeyError code
-            //        systemCode = a Key System-specific value, if provided, and 0 otherwise
-            // 2.8.2. Set the MediaKeySession object's error attribute to the error object created in the previous step.
-            // 2.8.3. queue a task to fire a simple event named keyerror at the MediaKeySession object.
-            sendError(errorCode, systemCode);
-            // 2.8.4. Abort the task.
-            // NOTE: no-op
-        }
-    }
-}
-
-void MediaKeySession::sendMessage(Uint8Array* message, String destinationURL)
-{
-    auto event = MediaKeyMessageEvent::create(eventNames().webkitkeymessageEvent, message, destinationURL);
-    event-&gt;setTarget(this);
-    m_asyncEventQueue.enqueueEvent(WTFMove(event));
-}
-
-void MediaKeySession::sendError(CDMSessionClient::MediaKeyErrorCode errorCode, uint32_t systemCode)
-{
-    Ref&lt;MediaKeyError&gt; error = MediaKeyError::create(errorCode, systemCode).get();
-    setError(error.ptr());
-
-    auto keyerrorEvent = Event::create(eventNames().webkitkeyerrorEvent, false, false);
-    keyerrorEvent-&gt;setTarget(this);
-    m_asyncEventQueue.enqueueEvent(WTFMove(keyerrorEvent));
-}
-
-String MediaKeySession::mediaKeysStorageDirectory() const
-{
-    Document* document = downcast&lt;Document&gt;(scriptExecutionContext());
-    if (!document)
-        return emptyString();
-
-    Settings* settings = document-&gt;settings();
-    if (!settings)
-        return emptyString();
-
-    String storageDirectory = settings-&gt;mediaKeysStorageDirectory();
-    if (storageDirectory.isEmpty())
-        return emptyString();
-
-    SecurityOrigin* origin = document-&gt;securityOrigin();
-    if (!origin)
-        return emptyString();
-
-    return pathByAppendingComponent(storageDirectory, origin-&gt;databaseIdentifier());
-}
-
-bool MediaKeySession::hasPendingActivity() const
-{
-    return (m_keys &amp;&amp; !isClosed()) || m_asyncEventQueue.hasPendingEvents();
-}
-
-void MediaKeySession::stop()
-{
-    close();
-}
-
-const char* MediaKeySession::activeDOMObjectName() const
-{
-    return &quot;MediaKeySession&quot;;
-}
-
-bool MediaKeySession::canSuspendForDocumentSuspension() const
-{
-    // FIXME: We should try and do better here.
-    return false;
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeySessionh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,122 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MediaKeySession_h
-#define MediaKeySession_h
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;ActiveDOMObject.h&quot;
-#include &quot;CDMSession.h&quot;
-#include &quot;EventTarget.h&quot;
-#include &quot;ExceptionCode.h&quot;
-#include &quot;GenericEventQueue.h&quot;
-#include &quot;Timer.h&quot;
-#include &lt;runtime/Uint8Array.h&gt;
-#include &lt;wtf/Deque.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-class MediaKeyError;
-class MediaKeys;
-
-class MediaKeySession final : public RefCounted&lt;MediaKeySession&gt;, public EventTargetWithInlineData, public ActiveDOMObject, public CDMSessionClient {
-public:
-    static Ref&lt;MediaKeySession&gt; create(ScriptExecutionContext&amp;, MediaKeys*, const String&amp; keySystem);
-    ~MediaKeySession();
-
-    const String&amp; keySystem() const { return m_keySystem; }
-    CDMSession* session() { return m_session.get(); }
-    const String&amp; sessionId() const;
-
-    void setError(MediaKeyError*);
-    MediaKeyError* error() { return m_error.get(); }
-
-    void setKeys(MediaKeys* keys) { m_keys = keys; }
-    MediaKeys* keys() const { return m_keys; }
-
-    void generateKeyRequest(const String&amp; mimeType, Ref&lt;Uint8Array&gt;&amp;&amp; initData);
-    void update(Ref&lt;Uint8Array&gt;&amp;&amp; key, ExceptionCode&amp;);
-
-    bool isClosed() const { return !m_session; }
-    void close();
-
-    RefPtr&lt;ArrayBuffer&gt; cachedKeyForKeyId(const String&amp; keyId) const;
-
-    using RefCounted&lt;MediaKeySession&gt;::ref;
-    using RefCounted&lt;MediaKeySession&gt;::deref;
-
-    void enqueueEvent(RefPtr&lt;Event&gt;&amp;&amp;);
-
-    EventTargetInterface eventTargetInterface() const override { return MediaKeySessionEventTargetInterfaceType; }
-    ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
-
-    // ActiveDOMObject API.
-    bool hasPendingActivity() const override;
-
-protected:
-    MediaKeySession(ScriptExecutionContext&amp;, MediaKeys*, const String&amp; keySystem);
-    void keyRequestTimerFired();
-    void addKeyTimerFired();
-
-    // CDMSessionClient
-    void sendMessage(Uint8Array*, String destinationURL) override;
-    void sendError(MediaKeyErrorCode, uint32_t systemCode) override;
-    String mediaKeysStorageDirectory() const override;
-
-    MediaKeys* m_keys;
-    String m_keySystem;
-    String m_sessionId;
-    RefPtr&lt;MediaKeyError&gt; m_error;
-    GenericEventQueue m_asyncEventQueue;
-    std::unique_ptr&lt;CDMSession&gt; m_session;
-
-    struct PendingKeyRequest {
-        String mimeType;
-        Ref&lt;Uint8Array&gt; initData;
-    };
-    Deque&lt;PendingKeyRequest&gt; m_pendingKeyRequests;
-    Timer m_keyRequestTimer;
-
-    Deque&lt;Ref&lt;Uint8Array&gt;&gt; m_pendingKeys;
-    Timer m_addKeyTimer;
-
-private:
-    void refEventTarget() override { ref(); }
-    void derefEventTarget() override { deref(); }
-
-    // ActiveDOMObject API.
-    void stop() override;
-    bool canSuspendForDocumentSuspension() const override;
-    const char* activeDOMObjectName() const override;
-};
-
-}
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#endif // MediaKeySession_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeySessionidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,45 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
-     */
-
-[
-    Conditional=LEGACY_ENCRYPTED_MEDIA,
-    InterfaceName=WebKitMediaKeySession,
-    ActiveDOMObject,
-] interface MediaKeySession : EventTarget {
-    // error state
-    readonly attribute MediaKeyError error;
-
-    // session properties
-    readonly attribute DOMString keySystem;
-    readonly attribute DOMString sessionId;
-
-    // session operations
-    [MayThrowLegacyException] void update(Uint8Array key);
-    void close();
-    
-    attribute EventHandler onwebkitkeyadded;
-    attribute EventHandler onwebkitkeyerror;
-    attribute EventHandler onwebkitkeymessage;
-};
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyscpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,180 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;MediaKeys.h&quot;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDM.h&quot;
-#include &quot;EventNames.h&quot;
-#include &quot;HTMLMediaElement.h&quot;
-#include &quot;MediaKeyMessageEvent.h&quot;
-#include &quot;MediaKeySession.h&quot;
-#include &quot;UUID.h&quot;
-
-namespace WebCore {
-
-RefPtr&lt;MediaKeys&gt; MediaKeys::create(const String&amp; keySystem, ExceptionCode&amp; ec)
-{
-    // From &lt;http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-media-keys-constructor&gt;:
-    // The MediaKeys(keySystem) constructor must run the following steps:
-
-    // 1. If keySystem is null or an empty string, throw an INVALID_ACCESS_ERR exception and abort these steps.
-    if (keySystem.isNull() || keySystem.isEmpty()) {
-        ec = INVALID_ACCESS_ERR;
-        return nullptr;
-    }
-
-    // 2. If keySystem is not one of the user agent's supported Key Systems, throw a NOT_SUPPORTED_ERR and abort these steps.
-    if (!CDM::supportsKeySystem(keySystem)) {
-        ec = NOT_SUPPORTED_ERR;
-        return nullptr;
-    }
-
-    // 3. Let cdm be the content decryption module corresponding to keySystem.
-    // 4. Load cdm if necessary.
-    std::unique_ptr&lt;CDM&gt; cdm = CDM::create(keySystem);
-
-    // 5. Create a new MediaKeys object.
-    // 5.1 Let the keySystem attribute be keySystem.
-    // 6. Return the new object to the caller.
-    return adoptRef(*new MediaKeys(keySystem, WTFMove(cdm)));
-}
-
-MediaKeys::MediaKeys(const String&amp; keySystem, std::unique_ptr&lt;CDM&gt; cdm)
-    : m_mediaElement(nullptr)
-    , m_keySystem(keySystem)
-    , m_cdm(WTFMove(cdm))
-{
-    m_cdm-&gt;setClient(this);
-}
-
-MediaKeys::~MediaKeys()
-{
-    // From &lt;http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-media-keys-constructor&gt;:
-    // When destroying a MediaKeys object, follow the steps in close().
-    for (auto&amp; session : m_sessions) {
-        session-&gt;close();
-        session-&gt;setKeys(nullptr);
-    }
-}
-
-RefPtr&lt;MediaKeySession&gt; MediaKeys::createSession(ScriptExecutionContext&amp; context, const String&amp; type, Ref&lt;Uint8Array&gt;&amp;&amp; initData, ExceptionCode&amp; ec)
-{
-    // From &lt;http://www.w3.org/TR/2014/WD-encrypted-media-20140218/#dom-createsession&gt;:
-    // The createSession(type, initData) method must run the following steps:
-    // Note: The contents of initData are container-specific Initialization Data.
-
-    // 1. If contentType is null or an empty string, throw an INVALID_ACCESS_ERR exception and abort these steps.
-    if (type.isEmpty()) {
-        ec = INVALID_ACCESS_ERR;
-        return nullptr;
-    }
-
-    // 2. If initData is an empty array, throw an INVALID_ACCESS_ERR exception and abort these steps.
-    if (!initData-&gt;length()) {
-        ec = INVALID_ACCESS_ERR;
-        return nullptr;
-    }
-
-    // 3. If type contains a MIME type that is not supported or is not supported by the keySystem, throw
-    // a NOT_SUPPORTED_ERR exception and abort these steps.
-    if (!type.isNull() &amp;&amp; !type.isEmpty() &amp;&amp; !m_cdm-&gt;supportsMIMEType(type)) {
-        ec = NOT_SUPPORTED_ERR;
-        return nullptr;
-    }
-
-    // 4. Create a new MediaKeySession object.
-    // 4.1 Let the keySystem attribute be keySystem.
-    // 4.2 Let the sessionId attribute be a unique Session ID string. It may be generated by cdm.
-    auto session = MediaKeySession::create(context, this, keySystem());
-
-    m_sessions.append(session.copyRef());
-
-    // 5. Schedule a task to initialize the session, providing contentType, initData, and the new object.
-    session-&gt;generateKeyRequest(type, WTFMove(initData));
-
-    // 6. Return the new object to the caller.
-    return WTFMove(session);
-}
-
-bool MediaKeys::isTypeSupported(const String&amp; keySystem, const String&amp; mimeType)
-{
-    // 1. If keySystem contains an unrecognized or unsupported Key System, return false and abort these steps.
-    // Key system string comparison is case-sensitive.
-    if (keySystem.isNull() || keySystem.isEmpty() || !CDM::supportsKeySystem(keySystem))
-        return false;
-
-    // 2. If type is null or an empty string, return true and abort these steps.
-    if (mimeType.isNull() || mimeType.isEmpty())
-        return true;
-
-    // 3. If the Key System specified by keySystem does not support decrypting the container and/or codec
-    // specified by type, return false and abort these steps.
-    if (!CDM::keySystemSupportsMimeType(keySystem, mimeType))
-        return false;
-
-    // 4. Return true;
-    return true;
-}
-
-void MediaKeys::setMediaElement(HTMLMediaElement* element)
-{
-    if (m_mediaElement &amp;&amp; m_mediaElement-&gt;player())
-        m_mediaElement-&gt;player()-&gt;setCDMSession(nullptr);
-
-    m_mediaElement = element;
-
-    if (m_mediaElement &amp;&amp; m_mediaElement-&gt;player() &amp;&amp; !m_sessions.isEmpty())
-        m_mediaElement-&gt;player()-&gt;setCDMSession(m_sessions.last()-&gt;session());
-}
-
-MediaPlayer* MediaKeys::cdmMediaPlayer(const CDM*) const
-{
-    if (m_mediaElement)
-        return m_mediaElement-&gt;player();
-    return 0;
-}
-
-void MediaKeys::keyAdded()
-{
-    if (m_mediaElement)
-        m_mediaElement-&gt;keyAdded();
-
-}
-
-RefPtr&lt;ArrayBuffer&gt; MediaKeys::cachedKeyForKeyId(const String&amp; keyId) const
-{
-    for (auto&amp; session : m_sessions) {
-        if (RefPtr&lt;ArrayBuffer&gt; key = session-&gt;cachedKeyForKeyId(keyId))
-            return key;
-    }
-    return nullptr;
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeysh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,79 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MediaKeys_h
-#define MediaKeys_h
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDM.h&quot;
-#include &quot;EventTarget.h&quot;
-#include &quot;ExceptionCode.h&quot;
-#include &lt;runtime/Uint8Array.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/Vector.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-class MediaKeySession;
-class HTMLMediaElement;
-
-class MediaKeys : public RefCounted&lt;MediaKeys&gt;, public CDMClient {
-public:
-    static RefPtr&lt;MediaKeys&gt; create(const String&amp; keySystem, ExceptionCode&amp;);
-    virtual ~MediaKeys();
-
-    RefPtr&lt;MediaKeySession&gt; createSession(ScriptExecutionContext&amp;, const String&amp; mimeType, Ref&lt;Uint8Array&gt;&amp;&amp; initData, ExceptionCode&amp;);
-
-    static bool isTypeSupported(const String&amp; keySystem, const String&amp; mimeType);
-
-    const String&amp; keySystem() const { return m_keySystem; }
-    CDM* cdm() { return m_cdm.get(); }
-
-    HTMLMediaElement* mediaElement() const { return m_mediaElement; }
-    void setMediaElement(HTMLMediaElement*);
-
-    void keyAdded();
-    RefPtr&lt;ArrayBuffer&gt; cachedKeyForKeyId(const String&amp; keyId) const;
-
-protected:
-    // CDMClient:
-    MediaPlayer* cdmMediaPlayer(const CDM*) const override;
-
-    MediaKeys(const String&amp; keySystem, std::unique_ptr&lt;CDM&gt;);
-
-    Vector&lt;Ref&lt;MediaKeySession&gt;&gt; m_sessions;
-
-    HTMLMediaElement* m_mediaElement;
-    String m_keySystem;
-    std::unique_ptr&lt;CDM&gt; m_cdm;
-};
-
-}
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#endif // MediaKeys_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeysidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.idl (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.idl        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,35 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */

-[
-    Conditional=LEGACY_ENCRYPTED_MEDIA,
-    Constructor(DOMString keySystem),
-    ConstructorMayThrowLegacyException,
-    InterfaceName=WebKitMediaKeys,
-] interface MediaKeys {
-    [CallWith=ScriptExecutionContext, MayThrowLegacyException] MediaKeySession createSession(DOMString type, Uint8Array initData);
-    static boolean isTypeSupported(DOMString keySystem, optional DOMString type);
-    readonly attribute DOMString keySystem;
-};
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyMessageEventcppfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitMediaKeyMessageEvent.h&quot;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;EventNames.h&quot;
+#include &lt;runtime/Uint8Array.h&gt;
+
+namespace WebCore {
+
+WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent(const AtomicString&amp; type, Uint8Array* message, const String&amp; destinationURL)
+    : Event(type, false, false)
+    , m_message(message)
+    , m_destinationURL(destinationURL)
+{
+}
+
+
+WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent(const AtomicString&amp; type, const WebKitMediaKeyMessageEventInit&amp; initializer)
+    : Event(type, initializer)
+    , m_message(initializer.message)
+    , m_destinationURL(initializer.destinationURL)
+{
+}
+
+WebKitMediaKeyMessageEvent::~WebKitMediaKeyMessageEvent()
+{
+}
+
+EventInterface WebKitMediaKeyMessageEvent::eventInterface() const
+{
+    return WebKitMediaKeyMessageEventInterfaceType;
+}
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyMessageEventhfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc.  All rights reserved.
+ * Copyright (C) 2013 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WebKitMediaKeyMessageEvent_h
+#define WebKitMediaKeyMessageEvent_h
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;Event.h&quot;
+#include &quot;WebKitMediaKeyError.h&quot;
+
+namespace WebCore {
+
+struct WebKitMediaKeyMessageEventInit : public EventInit {
+    RefPtr&lt;Uint8Array&gt; message;
+    String destinationURL;
+};
+
+class WebKitMediaKeyMessageEvent : public Event {
+public:
+    virtual ~WebKitMediaKeyMessageEvent();
+
+    static Ref&lt;WebKitMediaKeyMessageEvent&gt; create(const AtomicString&amp; type, Uint8Array* message, const String&amp; destinationURL)
+    {
+        return adoptRef(*new WebKitMediaKeyMessageEvent(type, message, destinationURL));
+    }
+
+    static Ref&lt;WebKitMediaKeyMessageEvent&gt; createForBindings(const AtomicString&amp; type, const WebKitMediaKeyMessageEventInit&amp; initializer)
+    {
+        return adoptRef(*new WebKitMediaKeyMessageEvent(type, initializer));
+    }
+
+    EventInterface eventInterface() const override;
+
+    Uint8Array* message() const { return m_message.get(); }
+    String destinationURL() const { return m_destinationURL; }
+
+private:
+    WebKitMediaKeyMessageEvent(const AtomicString&amp; type, Uint8Array* message, const String&amp; destinationURL);
+    WebKitMediaKeyMessageEvent(const AtomicString&amp; type, const WebKitMediaKeyMessageEventInit&amp; initializer);
+
+    RefPtr&lt;Uint8Array&gt; m_message;
+    String m_destinationURL;
+};
+
+} // namespace WebCore
+
+#endif
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyMessageEventidlfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeyMessageEventidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+[
+    Conditional=LEGACY_ENCRYPTED_MEDIA,
+    ConstructorTemplate=Event,
+] interface WebKitMediaKeyMessageEvent : Event {
+    readonly attribute Uint8Array message;
+    [InitializedByEventConstructor] readonly attribute DOMString destinationURL;
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyNeededEventcppfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeyNeededEventcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitMediaKeyNeededEvent.h&quot;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;EventNames.h&quot;
+#include &lt;runtime/Uint8Array.h&gt;
+
+namespace WebCore {
+
+WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent(const AtomicString&amp; type, Uint8Array* initData)
+    : Event(type, false, false)
+    , m_initData(initData)
+{
+}
+
+WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent(const AtomicString&amp; type, const WebKitMediaKeyNeededEventInit&amp; initializer)
+    : Event(type, initializer)
+    , m_initData(initializer.initData)
+{
+}
+
+WebKitMediaKeyNeededEvent::~WebKitMediaKeyNeededEvent()
+{
+}
+
+EventInterface WebKitMediaKeyNeededEvent::eventInterface() const
+{
+    return WebKitMediaKeyNeededEventInterfaceType;
+}
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyNeededEventhfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeyNeededEventh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WebKitMediaKeyNeededEvent_h
+#define WebKitMediaKeyNeededEvent_h
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;Event.h&quot;
+#include &quot;WebKitMediaKeyError.h&quot;
+
+namespace WebCore {
+
+struct WebKitMediaKeyNeededEventInit : public EventInit {
+    RefPtr&lt;Uint8Array&gt; initData;
+};
+
+class WebKitMediaKeyNeededEvent : public Event {
+public:
+    virtual ~WebKitMediaKeyNeededEvent();
+
+    static Ref&lt;WebKitMediaKeyNeededEvent&gt; create(const AtomicString&amp; type, Uint8Array* initData)
+    {
+        return adoptRef(*new WebKitMediaKeyNeededEvent(type, initData));
+    }
+
+    static Ref&lt;WebKitMediaKeyNeededEvent&gt; createForBindings(const AtomicString&amp; type, const WebKitMediaKeyNeededEventInit&amp; initializer)
+    {
+        return adoptRef(*new WebKitMediaKeyNeededEvent(type, initializer));
+    }
+
+    EventInterface eventInterface() const override;
+
+    Uint8Array* initData() const { return m_initData.get(); }
+
+private:
+    WebKitMediaKeyNeededEvent(const AtomicString&amp; type, Uint8Array* initData);
+    WebKitMediaKeyNeededEvent(const AtomicString&amp; type, const WebKitMediaKeyNeededEventInit&amp; initializer);
+
+    RefPtr&lt;Uint8Array&gt; m_initData;
+};
+
+} // namespace WebCore
+
+#endif
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyNeededEventidlfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeyNeededEventidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+[
+    Conditional=LEGACY_ENCRYPTED_MEDIA,
+    ConstructorTemplate=Event 
+] interface WebKitMediaKeyNeededEvent : Event {
+    readonly attribute Uint8Array initData;
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessioncppfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeySessioncpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,273 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitMediaKeySession.h&quot;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;CDM.h&quot;
+#include &quot;CDMSession.h&quot;
+#include &quot;Document.h&quot;
+#include &quot;Event.h&quot;
+#include &quot;EventNames.h&quot;
+#include &quot;FileSystem.h&quot;
+#include &quot;GenericEventQueue.h&quot;
+#include &quot;Settings.h&quot;
+#include &quot;WebKitMediaKeyError.h&quot;
+#include &quot;WebKitMediaKeyMessageEvent.h&quot;
+#include &quot;WebKitMediaKeys.h&quot;
+
+namespace WebCore {
+
+Ref&lt;WebKitMediaKeySession&gt; WebKitMediaKeySession::create(ScriptExecutionContext&amp; context, WebKitMediaKeys* keys, const String&amp; keySystem)
+{
+    auto session = adoptRef(*new WebKitMediaKeySession(context, keys, keySystem));
+    session-&gt;suspendIfNeeded();
+    return session;
+}
+
+WebKitMediaKeySession::WebKitMediaKeySession(ScriptExecutionContext&amp; context, WebKitMediaKeys* keys, const String&amp; keySystem)
+    : ActiveDOMObject(&amp;context)
+    , m_keys(keys)
+    , m_keySystem(keySystem)
+    , m_asyncEventQueue(*this)
+    , m_session(keys-&gt;cdm()-&gt;createSession(this))
+    , m_keyRequestTimer(*this, &amp;WebKitMediaKeySession::keyRequestTimerFired)
+    , m_addKeyTimer(*this, &amp;WebKitMediaKeySession::addKeyTimerFired)
+{
+}
+
+WebKitMediaKeySession::~WebKitMediaKeySession()
+{
+    if (m_session) {
+        m_session-&gt;setClient(nullptr);
+        m_session = nullptr;
+    }
+
+    m_asyncEventQueue.cancelAllEvents();
+}
+
+void WebKitMediaKeySession::setError(WebKitMediaKeyError* error)
+{
+    m_error = error;
+}
+
+void WebKitMediaKeySession::close()
+{
+    if (m_session)
+        m_session-&gt;releaseKeys();
+}
+
+RefPtr&lt;ArrayBuffer&gt; WebKitMediaKeySession::cachedKeyForKeyId(const String&amp; keyId) const
+{
+    return m_session ? m_session-&gt;cachedKeyForKeyID(keyId) : nullptr;
+}
+
+const String&amp; WebKitMediaKeySession::sessionId() const
+{
+    return m_session-&gt;sessionId();
+}
+
+void WebKitMediaKeySession::generateKeyRequest(const String&amp; mimeType, Ref&lt;Uint8Array&gt;&amp;&amp; initData)
+{
+    m_pendingKeyRequests.append({ mimeType, WTFMove(initData) });
+    m_keyRequestTimer.startOneShot(0);
+}
+
+void WebKitMediaKeySession::keyRequestTimerFired()
+{
+    ASSERT(m_pendingKeyRequests.size());
+    if (!m_session)
+        return;
+
+    while (!m_pendingKeyRequests.isEmpty()) {
+        PendingKeyRequest request = m_pendingKeyRequests.takeFirst();
+
+        // NOTE: Continued from step 5 in MediaKeys::createSession().
+        // The user agent will asynchronously execute the following steps in the task:
+
+        // 1. Let cdm be the cdm loaded in the MediaKeys constructor.
+        // 2. Let destinationURL be null.
+        String destinationURL;
+        WebKitMediaKeyError::Code errorCode = 0;
+        uint32_t systemCode = 0;
+
+        // 3. Use cdm to generate a key request and follow the steps for the first matching condition from the following list:
+
+        RefPtr&lt;Uint8Array&gt; keyRequest = m_session-&gt;generateKeyRequest(request.mimeType, request.initData.ptr(), destinationURL, errorCode, systemCode);
+
+        // Otherwise [if a request is not successfully generated]:
+        if (errorCode) {
+            // 3.1. Create a new MediaKeyError object with the following attributes:
+            //      code = the appropriate MediaKeyError code
+            //      systemCode = a Key System-specific value, if provided, and 0 otherwise
+            // 3.2. Set the MediaKeySession object's error attribute to the error object created in the previous step.
+            // 3.3. queue a task to fire a simple event named keyerror at the MediaKeySession object.
+            sendError(errorCode, systemCode);
+            // 3.4. Abort the task.
+            continue;
+        }
+
+        // 4. queue a task to fire a simple event named keymessage at the new object
+        //    The event is of type MediaKeyMessageEvent and has:
+        //    message = key request
+        //    destinationURL = destinationURL
+        if (keyRequest)
+            sendMessage(keyRequest.get(), destinationURL);
+    }
+}
+
+void WebKitMediaKeySession::update(Ref&lt;Uint8Array&gt;&amp;&amp; key, ExceptionCode&amp; ec)
+{
+    // From &lt;http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-addkey&gt;:
+    // The addKey(key) method must run the following steps:
+    // 1. If the first or second argument [sic] is an empty array, throw an INVALID_ACCESS_ERR.
+    // NOTE: the reference to a &quot;second argument&quot; is a spec bug.
+    if (!key-&gt;length()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    // 2. Schedule a task to handle the call, providing key.
+    m_pendingKeys.append(WTFMove(key));
+    m_addKeyTimer.startOneShot(0);
+}
+
+void WebKitMediaKeySession::addKeyTimerFired()
+{
+    ASSERT(m_pendingKeys.size());
+    if (!m_session)
+        return;
+
+    while (!m_pendingKeys.isEmpty()) {
+        auto pendingKey = m_pendingKeys.takeFirst();
+        unsigned short errorCode = 0;
+        uint32_t systemCode = 0;
+
+        // NOTE: Continued from step 2. of MediaKeySession::update()
+        // 2.1. Let cdm be the cdm loaded in the MediaKeys constructor.
+        // NOTE: This is m_session.
+        // 2.2. Let 'did store key' be false.
+        bool didStoreKey = false;
+        // 2.3. Let 'next message' be null.
+        RefPtr&lt;Uint8Array&gt; nextMessage;
+        // 2.4. Use cdm to handle key.
+        didStoreKey = m_session-&gt;update(pendingKey.ptr(), nextMessage, errorCode, systemCode);
+        // 2.5. If did store key is true and the media element is waiting for a key, queue a task to attempt to resume playback.
+        // TODO: Find and restart the media element
+
+        // 2.6. If next message is not null, queue a task to fire a simple event named keymessage at the MediaKeySession object.
+        //      The event is of type MediaKeyMessageEvent and has:
+        //      message = next message
+        //      destinationURL = null
+        if (nextMessage)
+            sendMessage(nextMessage.get(), emptyString());
+
+        // 2.7. If did store key is true, queue a task to fire a simple event named keyadded at the MediaKeySession object.
+        if (didStoreKey) {
+            auto keyaddedEvent = Event::create(eventNames().webkitkeyaddedEvent, false, false);
+            keyaddedEvent-&gt;setTarget(this);
+            m_asyncEventQueue.enqueueEvent(WTFMove(keyaddedEvent));
+
+            keys()-&gt;keyAdded();
+        }
+
+        // 2.8. If any of the preceding steps in the task failed
+        if (errorCode) {
+            // 2.8.1. Create a new MediaKeyError object with the following attributes:
+            //        code = the appropriate MediaKeyError code
+            //        systemCode = a Key System-specific value, if provided, and 0 otherwise
+            // 2.8.2. Set the MediaKeySession object's error attribute to the error object created in the previous step.
+            // 2.8.3. queue a task to fire a simple event named keyerror at the MediaKeySession object.
+            sendError(errorCode, systemCode);
+            // 2.8.4. Abort the task.
+            // NOTE: no-op
+        }
+    }
+}
+
+void WebKitMediaKeySession::sendMessage(Uint8Array* message, String destinationURL)
+{
+    auto event = WebKitMediaKeyMessageEvent::create(eventNames().webkitkeymessageEvent, message, destinationURL);
+    event-&gt;setTarget(this);
+    m_asyncEventQueue.enqueueEvent(WTFMove(event));
+}
+
+void WebKitMediaKeySession::sendError(CDMSessionClient::MediaKeyErrorCode errorCode, uint32_t systemCode)
+{
+    Ref&lt;WebKitMediaKeyError&gt; error = WebKitMediaKeyError::create(errorCode, systemCode).get();
+    setError(error.ptr());
+
+    auto keyerrorEvent = Event::create(eventNames().webkitkeyerrorEvent, false, false);
+    keyerrorEvent-&gt;setTarget(this);
+    m_asyncEventQueue.enqueueEvent(WTFMove(keyerrorEvent));
+}
+
+String WebKitMediaKeySession::mediaKeysStorageDirectory() const
+{
+    Document* document = downcast&lt;Document&gt;(scriptExecutionContext());
+    if (!document)
+        return emptyString();
+
+    Settings* settings = document-&gt;settings();
+    if (!settings)
+        return emptyString();
+
+    String storageDirectory = settings-&gt;mediaKeysStorageDirectory();
+    if (storageDirectory.isEmpty())
+        return emptyString();
+
+    SecurityOrigin* origin = document-&gt;securityOrigin();
+    if (!origin)
+        return emptyString();
+
+    return pathByAppendingComponent(storageDirectory, origin-&gt;databaseIdentifier());
+}
+
+bool WebKitMediaKeySession::hasPendingActivity() const
+{
+    return (m_keys &amp;&amp; !isClosed()) || m_asyncEventQueue.hasPendingEvents();
+}
+
+void WebKitMediaKeySession::stop()
+{
+    close();
+}
+
+const char* WebKitMediaKeySession::activeDOMObjectName() const
+{
+    return &quot;WebKitMediaKeySession&quot;;
+}
+
+bool WebKitMediaKeySession::canSuspendForDocumentSuspension() const
+{
+    // FIXME: We should try and do better here.
+    return false;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionhfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeySessionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebKitMediaKeySession_h
+#define WebKitMediaKeySession_h
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;ActiveDOMObject.h&quot;
+#include &quot;CDMSession.h&quot;
+#include &quot;EventTarget.h&quot;
+#include &quot;ExceptionCode.h&quot;
+#include &quot;GenericEventQueue.h&quot;
+#include &quot;Timer.h&quot;
+#include &lt;runtime/Uint8Array.h&gt;
+#include &lt;wtf/Deque.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class WebKitMediaKeyError;
+class WebKitMediaKeys;
+
+class WebKitMediaKeySession final : public RefCounted&lt;WebKitMediaKeySession&gt;, public EventTargetWithInlineData, public ActiveDOMObject, public CDMSessionClient {
+public:
+    static Ref&lt;WebKitMediaKeySession&gt; create(ScriptExecutionContext&amp;, WebKitMediaKeys*, const String&amp; keySystem);
+    ~WebKitMediaKeySession();
+
+    const String&amp; keySystem() const { return m_keySystem; }
+    CDMSession* session() { return m_session.get(); }
+    const String&amp; sessionId() const;
+
+    void setError(WebKitMediaKeyError*);
+    WebKitMediaKeyError* error() { return m_error.get(); }
+
+    void setKeys(WebKitMediaKeys* keys) { m_keys = keys; }
+    WebKitMediaKeys* keys() const { return m_keys; }
+
+    void generateKeyRequest(const String&amp; mimeType, Ref&lt;Uint8Array&gt;&amp;&amp; initData);
+    void update(Ref&lt;Uint8Array&gt;&amp;&amp; key, ExceptionCode&amp;);
+
+    bool isClosed() const { return !m_session; }
+    void close();
+
+    RefPtr&lt;ArrayBuffer&gt; cachedKeyForKeyId(const String&amp; keyId) const;
+
+    using RefCounted&lt;WebKitMediaKeySession&gt;::ref;
+    using RefCounted&lt;WebKitMediaKeySession&gt;::deref;
+
+    void enqueueEvent(RefPtr&lt;Event&gt;&amp;&amp;);
+
+    EventTargetInterface eventTargetInterface() const override { return WebKitMediaKeySessionEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
+
+    // ActiveDOMObject API.
+    bool hasPendingActivity() const override;
+
+protected:
+    WebKitMediaKeySession(ScriptExecutionContext&amp;, WebKitMediaKeys*, const String&amp; keySystem);
+    void keyRequestTimerFired();
+    void addKeyTimerFired();
+
+    // CDMSessionClient
+    void sendMessage(Uint8Array*, String destinationURL) override;
+    void sendError(MediaKeyErrorCode, uint32_t systemCode) override;
+    String mediaKeysStorageDirectory() const override;
+
+    WebKitMediaKeys* m_keys;
+    String m_keySystem;
+    String m_sessionId;
+    RefPtr&lt;WebKitMediaKeyError&gt; m_error;
+    GenericEventQueue m_asyncEventQueue;
+    std::unique_ptr&lt;CDMSession&gt; m_session;
+
+    struct PendingKeyRequest {
+        String mimeType;
+        Ref&lt;Uint8Array&gt; initData;
+    };
+    Deque&lt;PendingKeyRequest&gt; m_pendingKeyRequests;
+    Timer m_keyRequestTimer;
+
+    Deque&lt;Ref&lt;Uint8Array&gt;&gt; m_pendingKeys;
+    Timer m_addKeyTimer;
+
+private:
+    void refEventTarget() override { ref(); }
+    void derefEventTarget() override { deref(); }
+
+    // ActiveDOMObject API.
+    void stop() override;
+    bool canSuspendForDocumentSuspension() const override;
+    const char* activeDOMObjectName() const override;
+};
+
+}
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#endif // WebKitMediaKeySession_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionidlfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeySessionidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+     */
+
+[
+    Conditional=LEGACY_ENCRYPTED_MEDIA,
+    ActiveDOMObject,
+] interface WebKitMediaKeySession : EventTarget {
+    // error state
+    readonly attribute WebKitMediaKeyError error;
+
+    // session properties
+    readonly attribute DOMString keySystem;
+    readonly attribute DOMString sessionId;
+
+    // session operations
+    [MayThrowLegacyException] void update(Uint8Array key);
+    void close();
+    
+    attribute EventHandler onwebkitkeyadded;
+    attribute EventHandler onwebkitkeyerror;
+    attribute EventHandler onwebkitkeymessage;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyscppfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeyscpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,180 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitMediaKeys.h&quot;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;CDM.h&quot;
+#include &quot;EventNames.h&quot;
+#include &quot;HTMLMediaElement.h&quot;
+#include &quot;UUID.h&quot;
+#include &quot;WebKitMediaKeyMessageEvent.h&quot;
+#include &quot;WebKitMediaKeySession.h&quot;
+
+namespace WebCore {
+
+RefPtr&lt;WebKitMediaKeys&gt; WebKitMediaKeys::create(const String&amp; keySystem, ExceptionCode&amp; ec)
+{
+    // From &lt;http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-media-keys-constructor&gt;:
+    // The MediaKeys(keySystem) constructor must run the following steps:
+
+    // 1. If keySystem is null or an empty string, throw an INVALID_ACCESS_ERR exception and abort these steps.
+    if (keySystem.isNull() || keySystem.isEmpty()) {
+        ec = INVALID_ACCESS_ERR;
+        return nullptr;
+    }
+
+    // 2. If keySystem is not one of the user agent's supported Key Systems, throw a NOT_SUPPORTED_ERR and abort these steps.
+    if (!CDM::supportsKeySystem(keySystem)) {
+        ec = NOT_SUPPORTED_ERR;
+        return nullptr;
+    }
+
+    // 3. Let cdm be the content decryption module corresponding to keySystem.
+    // 4. Load cdm if necessary.
+    std::unique_ptr&lt;CDM&gt; cdm = CDM::create(keySystem);
+
+    // 5. Create a new MediaKeys object.
+    // 5.1 Let the keySystem attribute be keySystem.
+    // 6. Return the new object to the caller.
+    return adoptRef(*new WebKitMediaKeys(keySystem, WTFMove(cdm)));
+}
+
+WebKitMediaKeys::WebKitMediaKeys(const String&amp; keySystem, std::unique_ptr&lt;CDM&gt; cdm)
+    : m_mediaElement(nullptr)
+    , m_keySystem(keySystem)
+    , m_cdm(WTFMove(cdm))
+{
+    m_cdm-&gt;setClient(this);
+}
+
+WebKitMediaKeys::~WebKitMediaKeys()
+{
+    // From &lt;http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-media-keys-constructor&gt;:
+    // When destroying a MediaKeys object, follow the steps in close().
+    for (auto&amp; session : m_sessions) {
+        session-&gt;close();
+        session-&gt;setKeys(nullptr);
+    }
+}
+
+RefPtr&lt;WebKitMediaKeySession&gt; WebKitMediaKeys::createSession(ScriptExecutionContext&amp; context, const String&amp; type, Ref&lt;Uint8Array&gt;&amp;&amp; initData, ExceptionCode&amp; ec)
+{
+    // From &lt;http://www.w3.org/TR/2014/WD-encrypted-media-20140218/#dom-createsession&gt;:
+    // The createSession(type, initData) method must run the following steps:
+    // Note: The contents of initData are container-specific Initialization Data.
+
+    // 1. If contentType is null or an empty string, throw an INVALID_ACCESS_ERR exception and abort these steps.
+    if (type.isEmpty()) {
+        ec = INVALID_ACCESS_ERR;
+        return nullptr;
+    }
+
+    // 2. If initData is an empty array, throw an INVALID_ACCESS_ERR exception and abort these steps.
+    if (!initData-&gt;length()) {
+        ec = INVALID_ACCESS_ERR;
+        return nullptr;
+    }
+
+    // 3. If type contains a MIME type that is not supported or is not supported by the keySystem, throw
+    // a NOT_SUPPORTED_ERR exception and abort these steps.
+    if (!type.isNull() &amp;&amp; !type.isEmpty() &amp;&amp; !m_cdm-&gt;supportsMIMEType(type)) {
+        ec = NOT_SUPPORTED_ERR;
+        return nullptr;
+    }
+
+    // 4. Create a new MediaKeySession object.
+    // 4.1 Let the keySystem attribute be keySystem.
+    // 4.2 Let the sessionId attribute be a unique Session ID string. It may be generated by cdm.
+    auto session = WebKitMediaKeySession::create(context, this, keySystem());
+
+    m_sessions.append(session.copyRef());
+
+    // 5. Schedule a task to initialize the session, providing contentType, initData, and the new object.
+    session-&gt;generateKeyRequest(type, WTFMove(initData));
+
+    // 6. Return the new object to the caller.
+    return WTFMove(session);
+}
+
+bool WebKitMediaKeys::isTypeSupported(const String&amp; keySystem, const String&amp; mimeType)
+{
+    // 1. If keySystem contains an unrecognized or unsupported Key System, return false and abort these steps.
+    // Key system string comparison is case-sensitive.
+    if (keySystem.isNull() || keySystem.isEmpty() || !CDM::supportsKeySystem(keySystem))
+        return false;
+
+    // 2. If type is null or an empty string, return true and abort these steps.
+    if (mimeType.isNull() || mimeType.isEmpty())
+        return true;
+
+    // 3. If the Key System specified by keySystem does not support decrypting the container and/or codec
+    // specified by type, return false and abort these steps.
+    if (!CDM::keySystemSupportsMimeType(keySystem, mimeType))
+        return false;
+
+    // 4. Return true;
+    return true;
+}
+
+void WebKitMediaKeys::setMediaElement(HTMLMediaElement* element)
+{
+    if (m_mediaElement &amp;&amp; m_mediaElement-&gt;player())
+        m_mediaElement-&gt;player()-&gt;setCDMSession(nullptr);
+
+    m_mediaElement = element;
+
+    if (m_mediaElement &amp;&amp; m_mediaElement-&gt;player() &amp;&amp; !m_sessions.isEmpty())
+        m_mediaElement-&gt;player()-&gt;setCDMSession(m_sessions.last()-&gt;session());
+}
+
+MediaPlayer* WebKitMediaKeys::cdmMediaPlayer(const CDM*) const
+{
+    if (m_mediaElement)
+        return m_mediaElement-&gt;player();
+    return 0;
+}
+
+void WebKitMediaKeys::keyAdded()
+{
+    if (m_mediaElement)
+        m_mediaElement-&gt;keyAdded();
+
+}
+
+RefPtr&lt;ArrayBuffer&gt; WebKitMediaKeys::cachedKeyForKeyId(const String&amp; keyId) const
+{
+    for (auto&amp; session : m_sessions) {
+        if (RefPtr&lt;ArrayBuffer&gt; key = session-&gt;cachedKeyForKeyId(keyId))
+            return key;
+    }
+    return nullptr;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyshfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeysh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebKitMediaKeys_h
+#define WebKitMediaKeys_h
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;CDM.h&quot;
+#include &quot;EventTarget.h&quot;
+#include &quot;ExceptionCode.h&quot;
+#include &lt;runtime/Uint8Array.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class HTMLMediaElement;
+class WebKitMediaKeySession;
+
+class WebKitMediaKeys : public RefCounted&lt;WebKitMediaKeys&gt;, public CDMClient {
+public:
+    static RefPtr&lt;WebKitMediaKeys&gt; create(const String&amp; keySystem, ExceptionCode&amp;);
+    virtual ~WebKitMediaKeys();
+
+    RefPtr&lt;WebKitMediaKeySession&gt; createSession(ScriptExecutionContext&amp;, const String&amp; mimeType, Ref&lt;Uint8Array&gt;&amp;&amp; initData, ExceptionCode&amp;);
+
+    static bool isTypeSupported(const String&amp; keySystem, const String&amp; mimeType);
+
+    const String&amp; keySystem() const { return m_keySystem; }
+    CDM* cdm() { return m_cdm.get(); }
+
+    HTMLMediaElement* mediaElement() const { return m_mediaElement; }
+    void setMediaElement(HTMLMediaElement*);
+
+    void keyAdded();
+    RefPtr&lt;ArrayBuffer&gt; cachedKeyForKeyId(const String&amp; keyId) const;
+
+protected:
+    // CDMClient:
+    MediaPlayer* cdmMediaPlayer(const CDM*) const override;
+
+    WebKitMediaKeys(const String&amp; keySystem, std::unique_ptr&lt;CDM&gt;);
+
+    Vector&lt;Ref&lt;WebKitMediaKeySession&gt;&gt; m_sessions;
+
+    HTMLMediaElement* m_mediaElement;
+    String m_keySystem;
+    std::unique_ptr&lt;CDM&gt; m_cdm;
+};
+
+}
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#endif // WebKitMediaKeys_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeysidlfromrev206982trunkSourceWebCoreModulesencryptedmediaMediaKeysidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl (from rev 206982, trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.idl) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */

+[
+    Conditional=LEGACY_ENCRYPTED_MEDIA,
+    Constructor(DOMString keySystem),
+    ConstructorMayThrowLegacyException,
+] interface WebKitMediaKeys {
+    [CallWith=ScriptExecutionContext, MayThrowLegacyException] WebKitMediaKeySession createSession(DOMString type, Uint8Array initData);
+    static boolean isTypeSupported(DOMString keySystem, optional DOMString type);
+    readonly attribute DOMString keySystem;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1155,6 +1155,14 @@
</span><span class="cx">                 2B365C841525119E0091D27B /* RenderSVGEllipse.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B4235A015250F6000DBBCD8 /* RenderSVGEllipse.h */; };
</span><span class="cx">                 2BE8E2C712A589EC00FAD550 /* HTMLMetaCharsetParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BE8E2C612A589EC00FAD550 /* HTMLMetaCharsetParser.h */; };
</span><span class="cx">                 2BE8E2C912A58A0100FAD550 /* HTMLMetaCharsetParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BE8E2C812A58A0100FAD550 /* HTMLMetaCharsetParser.cpp */; };
</span><ins>+                2D0621441DA639B600A7FB26 /* WebKitMediaKeyMessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D0621421DA6398800A7FB26 /* WebKitMediaKeyMessageEvent.cpp */; };
+                2D0621451DA639BA00A7FB26 /* WebKitMediaKeyMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D0621431DA6398800A7FB26 /* WebKitMediaKeyMessageEvent.h */; };
+                2D06214D1DA63A8B00A7FB26 /* WebKitMediaKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D0621491DA63A7900A7FB26 /* WebKitMediaKeys.cpp */; };
+                2D06214E1DA63A8E00A7FB26 /* WebKitMediaKeys.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D06214A1DA63A7900A7FB26 /* WebKitMediaKeys.h */; };
+                2D06214F1DA63A9100A7FB26 /* WebKitMediaKeySession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D06214B1DA63A7900A7FB26 /* WebKitMediaKeySession.cpp */; };
+                2D0621501DA63A9400A7FB26 /* WebKitMediaKeySession.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D06214C1DA63A7900A7FB26 /* WebKitMediaKeySession.h */; };
+                2D0621511DA63A9F00A7FB26 /* WebKitMediaKeyNeededEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D0621481DA63A7900A7FB26 /* WebKitMediaKeyNeededEvent.h */; };
+                2D0621521DA63AA200A7FB26 /* WebKitMediaKeyNeededEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D0621471DA63A7900A7FB26 /* WebKitMediaKeyNeededEvent.cpp */; };
</ins><span class="cx">                 2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D0B4AAC18DA1CCD00434DE1 /* IOSurface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */; };
</span><span class="cx">                 2D0CF8171BCF5DE1007A4937 /* NSWindowSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5593,7 +5601,6 @@
</span><span class="cx">                 CD127DED14F3097D00E84779 /* WebCoreFullScreenWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD127DEB14F3097900E84779 /* WebCoreFullScreenWindow.mm */; };
</span><span class="cx">                 CD127DEE14F3098400E84779 /* WebCoreFullScreenWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CD19A2681A13E700008D650E /* DiagnosticLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD19A2671A13E700008D650E /* DiagnosticLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                CD1B4A65160786AE00282DF9 /* MediaKeyNeededEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DC216014EEE00FEA3B1 /* MediaKeyNeededEvent.cpp */; };
</del><span class="cx">                 CD1E7347167BC78E009A885D /* TextTrackRepresentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD1E7346167BC78E009A885D /* TextTrackRepresentation.cpp */; };
</span><span class="cx">                 CD225C0B1C46FBF400140761 /* WebCoreNSURLSession.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD225C091C46FBF400140761 /* WebCoreNSURLSession.mm */; };
</span><span class="cx">                 CD225C0C1C46FBF400140761 /* WebCoreNSURLSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CD225C0A1C46FBF400140761 /* WebCoreNSURLSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5700,15 +5707,12 @@
</span><span class="cx">                 CDA79824170A258300D45C55 /* AudioSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA79823170A258300D45C55 /* AudioSession.cpp */; };
</span><span class="cx">                 CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDA79825170A279000D45C55 /* AudioSessionIOS.mm */; };
</span><span class="cx">                 CDA7982A170A3D0000D45C55 /* AudioSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA79821170A22DC00D45C55 /* AudioSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                CDA98DA31601464100FEA3B1 /* JSMediaKeyError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98D9B160128A500FEA3B1 /* JSMediaKeyError.cpp */; };
-                CDA98DD816025BEF00FEA3B1 /* MediaKeyMessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DD516025BED00FEA3B1 /* MediaKeyMessageEvent.cpp */; };
-                CDA98DDF16026A3700FEA3B1 /* JSMediaKeyMessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DDB16026A1800FEA3B1 /* JSMediaKeyMessageEvent.cpp */; };
-                CDA98DE016026A3700FEA3B1 /* JSMediaKeyNeededEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DDD16026A1900FEA3B1 /* JSMediaKeyNeededEvent.cpp */; };
-                CDA98E0416039E1A00FEA3B1 /* JSMediaKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DCE1601597900FEA3B1 /* JSMediaKeys.cpp */; };
-                CDA98E0616039E1F00FEA3B1 /* JSMediaKeySession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DD01601597900FEA3B1 /* JSMediaKeySession.cpp */; };
</del><ins>+                CDA98DA31601464100FEA3B1 /* JSWebKitMediaKeyError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98D9B160128A500FEA3B1 /* JSWebKitMediaKeyError.cpp */; };
+                CDA98DDF16026A3700FEA3B1 /* JSWebKitMediaKeyMessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DDB16026A1800FEA3B1 /* JSWebKitMediaKeyMessageEvent.cpp */; };
+                CDA98DE016026A3700FEA3B1 /* JSWebKitMediaKeyNeededEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DDD16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.cpp */; };
+                CDA98E0416039E1A00FEA3B1 /* JSWebKitMediaKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DCE1601597900FEA3B1 /* JSWebKitMediaKeys.cpp */; };
+                CDA98E0616039E1F00FEA3B1 /* JSWebKitMediaKeySession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DD01601597900FEA3B1 /* JSWebKitMediaKeySession.cpp */; };
</ins><span class="cx">                 CDA98E0B1603CD6000FEA3B1 /* CDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98E091603CD5900FEA3B1 /* CDM.cpp */; };
</span><del>-                CDA98E0D1603FE4A00FEA3B1 /* MediaKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DCA1601508A00FEA3B1 /* MediaKeys.cpp */; };
-                CDA98E0E1603FE5800FEA3B1 /* MediaKeySession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DC716014F2C00FEA3B1 /* MediaKeySession.cpp */; };
</del><span class="cx">                 CDAA8D0A14D71B2E0061EA60 /* PlatformClockCM.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */; };
</span><span class="cx">                 CDAB6D2817C7DE6C00C60B34 /* MediaControlsHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAB6D2617C7DE6C00C60B34 /* MediaControlsHost.cpp */; };
</span><span class="cx">                 CDAB6D2917C7DE6C00C60B34 /* MediaControlsHost.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2717C7DE6C00C60B34 /* MediaControlsHost.h */; };
</span><span class="lines">@@ -8098,9 +8102,23 @@
</span><span class="cx">                 2B4235A015250F6000DBBCD8 /* RenderSVGEllipse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGEllipse.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2BE8E2C612A589EC00FAD550 /* HTMLMetaCharsetParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLMetaCharsetParser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2BE8E2C812A58A0100FAD550 /* HTMLMetaCharsetParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLMetaCharsetParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2D0621421DA6398800A7FB26 /* WebKitMediaKeyMessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitMediaKeyMessageEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D0621431DA6398800A7FB26 /* WebKitMediaKeyMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitMediaKeyMessageEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D0621471DA63A7900A7FB26 /* WebKitMediaKeyNeededEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitMediaKeyNeededEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D0621481DA63A7900A7FB26 /* WebKitMediaKeyNeededEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitMediaKeyNeededEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D0621491DA63A7900A7FB26 /* WebKitMediaKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitMediaKeys.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D06214A1DA63A7900A7FB26 /* WebKitMediaKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitMediaKeys.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D06214B1DA63A7900A7FB26 /* WebKitMediaKeySession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitMediaKeySession.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D06214C1DA63A7900A7FB26 /* WebKitMediaKeySession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitMediaKeySession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D0621531DA63ABF00A7FB26 /* WebKitMediaKeyMessageEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitMediaKeyMessageEvent.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D0621541DA63ABF00A7FB26 /* WebKitMediaKeyNeededEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitMediaKeyNeededEvent.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D0621551DA63ABF00A7FB26 /* WebKitMediaKeys.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitMediaKeys.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D0621561DA63ABF00A7FB26 /* WebKitMediaKeySession.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitMediaKeySession.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSurface.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSurface.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSWindowSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2D1932171DA64E1900A54A08 /* WebKitMediaKeyError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitMediaKeyError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D1932181DA64E1900A54A08 /* WebKitMediaKeyError.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitMediaKeyError.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TUCallSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D25396018CE7F6200270222 /* ImageControlsButtonElementMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageControlsButtonElementMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D25396118CE7F6200270222 /* ImageControlsButtonElementMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageControlsButtonElementMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13262,28 +13280,16 @@
</span><span class="cx">                 CDA79821170A22DC00D45C55 /* AudioSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDA79823170A258300D45C55 /* AudioSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSession.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDA79825170A279000D45C55 /* AudioSessionIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AudioSessionIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CDA98D9B160128A500FEA3B1 /* JSMediaKeyError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaKeyError.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98D9C160128A500FEA3B1 /* JSMediaKeyError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaKeyError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DC216014EEE00FEA3B1 /* MediaKeyNeededEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaKeyNeededEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DC316014EEE00FEA3B1 /* MediaKeyNeededEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeyNeededEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DC416014EEE00FEA3B1 /* MediaKeyNeededEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaKeyNeededEvent.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DC716014F2C00FEA3B1 /* MediaKeySession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaKeySession.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DC816014F2C00FEA3B1 /* MediaKeySession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeySession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DC916014F4000FEA3B1 /* MediaKeySession.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaKeySession.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DCA1601508A00FEA3B1 /* MediaKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaKeys.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DCB1601508A00FEA3B1 /* MediaKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeys.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DCC1601508A00FEA3B1 /* MediaKeys.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaKeys.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DCE1601597900FEA3B1 /* JSMediaKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaKeys.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DCF1601597900FEA3B1 /* JSMediaKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaKeys.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DD01601597900FEA3B1 /* JSMediaKeySession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaKeySession.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DD11601597900FEA3B1 /* JSMediaKeySession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaKeySession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DD516025BED00FEA3B1 /* MediaKeyMessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaKeyMessageEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DD616025BED00FEA3B1 /* MediaKeyMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeyMessageEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DD716025BEE00FEA3B1 /* MediaKeyMessageEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaKeyMessageEvent.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DDB16026A1800FEA3B1 /* JSMediaKeyMessageEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaKeyMessageEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DDC16026A1900FEA3B1 /* JSMediaKeyMessageEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSMediaKeyMessageEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DDD16026A1900FEA3B1 /* JSMediaKeyNeededEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaKeyNeededEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98DDE16026A1900FEA3B1 /* JSMediaKeyNeededEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSMediaKeyNeededEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                CDA98D9B160128A500FEA3B1 /* JSWebKitMediaKeyError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMediaKeyError.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98D9C160128A500FEA3B1 /* JSWebKitMediaKeyError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitMediaKeyError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98DCE1601597900FEA3B1 /* JSWebKitMediaKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMediaKeys.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98DCF1601597900FEA3B1 /* JSWebKitMediaKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitMediaKeys.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98DD01601597900FEA3B1 /* JSWebKitMediaKeySession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMediaKeySession.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98DD11601597900FEA3B1 /* JSWebKitMediaKeySession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitMediaKeySession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98DDB16026A1800FEA3B1 /* JSWebKitMediaKeyMessageEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMediaKeyMessageEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98DDC16026A1900FEA3B1 /* JSWebKitMediaKeyMessageEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSWebKitMediaKeyMessageEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98DDD16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMediaKeyNeededEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98DDE16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSWebKitMediaKeyNeededEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDA98E091603CD5900FEA3B1 /* CDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CDM.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDA98E0A1603CD5900FEA3B1 /* CDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDM.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDA98E0C1603CF3C00FEA3B1 /* CDMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13299,8 +13305,6 @@
</span><span class="cx">                 CDAB6D3017C9259500C60B34 /* UserAgentScriptsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserAgentScriptsData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDAE8C071746B95700532D78 /* PlatformMediaSessionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformMediaSessionManager.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformMediaSessionManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CDB859F2160D489900E5B07F /* MediaKeyError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeyError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDB859F3160D489900E5B07F /* MediaKeyError.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaKeyError.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 CDBEAEAA19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaSelectionGroupAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDBEAEAB19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSelectionGroupAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC1DD4117CC2C48008CB55D /* mediaControlsApple.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = mediaControlsApple.css; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15799,6 +15803,25 @@
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                2D0621461DA639EC00A7FB26 /* legacy */ = {
+                        isa = PBXGroup;
+                        children = (
+                                2D0621421DA6398800A7FB26 /* WebKitMediaKeyMessageEvent.cpp */,
+                                2D0621431DA6398800A7FB26 /* WebKitMediaKeyMessageEvent.h */,
+                                2D0621531DA63ABF00A7FB26 /* WebKitMediaKeyMessageEvent.idl */,
+                                2D0621471DA63A7900A7FB26 /* WebKitMediaKeyNeededEvent.cpp */,
+                                2D0621481DA63A7900A7FB26 /* WebKitMediaKeyNeededEvent.h */,
+                                2D0621541DA63ABF00A7FB26 /* WebKitMediaKeyNeededEvent.idl */,
+                                2D06214B1DA63A7900A7FB26 /* WebKitMediaKeySession.cpp */,
+                                2D06214C1DA63A7900A7FB26 /* WebKitMediaKeySession.h */,
+                                2D0621561DA63ABF00A7FB26 /* WebKitMediaKeySession.idl */,
+                                2D0621491DA63A7900A7FB26 /* WebKitMediaKeys.cpp */,
+                                2D06214A1DA63A7900A7FB26 /* WebKitMediaKeys.h */,
+                                2D0621551DA63ABF00A7FB26 /* WebKitMediaKeys.idl */,
+                        );
+                        path = legacy;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 2D5036661BCDDDC400E20BB3 /* mac */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -18171,8 +18194,6 @@
</span><span class="cx">                                 E446139C0CD6331000FADA75 /* MediaError.idl */,
</span><span class="cx">                                 07A6D1E91491137700051D0C /* MediaFragmentURIParser.cpp */,
</span><span class="cx">                                 07A6D1EA1491137700051D0C /* MediaFragmentURIParser.h */,
</span><del>-                                CDB859F2160D489900E5B07F /* MediaKeyError.h */,
-                                CDB859F3160D489900E5B07F /* MediaKeyError.idl */,
</del><span class="cx">                                 F55B3D911251F12D003EF269 /* MonthInputType.cpp */,
</span><span class="cx">                                 F55B3D921251F12D003EF269 /* MonthInputType.h */,
</span><span class="cx">                                 F55B3D931251F12D003EF269 /* NumberInputType.cpp */,
</span><span class="lines">@@ -18229,6 +18250,8 @@
</span><span class="cx">                                 E44613B40CD6344E00FADA75 /* VoidCallback.h */,
</span><span class="cx">                                 E44613A00CD6331000FADA75 /* VoidCallback.idl */,
</span><span class="cx">                                 A5A7AA42132F0ECC00D3A3C2 /* WebAutocapitalize.h */,
</span><ins>+                                2D1932171DA64E1900A54A08 /* WebKitMediaKeyError.h */,
+                                2D1932181DA64E1900A54A08 /* WebKitMediaKeyError.idl */,
</ins><span class="cx">                                 F55B3DAB1251F12D003EF269 /* WeekInputType.cpp */,
</span><span class="cx">                                 F55B3DAC1251F12D003EF269 /* WeekInputType.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -21888,6 +21911,7 @@
</span><span class="cx">                 CDA98DBD16014E0800FEA3B1 /* encryptedmedia */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                2D0621461DA639EC00A7FB26 /* legacy */,
</ins><span class="cx">                                 CDA98E091603CD5900FEA3B1 /* CDM.cpp */,
</span><span class="cx">                                 CDA98E0A1603CD5900FEA3B1 /* CDM.h */,
</span><span class="cx">                                 CDA98E0C1603CF3C00FEA3B1 /* CDMPrivate.h */,
</span><span class="lines">@@ -21897,18 +21921,6 @@
</span><span class="cx">                                 CDCA98E918B2C8D000C12FF9 /* CDMPrivateMediaPlayer.h */,
</span><span class="cx">                                 CDE8B5EE1A69778B00B4B66A /* CDMSessionClearKey.cpp */,
</span><span class="cx">                                 CDE8B5EF1A69778B00B4B66A /* CDMSessionClearKey.h */,
</span><del>-                                CDA98DD516025BED00FEA3B1 /* MediaKeyMessageEvent.cpp */,
-                                CDA98DD616025BED00FEA3B1 /* MediaKeyMessageEvent.h */,
-                                CDA98DD716025BEE00FEA3B1 /* MediaKeyMessageEvent.idl */,
-                                CDA98DC216014EEE00FEA3B1 /* MediaKeyNeededEvent.cpp */,
-                                CDA98DC316014EEE00FEA3B1 /* MediaKeyNeededEvent.h */,
-                                CDA98DC416014EEE00FEA3B1 /* MediaKeyNeededEvent.idl */,
-                                CDA98DCA1601508A00FEA3B1 /* MediaKeys.cpp */,
-                                CDA98DCB1601508A00FEA3B1 /* MediaKeys.h */,
-                                CDA98DCC1601508A00FEA3B1 /* MediaKeys.idl */,
-                                CDA98DC716014F2C00FEA3B1 /* MediaKeySession.cpp */,
-                                CDA98DC816014F2C00FEA3B1 /* MediaKeySession.h */,
-                                CDA98DC916014F4000FEA3B1 /* MediaKeySession.idl */,
</del><span class="cx">                         );
</span><span class="cx">                         path = encryptedmedia;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -21916,16 +21928,16 @@
</span><span class="cx">                 CDA98DCD1601515C00FEA3B1 /* EncryptedMedia */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                CDA98D9B160128A500FEA3B1 /* JSMediaKeyError.cpp */,
-                                CDA98D9C160128A500FEA3B1 /* JSMediaKeyError.h */,
-                                CDA98DDB16026A1800FEA3B1 /* JSMediaKeyMessageEvent.cpp */,
-                                CDA98DDC16026A1900FEA3B1 /* JSMediaKeyMessageEvent.h */,
-                                CDA98DDD16026A1900FEA3B1 /* JSMediaKeyNeededEvent.cpp */,
-                                CDA98DDE16026A1900FEA3B1 /* JSMediaKeyNeededEvent.h */,
-                                CDA98DCE1601597900FEA3B1 /* JSMediaKeys.cpp */,
-                                CDA98DCF1601597900FEA3B1 /* JSMediaKeys.h */,
-                                CDA98DD01601597900FEA3B1 /* JSMediaKeySession.cpp */,
-                                CDA98DD11601597900FEA3B1 /* JSMediaKeySession.h */,
</del><ins>+                                CDA98D9B160128A500FEA3B1 /* JSWebKitMediaKeyError.cpp */,
+                                CDA98D9C160128A500FEA3B1 /* JSWebKitMediaKeyError.h */,
+                                CDA98DDB16026A1800FEA3B1 /* JSWebKitMediaKeyMessageEvent.cpp */,
+                                CDA98DDC16026A1900FEA3B1 /* JSWebKitMediaKeyMessageEvent.h */,
+                                CDA98DDD16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.cpp */,
+                                CDA98DDE16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.h */,
+                                CDA98DCE1601597900FEA3B1 /* JSWebKitMediaKeys.cpp */,
+                                CDA98DCF1601597900FEA3B1 /* JSWebKitMediaKeys.h */,
+                                CDA98DD01601597900FEA3B1 /* JSWebKitMediaKeySession.cpp */,
+                                CDA98DD11601597900FEA3B1 /* JSWebKitMediaKeySession.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = EncryptedMedia;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -24100,6 +24112,7 @@
</span><span class="cx">                                 C37CDEBD149EF2030042090D /* ColorChooserClient.h in Headers */,
</span><span class="cx">                                 F55B3DB41251F12D003EF269 /* ColorInputType.h in Headers */,
</span><span class="cx">                                 EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */,
</span><ins>+                                2D0621511DA63A9F00A7FB26 /* WebKitMediaKeyNeededEvent.h in Headers */,
</ins><span class="cx">                                 9382DF5810A8D5C900925652 /* ColorSpace.h in Headers */,
</span><span class="cx">                                 BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
</span><span class="cx">                                 43EDD67F1B485DBF00640E75 /* CombinedFiltersAlphabet.h in Headers */,
</span><span class="lines">@@ -24210,6 +24223,7 @@
</span><span class="cx">                                 E1C266DF18319F31003F8B33 /* CryptoKeyDataRSAComponents.h in Headers */,
</span><span class="cx">                                 E125F8361822F18A00D84CD9 /* CryptoKeyHMAC.h in Headers */,
</span><span class="cx">                                 E1F80B8818317252007885C3 /* CryptoKeyPair.h in Headers */,
</span><ins>+                                2D0621451DA639BA00A7FB26 /* WebKitMediaKeyMessageEvent.h in Headers */,
</ins><span class="cx">                                 E164FAA318315BF400DB4E61 /* CryptoKeyRSA.h in Headers */,
</span><span class="cx">                                 E125F856182C0F8300D84CD9 /* CryptoKeySerialization.h in Headers */,
</span><span class="cx">                                 E125F85A182C1AA600D84CD9 /* CryptoKeySerializationRaw.h in Headers */,
</span><span class="lines">@@ -25538,6 +25552,7 @@
</span><span class="cx">                                 AAA4FAD2175D5CB300743873 /* JSUIRequestEvent.h in Headers */,
</span><span class="cx">                                 7C73FB12191EF6F4007DE061 /* JSUserMessageHandler.h in Headers */,
</span><span class="cx">                                 7C73FB0D191EF5A8007DE061 /* JSUserMessageHandlersNamespace.h in Headers */,
</span><ins>+                                2D06214E1DA63A8E00A7FB26 /* WebKitMediaKeys.h in Headers */,
</ins><span class="cx">                                 15C77093100D3CA8005BA267 /* JSValidityState.h in Headers */,
</span><span class="cx">                                 BE8EF04B171C9014009B48C3 /* JSVideoTrack.h in Headers */,
</span><span class="cx">                                 BE8EF04D171C9014009B48C3 /* JSVideoTrackList.h in Headers */,
</span><span class="lines">@@ -25987,6 +26002,7 @@
</span><span class="cx">                                 2D5002FC1B56D7990020AAF7 /* PathUtilities.h in Headers */,
</span><span class="cx">                                 A8FA6E5D0E4CFDED00D5CF49 /* Pattern.h in Headers */,
</span><span class="cx">                                 B22279710D00BF220071B782 /* PatternAttributes.h in Headers */,
</span><ins>+                                2D0621501DA63A9400A7FB26 /* WebKitMediaKeySession.h in Headers */,
</ins><span class="cx">                                 1A8A643A1D19FC5300D0E00F /* Payment.h in Headers */,
</span><span class="cx">                                 1AE96A881D1A0CEB00B86768 /* PaymentAuthorizationStatus.h in Headers */,
</span><span class="cx">                                 1A8A643B1D19FC5300D0E00F /* PaymentContact.h in Headers */,
</span><span class="lines">@@ -27958,6 +27974,7 @@
</span><span class="cx">                                 4A9CC81716BB9AC600EC645A /* CSSDefaultStyleSheets.cpp in Sources */,
</span><span class="cx">                                 FBB0C5B717BBD626003D3677 /* CSSFilterImageValue.cpp in Sources */,
</span><span class="cx">                                 BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */,
</span><ins>+                                2D0621441DA639B600A7FB26 /* WebKitMediaKeyMessageEvent.cpp in Sources */,
</ins><span class="cx">                                 409EBDB216B7EE7400CBA3FC /* CSSFontFaceLoadEvent.cpp in Sources */,
</span><span class="cx">                                 07B7116E1D899E63009F0FFB /* CaptureDeviceManager.cpp in Sources */,
</span><span class="cx">                                 A80E6CE70A1989CA007FB8C5 /* CSSFontFaceRule.cpp in Sources */,
</span><span class="lines">@@ -28963,11 +28980,11 @@
</span><span class="cx">                                 1B88DD131D5B9E5000E3B7A4 /* JSMediaDevicesCustom.cpp in Sources */,
</span><span class="cx">                                 FD23A12513F5FA5900F67001 /* JSMediaElementAudioSourceNode.cpp in Sources */,
</span><span class="cx">                                 E44614180CD6826900FADA75 /* JSMediaError.cpp in Sources */,
</span><del>-                                CDA98DA31601464100FEA3B1 /* JSMediaKeyError.cpp in Sources */,
-                                CDA98DDF16026A3700FEA3B1 /* JSMediaKeyMessageEvent.cpp in Sources */,
-                                CDA98DE016026A3700FEA3B1 /* JSMediaKeyNeededEvent.cpp in Sources */,
-                                CDA98E0416039E1A00FEA3B1 /* JSMediaKeys.cpp in Sources */,
-                                CDA98E0616039E1F00FEA3B1 /* JSMediaKeySession.cpp in Sources */,
</del><ins>+                                CDA98DA31601464100FEA3B1 /* JSWebKitMediaKeyError.cpp in Sources */,
+                                CDA98DDF16026A3700FEA3B1 /* JSWebKitMediaKeyMessageEvent.cpp in Sources */,
+                                CDA98DE016026A3700FEA3B1 /* JSWebKitMediaKeyNeededEvent.cpp in Sources */,
+                                CDA98E0416039E1A00FEA3B1 /* JSWebKitMediaKeys.cpp in Sources */,
+                                CDA98E0616039E1F00FEA3B1 /* JSWebKitMediaKeySession.cpp in Sources */,
</ins><span class="cx">                                 BC3C39B60C0D3D8D005F4D7A /* JSMediaList.cpp in Sources */,
</span><span class="cx">                                 D3A94A46122DC40F00A37BBC /* JSMediaQueryList.cpp in Sources */,
</span><span class="cx">                                 7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */,
</span><span class="lines">@@ -29296,6 +29313,7 @@
</span><span class="cx">                                 7EA30F6917EFFE7500257D0B /* JSWebGLCompressedTexturePVRTC.cpp in Sources */,
</span><span class="cx">                                 6E3FAD3814733F4000E42306 /* JSWebGLCompressedTextureS3TC.cpp in Sources */,
</span><span class="cx">                                 6EE8A77210F803F3005A4A24 /* JSWebGLContextAttributes.cpp in Sources */,
</span><ins>+                                2D06214D1DA63A8B00A7FB26 /* WebKitMediaKeys.cpp in Sources */,
</ins><span class="cx">                                 BC2CBF7B140F1D58003879BE /* JSWebGLContextEvent.cpp in Sources */,
</span><span class="cx">                                 6E3FAD3814733F4010E42307 /* JSWebGLDebugRendererInfo.cpp in Sources */,
</span><span class="cx">                                 6E3FAD3814733F4020E42307 /* JSWebGLDebugShaders.cpp in Sources */,
</span><span class="lines">@@ -29466,10 +29484,6 @@
</span><span class="cx">                                 5E4EAB051D07166E0006A184 /* MediaEndpointSessionDescription.cpp in Sources */,
</span><span class="cx">                                 4E1959210A39DABA00220FE5 /* MediaFeatureNames.cpp in Sources */,
</span><span class="cx">                                 07A6D1EB1491137700051D0C /* MediaFragmentURIParser.cpp in Sources */,
</span><del>-                                CDA98DD816025BEF00FEA3B1 /* MediaKeyMessageEvent.cpp in Sources */,
-                                CD1B4A65160786AE00282DF9 /* MediaKeyNeededEvent.cpp in Sources */,
-                                CDA98E0D1603FE4A00FEA3B1 /* MediaKeys.cpp in Sources */,
-                                CDA98E0E1603FE5800FEA3B1 /* MediaKeySession.cpp in Sources */,
</del><span class="cx">                                 A8EA80090A19516E00A8EF5F /* MediaList.cpp in Sources */,
</span><span class="cx">                                 071E496E1AD5AA0D008A50B4 /* MediaPlaybackTargetMac.mm in Sources */,
</span><span class="cx">                                 077B64161B95F703003E9AD5 /* MediaPlaybackTargetMock.cpp in Sources */,
</span><span class="lines">@@ -29815,6 +29829,7 @@
</span><span class="cx">                                 439046E112DA25E800AF80A2 /* RenderMathMLRoot.cpp in Sources */,
</span><span class="cx">                                 439046E312DA25E800AF80A2 /* RenderMathMLRow.cpp in Sources */,
</span><span class="cx">                                 439046E712DA25E800AF80A2 /* RenderMathMLScripts.cpp in Sources */,
</span><ins>+                                2D0621521DA63AA200A7FB26 /* WebKitMediaKeyNeededEvent.cpp in Sources */,
</ins><span class="cx">                                 5B7A208D2E12979B4AE19DE6 /* RenderMathMLSpace.cpp in Sources */,
</span><span class="cx">                                 439046EB12DA25E800AF80A9 /* RenderMathMLToken.cpp in Sources */,
</span><span class="cx">                                 439046E912DA25E800AF80A2 /* RenderMathMLUnderOver.cpp in Sources */,
</span><span class="lines">@@ -30473,6 +30488,7 @@
</span><span class="cx">                                 1AE79D42188DB61F002239C2 /* UserContentController.cpp in Sources */,
</span><span class="cx">                                 7C3F01C21C8E5AC200ADD962 /* UserContentProvider.cpp in Sources */,
</span><span class="cx">                                 BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */,
</span><ins>+                                2D06214F1DA63A9100A7FB26 /* WebKitMediaKeySession.cpp in Sources */,
</ins><span class="cx">                                 2542F4DA1166C25A00E89A86 /* UserGestureIndicator.cpp in Sources */,
</span><span class="cx">                                 9920398218B95BC600B39AF9 /* UserInputBridge.cpp in Sources */,
</span><span class="cx">                                 078E091217D14CEE00420AA1 /* UserMediaController.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDictionary.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDictionary.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-#include &quot;JSMediaKeyError.h&quot;
</del><ins>+#include &quot;JSWebKitMediaKeyError.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FETCH_API)
</span><span class="lines">@@ -257,9 +257,9 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-void JSDictionary::convertValue(JSC::ExecState*, JSC::JSValue value, RefPtr&lt;MediaKeyError&gt;&amp; result)
</del><ins>+void JSDictionary::convertValue(JSC::ExecState*, JSC::JSValue value, RefPtr&lt;WebKitMediaKeyError&gt;&amp; result)
</ins><span class="cx"> {
</span><del>-    result = JSMediaKeyError::toWrapped(value);
</del><ins>+    result = JSWebKitMediaKeyError::toWrapped(value);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDictionaryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDictionary.h (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDictionary.h        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -49,7 +49,6 @@
</span><span class="cx"> class EventTarget;
</span><span class="cx"> class Gamepad;
</span><span class="cx"> class FetchHeaders;
</span><del>-class MediaKeyError;
</del><span class="cx"> class MediaStream;
</span><span class="cx"> class MediaStreamTrack;
</span><span class="cx"> class OverconstrainedError;
</span><span class="lines">@@ -61,6 +60,7 @@
</span><span class="cx"> class TouchList;
</span><span class="cx"> class TrackBase;
</span><span class="cx"> class VoidCallback;
</span><ins>+class WebKitMediaKeyError;
</ins><span class="cx"> 
</span><span class="cx"> class JSDictionary {
</span><span class="cx"> public:
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx">     static void convertValue(JSC::ExecState*, JSC::JSValue, ArrayValue&amp; result);
</span><span class="cx">     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr&lt;JSC::Uint8Array&gt;&amp; result);
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-    static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr&lt;MediaKeyError&gt;&amp; result);
</del><ins>+    static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr&lt;WebKitMediaKeyError&gt;&amp; result);
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(FETCH_API)
</span><span class="cx">     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr&lt;FetchHeaders&gt;&amp; result);
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventNames.in (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventNames.in        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/dom/EventNames.in        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -59,8 +59,8 @@
</span><span class="cx"> DeviceOrientationEvent conditional=DEVICE_ORIENTATION
</span><span class="cx"> DeviceProximityEvent conditional=PROXIMITY_EVENTS
</span><span class="cx"> OrientationEvent interfaceName=Event, conditional=ORIENTATION_EVENTS
</span><del>-MediaKeyMessageEvent conditional=LEGACY_ENCRYPTED_MEDIA
-MediaKeyNeededEvent conditional=LEGACY_ENCRYPTED_MEDIA
</del><ins>+WebKitMediaKeyMessageEvent conditional=LEGACY_ENCRYPTED_MEDIA
+WebKitMediaKeyNeededEvent conditional=LEGACY_ENCRYPTED_MEDIA
</ins><span class="cx"> TrackEvent conditional=VIDEO_TRACK
</span><span class="cx"> AutocompleteErrorEvent conditional=REQUEST_AUTOCOMPLETE
</span><span class="cx"> CSSFontFaceLoadEvent conditional=FONT_LOAD_EVENTS
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventTargetFactoryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTargetFactory.in (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTargetFactory.in        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/dom/EventTargetFactory.in        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -15,7 +15,6 @@
</span><span class="cx"> IDBOpenDBRequest conditional=INDEXED_DATABASE
</span><span class="cx"> IDBRequest conditional=INDEXED_DATABASE
</span><span class="cx"> IDBTransaction conditional=INDEXED_DATABASE
</span><del>-MediaKeySession conditional=LEGACY_ENCRYPTED_MEDIA
</del><span class="cx"> MediaController conditional=VIDEO
</span><span class="cx"> MediaRemoteControls conditional=MEDIA_SESSION
</span><span class="cx"> MediaSource conditional=MEDIA_SOURCE
</span><span class="lines">@@ -35,6 +34,7 @@
</span><span class="cx"> TextTrackCue conditional=VIDEO_TRACK
</span><span class="cx"> TextTrackList conditional=VIDEO_TRACK
</span><span class="cx"> VideoTrackList conditional=VIDEO_TRACK
</span><ins>+WebKitMediaKeySession conditional=LEGACY_ENCRYPTED_MEDIA
</ins><span class="cx"> WebKitNamedFlow
</span><span class="cx"> WebSocket conditional=WEB_SOCKETS
</span><span class="cx"> Worker
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -145,8 +145,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-#include &quot;MediaKeyNeededEvent.h&quot;
-#include &quot;MediaKeys.h&quot;
</del><ins>+#include &quot;WebKitMediaKeyNeededEvent.h&quot;
+#include &quot;WebKitMediaKeys.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><span class="lines">@@ -583,7 +583,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-    setMediaKeys(0);
</del><ins>+    webkitSetMediaKeys(0);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><span class="lines">@@ -2446,7 +2446,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto event = MediaKeyNeededEvent::create(eventNames().webkitneedkeyEvent, initData);
</del><ins>+    auto event = WebKitMediaKeyNeededEvent::create(eventNames().webkitneedkeyEvent, initData);
</ins><span class="cx">     event-&gt;setTarget(this);
</span><span class="cx">     m_asyncEventQueue.enqueueEvent(WTFMove(event));
</span><span class="cx"> 
</span><span class="lines">@@ -2470,7 +2470,7 @@
</span><span class="cx">     return pathByAppendingComponent(storageDirectory, origin-&gt;databaseIdentifier());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::setMediaKeys(MediaKeys* mediaKeys)
</del><ins>+void HTMLMediaElement::webkitSetMediaKeys(WebKitMediaKeys* mediaKeys)
</ins><span class="cx"> {
</span><span class="cx">     if (m_mediaKeys == mediaKeys)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -70,7 +70,6 @@
</span><span class="cx"> class MediaControlsHost;
</span><span class="cx"> class MediaElementAudioSourceNode;
</span><span class="cx"> class MediaError;
</span><del>-class MediaKeys;
</del><span class="cx"> class MediaPlayer;
</span><span class="cx"> class MediaSession;
</span><span class="cx"> class MediaSource;
</span><span class="lines">@@ -84,6 +83,9 @@
</span><span class="cx"> class VideoPlaybackQuality;
</span><span class="cx"> class VideoTrackList;
</span><span class="cx"> class VideoTrackPrivate;
</span><ins>+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+class WebKitMediaKeys;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> typedef PODIntervalTree&lt;MediaTime, TextTrackCue*&gt; CueIntervalTree;
</span><span class="lines">@@ -249,8 +251,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-    MediaKeys* keys() const { return m_mediaKeys.get(); }
-    void setMediaKeys(MediaKeys*);
</del><ins>+    WebKitMediaKeys* webkitKeys() const { return m_mediaKeys.get(); }
+    void webkitSetMediaKeys(WebKitMediaKeys*);
</ins><span class="cx"> 
</span><span class="cx">     void keyAdded();
</span><span class="cx"> #endif
</span><span class="lines">@@ -999,7 +1001,7 @@
</span><span class="cx">     friend class TrackDisplayUpdateScope;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-    RefPtr&lt;MediaKeys&gt; m_mediaKeys;
</del><ins>+    RefPtr&lt;WebKitMediaKeys&gt; m_mediaKeys;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;MediaElementSession&gt; m_mediaSession;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.idl        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -91,8 +91,8 @@
</span><span class="cx">     [Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitAudioDecodedByteCount;
</span><span class="cx">     [Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitVideoDecodedByteCount;
</span><span class="cx"> 
</span><del>-    [Conditional=LEGACY_ENCRYPTED_MEDIA, ImplementedAs=keys] readonly attribute MediaKeys webkitKeys;
-    [Conditional=LEGACY_ENCRYPTED_MEDIA, ImplementedAs=setMediaKeys] void webkitSetMediaKeys(MediaKeys? mediaKeys);
</del><ins>+    [Conditional=LEGACY_ENCRYPTED_MEDIA] readonly attribute WebKitMediaKeys webkitKeys;
+    [Conditional=LEGACY_ENCRYPTED_MEDIA] void webkitSetMediaKeys(WebKitMediaKeys? mediaKeys);
</ins><span class="cx"> 
</span><span class="cx">     [Conditional=VIDEO_TRACK, MayThrowLegacyException] 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="trunkSourceWebCorehtmlMediaKeyErrorh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/MediaKeyError.h (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaKeyError.h        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/html/MediaKeyError.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef MediaKeyError_h
-#define MediaKeyError_h
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &lt;runtime/Uint8Array.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-
-namespace WebCore {
-
-class MediaKeyError : public RefCounted&lt;MediaKeyError&gt; {
-public:
-    enum {
-        MEDIA_KEYERR_UNKNOWN = 1,
-        MEDIA_KEYERR_CLIENT,
-        MEDIA_KEYERR_SERVICE,
-        MEDIA_KEYERR_OUTPUT,
-        MEDIA_KEYERR_HARDWARECHANGE,
-        MEDIA_KEYERR_DOMAIN
-    };
-    typedef unsigned short Code;
-
-    static Ref&lt;MediaKeyError&gt; create(Code code, uint32_t systemCode = 0) { return adoptRef(*new MediaKeyError(code, systemCode)); }
-
-    Code code() const { return m_code; }
-    uint32_t systemCode() { return m_systemCode; }
-
-private:
-    explicit MediaKeyError(Code code, unsigned long systemCode) : m_code(code), m_systemCode(systemCode) { }
-
-    Code m_code;
-    unsigned long m_systemCode;
-};
-
-} // namespace WebCore
-
-#endif
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaKeyErroridl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/MediaKeyError.idl (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaKeyError.idl        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/html/MediaKeyError.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -1,39 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-[
-    Conditional=LEGACY_ENCRYPTED_MEDIA,
-    ImplementationLacksVTable,
-    InterfaceName=WebKitMediaKeyError
-] interface MediaKeyError {
-    const unsigned short MEDIA_KEYERR_UNKNOWN = 1;
-    const unsigned short MEDIA_KEYERR_CLIENT = 2;
-    const unsigned short MEDIA_KEYERR_SERVICE = 3;
-    const unsigned short MEDIA_KEYERR_OUTPUT = 4;
-    const unsigned short MEDIA_KEYERR_HARDWARECHANGE = 5;
-    const unsigned short MEDIA_KEYERR_DOMAIN = 6;
-    readonly attribute unsigned short code;
-    [Conditional=LEGACY_ENCRYPTED_MEDIA] readonly attribute unsigned long systemCode;
-};
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlWebKitMediaKeyErrorhfromrev206982trunkSourceWebCorehtmlMediaKeyErrorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/WebKitMediaKeyError.h (from rev 206982, trunk/Source/WebCore/html/MediaKeyError.h) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/WebKitMediaKeyError.h                                (rev 0)
+++ trunk/Source/WebCore/html/WebKitMediaKeyError.h        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WebKitMediaKeyError_h
+#define WebKitMediaKeyError_h
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &lt;runtime/Uint8Array.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+
+namespace WebCore {
+
+class WebKitMediaKeyError : public RefCounted&lt;WebKitMediaKeyError&gt; {
+public:
+    enum {
+        MEDIA_KEYERR_UNKNOWN = 1,
+        MEDIA_KEYERR_CLIENT,
+        MEDIA_KEYERR_SERVICE,
+        MEDIA_KEYERR_OUTPUT,
+        MEDIA_KEYERR_HARDWARECHANGE,
+        MEDIA_KEYERR_DOMAIN
+    };
+    typedef unsigned short Code;
+
+    static Ref&lt;WebKitMediaKeyError&gt; create(Code code, uint32_t systemCode = 0) { return adoptRef(*new WebKitMediaKeyError(code, systemCode)); }
+
+    Code code() const { return m_code; }
+    uint32_t systemCode() { return m_systemCode; }
+
+private:
+    explicit WebKitMediaKeyError(Code code, unsigned long systemCode) : m_code(code), m_systemCode(systemCode) { }
+
+    Code m_code;
+    unsigned long m_systemCode;
+};
+
+} // namespace WebCore
+
+#endif
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlWebKitMediaKeyErroridlfromrev206982trunkSourceWebCorehtmlMediaKeyErroridl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/WebKitMediaKeyError.idl (from rev 206982, trunk/Source/WebCore/html/MediaKeyError.idl) (0 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/WebKitMediaKeyError.idl                                (rev 0)
+++ trunk/Source/WebCore/html/WebKitMediaKeyError.idl        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+[
+    Conditional=LEGACY_ENCRYPTED_MEDIA,
+    ImplementationLacksVTable,
+] interface WebKitMediaKeyError {
+    const unsigned short MEDIA_KEYERR_UNKNOWN = 1;
+    const unsigned short MEDIA_KEYERR_CLIENT = 2;
+    const unsigned short MEDIA_KEYERR_SERVICE = 3;
+    const unsigned short MEDIA_KEYERR_OUTPUT = 4;
+    const unsigned short MEDIA_KEYERR_HARDWARECHANGE = 5;
+    const unsigned short MEDIA_KEYERR_DOMAIN = 6;
+    readonly attribute unsigned short code;
+    readonly attribute unsigned long systemCode;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingMockCDMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/MockCDM.cpp (206982 => 206983)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/MockCDM.cpp        2016-10-10 06:19:12 UTC (rev 206982)
+++ trunk/Source/WebCore/testing/MockCDM.cpp        2016-10-10 06:21:52 UTC (rev 206983)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CDM.h&quot;
</span><span class="cx"> #include &quot;CDMSession.h&quot;
</span><del>-#include &quot;MediaKeyError.h&quot;
</del><ins>+#include &quot;WebKitMediaKeyError.h&quot;
</ins><span class="cx"> #include &lt;runtime/JSCInlines.h&gt;
</span><span class="cx"> #include &lt;runtime/TypedArrayInlines.h&gt;
</span><span class="cx"> #include &lt;runtime/Uint8Array.h&gt;
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx"> {
</span><span class="cx">     for (unsigned i = 0; i &lt; initDataPrefix()-&gt;length(); ++i) {
</span><span class="cx">         if (!initData || i &gt;= initData-&gt;length() || initData-&gt;item(i) != initDataPrefix()-&gt;item(i)) {
</span><del>-            errorCode = MediaKeyError::MEDIA_KEYERR_UNKNOWN;
</del><ins>+            errorCode = WebKitMediaKeyError::MEDIA_KEYERR_UNKNOWN;
</ins><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> {
</span><span class="cx">     for (unsigned i = 0; i &lt; keyPrefix()-&gt;length(); ++i) {
</span><span class="cx">         if (i &gt;= key-&gt;length() || key-&gt;item(i) != keyPrefix()-&gt;item(i)) {
</span><del>-            errorCode = MediaKeyError::MEDIA_KEYERR_CLIENT;
</del><ins>+            errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
</ins><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>