<!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>[209936] trunk/Source/WebCore</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/209936">209936</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2016-12-16 13:52:38 -0800 (Fri, 16 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move existing CDM* implementations into modules/encryptedmedia/legacy
https://bugs.webkit.org/show_bug.cgi?id=165823

Rubber-stamped by Sam Weinig.

* Modules/encryptedmedia/legacy/LegacyCDM.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.cpp.
(WebCore::CDMFactory::CDMFactory):
(WebCore::installedCDMFactories):
(WebCore::CDM::registerCDMFactory):
(WebCore::CDMFactoryForKeySystem):
(WebCore::CDM::supportsKeySystem):
(WebCore::CDM::keySystemSupportsMimeType):
(WebCore::CDM::create):
(WebCore::CDM::CDM):
(WebCore::CDM::~CDM):
(WebCore::CDM::supportsMIMEType):
(WebCore::CDM::createSession):
(WebCore::CDM::mediaPlayer):
* Modules/encryptedmedia/legacy/LegacyCDM.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.h.
(WebCore::CDMClient::~CDMClient):
(WebCore::CDM::keySystem):
(WebCore::CDM::client):
(WebCore::CDM::setClient):
* Modules/encryptedmedia/legacy/LegacyCDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
(WebCore::CDMPrivateInterface::CDMPrivateInterface):
(WebCore::CDMPrivateInterface::~CDMPrivateInterface):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp.
(WebCore::CDMPrivateClearKey::supportsKeySystem):
(WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType):
(WebCore::CDMPrivateClearKey::supportsMIMEType):
(WebCore::CDMPrivateClearKey::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h.
(WebCore::CDMPrivateClearKey::CDMPrivateClearKey):
(WebCore::CDMPrivateClearKey::~CDMPrivateClearKey):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp.
(WebCore::CDMPrivateMediaPlayer::supportsKeySystem):
(WebCore::CDMPrivateMediaPlayer::supportsKeySystemAndMimeType):
(WebCore::CDMPrivateMediaPlayer::supportsMIMEType):
(WebCore::CDMPrivateMediaPlayer::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h.
(WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::~CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::cdm):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp.
(WebCore::clearKeyVM):
(WebCore::CDMSessionClearKey::CDMSessionClearKey):
(WebCore::CDMSessionClearKey::~CDMSessionClearKey):
(WebCore::CDMSessionClearKey::generateKeyRequest):
(WebCore::CDMSessionClearKey::releaseKeys):
(WebCore::CDMSessionClearKey::update):
(WebCore::CDMSessionClearKey::cachedKeyForKeyID):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/LegacyCDMSession.h: Renamed from Source/WebCore/platform/graphics/CDMSession.h.
(WebCore::CDMSessionClient::~CDMSessionClient):
(WebCore::CDMSession::CDMSession):
(WebCore::CDMSession::~CDMSession):
(WebCore::CDMSession::type):
(WebCore::CDMSession::cachedKeyForKeyID):
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* testing/Internals.cpp:
* testing/LegacyMockCDM.cpp: Renamed from Source/WebCore/testing/MockCDM.cpp.
(WebCore::MockCDMSession::~MockCDMSession):
(WebCore::MockCDM::supportsKeySystem):
(WebCore::MockCDM::supportsKeySystemAndMimeType):
(WebCore::MockCDM::supportsMIMEType):
(WebCore::MockCDM::createSession):
(WebCore::initDataPrefix):
(WebCore::keyPrefix):
(WebCore::keyRequest):
(WebCore::generateSessionId):
(WebCore::MockCDMSession::MockCDMSession):
(WebCore::MockCDMSession::generateKeyRequest):
(WebCore::MockCDMSession::releaseKeys):
(WebCore::MockCDMSession::update):
* testing/LegacyMockCDM.h: Renamed from Source/WebCore/testing/MockCDM.h.
(WebCore::MockCDM::MockCDM):
(WebCore::MockCDM::~MockCDM):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeysh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationCDMPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationCDMPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVContentKeySessionmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVStreamSessionmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMcpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivateh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivateClearKeycpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivateClearKeyh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivateMediaPlayercpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivateMediaPlayerh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMSessionClearKeycpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMSessionClearKeyh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsLegacyCDMSessionh">trunk/Source/WebCore/platform/graphics/LegacyCDMSession.h</a></li>
<li><a href="#trunkSourceWebCoretestingLegacyMockCDMcpp">trunk/Source/WebCore/testing/LegacyMockCDM.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingLegacyMockCDMh">trunk/Source/WebCore/testing/LegacyMockCDM.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMcpp">trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMh">trunk/Source/WebCore/Modules/encryptedmedia/CDM.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMPrivateh">trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMPrivateClearKeycpp">trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMPrivateClearKeyh">trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMPrivateMediaPlayercpp">trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMPrivateMediaPlayerh">trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeycpp">trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeyh">trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsCDMSessionh">trunk/Source/WebCore/platform/graphics/CDMSession.h</a></li>
<li><a href="#trunkSourceWebCoretestingMockCDMcpp">trunk/Source/WebCore/testing/MockCDM.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingMockCDMh">trunk/Source/WebCore/testing/MockCDM.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/ChangeLog        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,3 +1,93 @@
</span><ins>+2016-12-13  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        Move existing CDM* implementations into modules/encryptedmedia/legacy
+        https://bugs.webkit.org/show_bug.cgi?id=165823
+
+        Rubber-stamped by Sam Weinig.
+
+        * Modules/encryptedmedia/legacy/LegacyCDM.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.cpp.
+        (WebCore::CDMFactory::CDMFactory):
+        (WebCore::installedCDMFactories):
+        (WebCore::CDM::registerCDMFactory):
+        (WebCore::CDMFactoryForKeySystem):
+        (WebCore::CDM::supportsKeySystem):
+        (WebCore::CDM::keySystemSupportsMimeType):
+        (WebCore::CDM::create):
+        (WebCore::CDM::CDM):
+        (WebCore::CDM::~CDM):
+        (WebCore::CDM::supportsMIMEType):
+        (WebCore::CDM::createSession):
+        (WebCore::CDM::mediaPlayer):
+        * Modules/encryptedmedia/legacy/LegacyCDM.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.h.
+        (WebCore::CDMClient::~CDMClient):
+        (WebCore::CDM::keySystem):
+        (WebCore::CDM::client):
+        (WebCore::CDM::setClient):
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
+        (WebCore::CDMPrivateInterface::CDMPrivateInterface):
+        (WebCore::CDMPrivateInterface::~CDMPrivateInterface):
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp.
+        (WebCore::CDMPrivateClearKey::supportsKeySystem):
+        (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType):
+        (WebCore::CDMPrivateClearKey::supportsMIMEType):
+        (WebCore::CDMPrivateClearKey::createSession):
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h.
+        (WebCore::CDMPrivateClearKey::CDMPrivateClearKey):
+        (WebCore::CDMPrivateClearKey::~CDMPrivateClearKey):
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp.
+        (WebCore::CDMPrivateMediaPlayer::supportsKeySystem):
+        (WebCore::CDMPrivateMediaPlayer::supportsKeySystemAndMimeType):
+        (WebCore::CDMPrivateMediaPlayer::supportsMIMEType):
+        (WebCore::CDMPrivateMediaPlayer::createSession):
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h.
+        (WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
+        (WebCore::CDMPrivateMediaPlayer::~CDMPrivateMediaPlayer):
+        (WebCore::CDMPrivateMediaPlayer::cdm):
+        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp.
+        (WebCore::clearKeyVM):
+        (WebCore::CDMSessionClearKey::CDMSessionClearKey):
+        (WebCore::CDMSessionClearKey::~CDMSessionClearKey):
+        (WebCore::CDMSessionClearKey::generateKeyRequest):
+        (WebCore::CDMSessionClearKey::releaseKeys):
+        (WebCore::CDMSessionClearKey::update):
+        (WebCore::CDMSessionClearKey::cachedKeyForKeyID):
+        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h.
+        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
+        * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/LegacyCDMSession.h: Renamed from Source/WebCore/platform/graphics/CDMSession.h.
+        (WebCore::CDMSessionClient::~CDMSessionClient):
+        (WebCore::CDMSession::CDMSession):
+        (WebCore::CDMSession::~CDMSession):
+        (WebCore::CDMSession::type):
+        (WebCore::CDMSession::cachedKeyForKeyID):
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
+        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
+        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
+        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
+        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
+        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
+        * testing/Internals.cpp:
+        * testing/LegacyMockCDM.cpp: Renamed from Source/WebCore/testing/MockCDM.cpp.
+        (WebCore::MockCDMSession::~MockCDMSession):
+        (WebCore::MockCDM::supportsKeySystem):
+        (WebCore::MockCDM::supportsKeySystemAndMimeType):
+        (WebCore::MockCDM::supportsMIMEType):
+        (WebCore::MockCDM::createSession):
+        (WebCore::initDataPrefix):
+        (WebCore::keyPrefix):
+        (WebCore::keyRequest):
+        (WebCore::generateSessionId):
+        (WebCore::MockCDMSession::MockCDMSession):
+        (WebCore::MockCDMSession::generateKeyRequest):
+        (WebCore::MockCDMSession::releaseKeys):
+        (WebCore::MockCDMSession::update):
+        * testing/LegacyMockCDM.h: Renamed from Source/WebCore/testing/MockCDM.h.
+        (WebCore::MockCDM::MockCDM):
+        (WebCore::MockCDM::~MockCDM):
+
</ins><span class="cx"> 2016-12-16  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Subframes going into page cache don't need to resetScrollbars().
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,151 +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;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDM.h&quot;
-
-#include &quot;CDMPrivateClearKey.h&quot;
-#include &quot;CDMPrivateMediaPlayer.h&quot;
-#include &quot;CDMSession.h&quot;
-#include &quot;MediaPlayer.h&quot;
-#include &quot;WebKitMediaKeys.h&quot;
-#include &lt;wtf/NeverDestroyed.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-#if PLATFORM(MAC) &amp;&amp; ENABLE(MEDIA_SOURCE)
-#include &quot;CDMPrivateMediaSourceAVFObjC.h&quot;
-#endif
-
-namespace WebCore {
-
-struct CDMFactory {
-    WTF_MAKE_NONCOPYABLE(CDMFactory); WTF_MAKE_FAST_ALLOCATED;
-public:
-    CDMFactory(CreateCDM constructor, CDMSupportsKeySystem supportsKeySystem, CDMSupportsKeySystemAndMimeType supportsKeySystemAndMimeType)
-        : constructor(constructor)
-        , supportsKeySystem(supportsKeySystem)
-        , supportsKeySystemAndMimeType(supportsKeySystemAndMimeType)
-    {
-    }
-
-    CreateCDM constructor;
-    CDMSupportsKeySystem supportsKeySystem;
-    CDMSupportsKeySystemAndMimeType supportsKeySystemAndMimeType;
-};
-
-static Vector&lt;CDMFactory*&gt;&amp; installedCDMFactories()
-{
-    static NeverDestroyed&lt;Vector&lt;CDMFactory*&gt;&gt; cdms;
-    static bool queriedCDMs = false;
-    if (!queriedCDMs) {
-        queriedCDMs = true;
-
-        cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique&lt;CDMPrivateClearKey&gt;(cdm); },
-            CDMPrivateClearKey::supportsKeySystem, CDMPrivateClearKey::supportsKeySystemAndMimeType));
-
-        // FIXME: initialize specific UA CDMs. http://webkit.org/b/109318, http://webkit.org/b/109320
-        cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique&lt;CDMPrivateMediaPlayer&gt;(cdm); },
-            CDMPrivateMediaPlayer::supportsKeySystem, CDMPrivateMediaPlayer::supportsKeySystemAndMimeType));
-
-#if PLATFORM(MAC) &amp;&amp; ENABLE(MEDIA_SOURCE)
-        cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique&lt;CDMPrivateMediaSourceAVFObjC&gt;(cdm); },
-            CDMPrivateMediaSourceAVFObjC::supportsKeySystem, CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType));
-#endif
-    }
-
-    return cdms;
-}
-
-void CDM::registerCDMFactory(CreateCDM constructor, CDMSupportsKeySystem supportsKeySystem, CDMSupportsKeySystemAndMimeType supportsKeySystemAndMimeType)
-{
-    installedCDMFactories().append(new CDMFactory(constructor, supportsKeySystem, supportsKeySystemAndMimeType));
-}
-
-static CDMFactory* CDMFactoryForKeySystem(const String&amp; keySystem)
-{
-    for (auto&amp; factory : installedCDMFactories()) {
-        if (factory-&gt;supportsKeySystem(keySystem))
-            return factory;
-    }
-    return 0;
-}
-
-bool CDM::supportsKeySystem(const String&amp; keySystem)
-{
-    return CDMFactoryForKeySystem(keySystem);
-}
-
-bool CDM::keySystemSupportsMimeType(const String&amp; keySystem, const String&amp; mimeType)
-{
-    if (CDMFactory* factory = CDMFactoryForKeySystem(keySystem))
-        return factory-&gt;supportsKeySystemAndMimeType(keySystem, mimeType);
-    return false;
-}
-
-std::unique_ptr&lt;CDM&gt; CDM::create(const String&amp; keySystem)
-{
-    if (!supportsKeySystem(keySystem))
-        return nullptr;
-
-    return std::make_unique&lt;CDM&gt;(keySystem);
-}
-
-CDM::CDM(const String&amp; keySystem)
-    : m_keySystem(keySystem)
-    , m_client(nullptr)
-{
-    m_private = CDMFactoryForKeySystem(keySystem)-&gt;constructor(this);
-}
-
-CDM::~CDM()
-{
-}
-
-bool CDM::supportsMIMEType(const String&amp; mimeType) const
-{
-    return m_private-&gt;supportsMIMEType(mimeType);
-}
-
-std::unique_ptr&lt;CDMSession&gt; CDM::createSession(CDMSessionClient&amp; client)
-{
-    auto session = m_private-&gt;createSession(&amp;client);
-    if (mediaPlayer())
-        mediaPlayer()-&gt;setCDMSession(session.get());
-    return session;
-}
-
-MediaPlayer* CDM::mediaPlayer() const
-{
-    if (!m_client)
-        return 0;
-    return m_client-&gt;cdmMediaPlayer(this);
-}
-
-}
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDM.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,81 +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.
- */
-
-#pragma once
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDMSession.h&quot;
-#include &lt;runtime/Uint8Array.h&gt;
-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-class CDM;
-class CDMPrivateInterface;
-class MediaPlayer;
-
-typedef std::function&lt;std::unique_ptr&lt;CDMPrivateInterface&gt; (CDM*)&gt; CreateCDM;
-typedef bool (*CDMSupportsKeySystem)(const String&amp;);
-typedef bool (*CDMSupportsKeySystemAndMimeType)(const String&amp;, const String&amp;);
-
-class CDMClient {
-public:
-    virtual ~CDMClient() { }
-
-    virtual MediaPlayer* cdmMediaPlayer(const CDM*) const = 0;
-};
-
-class CDM {
-public:
-    explicit CDM(const String&amp; keySystem);
-
-    enum CDMErrorCode { NoError, UnknownError, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
-    static bool supportsKeySystem(const String&amp;);
-    static bool keySystemSupportsMimeType(const String&amp; keySystem, const String&amp; mimeType);
-    static std::unique_ptr&lt;CDM&gt; create(const String&amp; keySystem);
-    WEBCORE_EXPORT static void registerCDMFactory(CreateCDM, CDMSupportsKeySystem, CDMSupportsKeySystemAndMimeType);
-    ~CDM();
-
-    bool supportsMIMEType(const String&amp;) const;
-    std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient&amp;);
-
-    const String&amp; keySystem() const { return m_keySystem; }
-
-    CDMClient* client() const { return m_client; }
-    void setClient(CDMClient* client) { m_client = client; }
-
-    MediaPlayer* mediaPlayer() const;
-
-private:
-    String m_keySystem;
-    std::unique_ptr&lt;CDMPrivateInterface&gt; m_private;
-    CDMClient* m_client;
-};
-
-}
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,49 +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.
- */
-
-#pragma once
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-class CDMSession;
-class CDMSessionClient;
-
-class CDMPrivateInterface {
-public:
-    CDMPrivateInterface() { }
-    virtual ~CDMPrivateInterface() { }
-
-    virtual bool supportsMIMEType(const String&amp;) = 0;
-
-    virtual std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient*) = 0;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateClearKeycpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,68 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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;CDMPrivateClearKey.h&quot;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDM.h&quot;
-#include &quot;CDMSessionClearKey.h&quot;
-#include &quot;ContentType.h&quot;
-#include &quot;MediaPlayer.h&quot;
-
-namespace WebCore {
-
-bool CDMPrivateClearKey::supportsKeySystem(const String&amp; keySystem)
-{
-    if (!equalLettersIgnoringASCIICase(keySystem, &quot;org.w3c.clearkey&quot;))
-        return false;
-
-    // The MediaPlayer must also support the key system:
-    return MediaPlayer::supportsKeySystem(keySystem, emptyString());
-}
-
-bool CDMPrivateClearKey::supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType)
-{
-    if (!equalLettersIgnoringASCIICase(keySystem, &quot;org.w3c.clearkey&quot;))
-        return false;
-
-    // The MediaPlayer must also support the key system:
-    return MediaPlayer::supportsKeySystem(keySystem, mimeType);
-}
-
-bool CDMPrivateClearKey::supportsMIMEType(const String&amp; mimeType)
-{
-    return MediaPlayer::supportsKeySystem(m_cdm-&gt;keySystem(), mimeType);
-}
-
-std::unique_ptr&lt;CDMSession&gt; CDMPrivateClearKey::createSession(CDMSessionClient* client)
-{
-    return std::make_unique&lt;CDMSessionClearKey&gt;(client);
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateClearKeyh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,57 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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.
- */
-
-#pragma once
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDMPrivate.h&quot;
-
-namespace WebCore {
-
-class CDM;
-
-class CDMPrivateClearKey : public CDMPrivateInterface {
-public:
-    explicit CDMPrivateClearKey(CDM* cdm)
-        : m_cdm(cdm)
-    {
-    }
-
-    virtual ~CDMPrivateClearKey() { }
-
-    static bool supportsKeySystem(const String&amp;);
-    static bool supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType);
-
-    bool supportsMIMEType(const String&amp; mimeType) override;
-    std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient*) override;
-
-protected:
-    CDM* m_cdm;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateMediaPlayercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,68 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 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;CDMPrivateMediaPlayer.h&quot;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDM.h&quot;
-#include &quot;CDMSession.h&quot;
-#include &quot;ContentType.h&quot;
-#include &quot;MediaPlayer.h&quot;
-
-#if PLATFORM(IOS)
-#include &quot;SoftLinking.h&quot;
-#endif
-
-namespace WebCore {
-
-bool CDMPrivateMediaPlayer::supportsKeySystem(const String&amp; keySystem)
-{
-    return MediaPlayer::supportsKeySystem(keySystem, emptyString());
-}
-
-bool CDMPrivateMediaPlayer::supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType)
-{
-    return MediaPlayer::supportsKeySystem(keySystem, mimeType);
-}
-
-bool CDMPrivateMediaPlayer::supportsMIMEType(const String&amp; mimeType)
-{
-    return MediaPlayer::supportsKeySystem(m_cdm-&gt;keySystem(), mimeType);
-}
-
-std::unique_ptr&lt;CDMSession&gt; CDMPrivateMediaPlayer::createSession(CDMSessionClient* client)
-{
-    MediaPlayer* mediaPlayer = m_cdm-&gt;mediaPlayer();
-    if (!mediaPlayer)
-        return nullptr;
-
-    return mediaPlayer-&gt;createSession(m_cdm-&gt;keySystem(), client);
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateMediaPlayerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,58 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 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.
- */
-
-#pragma once
-
-#include &quot;CDMPrivate.h&quot;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-namespace WebCore {
-
-class CDM;
-
-class CDMPrivateMediaPlayer : public CDMPrivateInterface {
-public:
-    explicit CDMPrivateMediaPlayer(CDM* cdm)
-        : m_cdm(cdm)
-    { }
-
-    static bool supportsKeySystem(const String&amp;);
-    static bool supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType);
-
-    virtual ~CDMPrivateMediaPlayer() { }
-
-    bool supportsMIMEType(const String&amp; mimeType) override;
-    std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient*) override;
-
-    CDM* cdm() const { return m_cdm; }
-
-protected:
-    CDM* m_cdm;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeycpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,191 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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;CDMSessionClearKey.h&quot;
-
-#include &quot;ArrayValue.h&quot;
-#include &quot;Dictionary.h&quot;
-#include &quot;JSMainThreadExecState.h&quot;
-#include &quot;Logging.h&quot;
-#include &quot;TextEncoding.h&quot;
-#include &quot;UUID.h&quot;
-#include &quot;WebKitMediaKeyError.h&quot;
-#include &lt;runtime/JSGlobalObject.h&gt;
-#include &lt;runtime/JSLock.h&gt;
-#include &lt;runtime/JSONObject.h&gt;
-#include &lt;runtime/VM.h&gt;
-#include &lt;wtf/NeverDestroyed.h&gt;
-#include &lt;wtf/text/Base64.h&gt;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-using namespace JSC;
-
-namespace WebCore {
-
-static VM&amp; clearKeyVM()
-{
-    static NeverDestroyed&lt;RefPtr&lt;VM&gt;&gt; vm;
-    if (!vm.get())
-        vm.get() = VM::create();
-
-    return *vm.get();
-}
-
-CDMSessionClearKey::CDMSessionClearKey(CDMSessionClient* client)
-    : m_client(client)
-    , m_sessionId(createCanonicalUUIDString())
-{
-}
-
-CDMSessionClearKey::~CDMSessionClearKey()
-{
-}
-
-RefPtr&lt;Uint8Array&gt; CDMSessionClearKey::generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, uint32_t&amp; systemCode)
-{
-    UNUSED_PARAM(mimeType);
-    UNUSED_PARAM(destinationURL);
-    UNUSED_PARAM(systemCode);
-
-    if (!initData) {
-        errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
-        return nullptr;
-    }
-    m_initData = initData;
-
-    bool sawError = false;
-    String keyID = UTF8Encoding().decode(reinterpret_cast_ptr&lt;char*&gt;(m_initData-&gt;baseAddress()), m_initData-&gt;byteLength(), true, sawError);
-    if (sawError) {
-        errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
-        return nullptr;
-    }
-
-    return initData;
-}
-
-void CDMSessionClearKey::releaseKeys()
-{
-    m_cachedKeys.clear();
-}
-
-bool CDMSessionClearKey::update(Uint8Array* rawKeysData, RefPtr&lt;Uint8Array&gt;&amp; nextMessage, unsigned short&amp; errorCode, uint32_t&amp; systemCode)
-{
-    UNUSED_PARAM(nextMessage);
-    UNUSED_PARAM(systemCode);
-    ASSERT(rawKeysData);
-
-    do {
-        String rawKeysString = String::fromUTF8(rawKeysData-&gt;data(), rawKeysData-&gt;length());
-        if (rawKeysString.isEmpty())  {
-            LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: empty message&quot;, this);
-            continue;
-        }
-
-        VM&amp; vm = clearKeyVM();
-        JSLockHolder lock(vm);
-        auto scope = DECLARE_THROW_SCOPE(vm);
-        JSGlobalObject* globalObject = JSGlobalObject::create(vm, JSGlobalObject::createStructure(vm, jsNull()));
-        ExecState* exec = globalObject-&gt;globalExec();
-
-        JSLockHolder locker(clearKeyVM());
-        JSValue keysDataObject = JSONParse(exec, rawKeysString);
-        if (scope.exception() || !keysDataObject) {
-            LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: invalid JSON&quot;, this);
-            break;
-        }
-        Dictionary keysDataDictionary(exec, keysDataObject);
-        ArrayValue keysArray;
-        size_t length;
-        if (!keysDataDictionary.get(&quot;keys&quot;, keysArray) || keysArray.isUndefinedOrNull() || !keysArray.length(length) || !length) {
-            LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: keys array missing or empty&quot;, this);
-            break;
-        }
-
-        bool foundValidKey = false;
-        for (size_t i = 0; i &lt; length; ++i) {
-            Dictionary keyDictionary;
-            if (!keysArray.get(i, keyDictionary) || keyDictionary.isUndefinedOrNull()) {
-                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: null keyDictionary&quot;, this);
-                continue;
-            }
-
-            String algorithm;
-            if (!keyDictionary.get(&quot;alg&quot;, algorithm) || !equalLettersIgnoringASCIICase(algorithm, &quot;a128kw&quot;)) {
-                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: algorithm unsupported&quot;, this);
-                continue;
-            }
-
-            String keyType;
-            if (!keyDictionary.get(&quot;kty&quot;, keyType) || !equalLettersIgnoringASCIICase(keyType, &quot;oct&quot;)) {
-                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: keyType unsupported&quot;, this);
-                continue;
-            }
-
-            String keyId;
-            if (!keyDictionary.get(&quot;kid&quot;, keyId) || keyId.isEmpty()) {
-                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: keyId missing or empty&quot;, this);
-                continue;
-            }
-
-            String rawKeyData;
-            if (!keyDictionary.get(&quot;k&quot;, rawKeyData) || rawKeyData.isEmpty())  {
-                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: key missing or empty&quot;, this);
-                continue;
-            }
-
-            Vector&lt;uint8_t&gt; keyData;
-            if (!base64Decode(rawKeyData, keyData) ||  keyData.isEmpty()) {
-                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: unable to base64 decode key&quot;, this);
-                continue;
-            }
-
-            m_cachedKeys.set(keyId, WTFMove(keyData));
-            foundValidKey = true;
-        }
-
-        if (foundValidKey)
-            return true;
-
-    } while (false);
-
-    errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
-    return false;
-}
-
-RefPtr&lt;ArrayBuffer&gt; CDMSessionClearKey::cachedKeyForKeyID(const String&amp; keyId) const
-{
-    if (!m_cachedKeys.contains(keyId))
-        return nullptr;
-
-    auto keyData = m_cachedKeys.get(keyId);
-    RefPtr&lt;Uint8Array&gt; keyDataArray = Uint8Array::create(keyData.data(), keyData.size());
-    return keyDataArray-&gt;unsharedBuffer();
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeyh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,58 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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.
- */
-
-#pragma once
-
-#include &quot;CDMSession.h&quot;
-#include &lt;wtf/HashMap.h&gt;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-namespace WebCore {
-
-class CDMSessionClearKey : public CDMSession {
-public:
-    CDMSessionClearKey(CDMSessionClient*);
-    virtual ~CDMSessionClearKey();
-
-    // CDMSessionPrivate
-    CDMSessionType type() override { return CDMSessionTypeClearKey; }
-    void setClient(CDMSessionClient* client) override { m_client = client; }
-    const String&amp; sessionId() const override { return m_sessionId; }
-    RefPtr&lt;Uint8Array&gt; generateKeyRequest(const String&amp; mimeType, Uint8Array*, String&amp;, unsigned short&amp;, uint32_t&amp;) override;
-    void releaseKeys() override;
-    bool update(Uint8Array*, RefPtr&lt;Uint8Array&gt;&amp;, unsigned short&amp;, uint32_t&amp;) override;
-    RefPtr&lt;ArrayBuffer&gt; cachedKeyForKeyID(const String&amp;) const override;
-
-protected:
-    CDMSessionClient* m_client;
-    RefPtr&lt;Uint8Array&gt; m_initData;
-    HashMap&lt;String, Vector&lt;uint8_t&gt;&gt; m_cachedKeys;
-    String m_sessionId;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMcppfromrev209935trunkSourceWebCoreModulesencryptedmediaCDMcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.cpp (from rev 209935, trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,151 @@
</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;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;LegacyCDM.h&quot;
+
+#include &quot;LegacyCDMPrivateClearKey.h&quot;
+#include &quot;LegacyCDMPrivateMediaPlayer.h&quot;
+#include &quot;LegacyCDMSession.h&quot;
+#include &quot;MediaPlayer.h&quot;
+#include &quot;WebKitMediaKeys.h&quot;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+#if PLATFORM(MAC) &amp;&amp; ENABLE(MEDIA_SOURCE)
+#include &quot;CDMPrivateMediaSourceAVFObjC.h&quot;
+#endif
+
+namespace WebCore {
+
+struct CDMFactory {
+    WTF_MAKE_NONCOPYABLE(CDMFactory); WTF_MAKE_FAST_ALLOCATED;
+public:
+    CDMFactory(CreateCDM constructor, CDMSupportsKeySystem supportsKeySystem, CDMSupportsKeySystemAndMimeType supportsKeySystemAndMimeType)
+        : constructor(constructor)
+        , supportsKeySystem(supportsKeySystem)
+        , supportsKeySystemAndMimeType(supportsKeySystemAndMimeType)
+    {
+    }
+
+    CreateCDM constructor;
+    CDMSupportsKeySystem supportsKeySystem;
+    CDMSupportsKeySystemAndMimeType supportsKeySystemAndMimeType;
+};
+
+static Vector&lt;CDMFactory*&gt;&amp; installedCDMFactories()
+{
+    static NeverDestroyed&lt;Vector&lt;CDMFactory*&gt;&gt; cdms;
+    static bool queriedCDMs = false;
+    if (!queriedCDMs) {
+        queriedCDMs = true;
+
+        cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique&lt;CDMPrivateClearKey&gt;(cdm); },
+            CDMPrivateClearKey::supportsKeySystem, CDMPrivateClearKey::supportsKeySystemAndMimeType));
+
+        // FIXME: initialize specific UA CDMs. http://webkit.org/b/109318, http://webkit.org/b/109320
+        cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique&lt;CDMPrivateMediaPlayer&gt;(cdm); },
+            CDMPrivateMediaPlayer::supportsKeySystem, CDMPrivateMediaPlayer::supportsKeySystemAndMimeType));
+
+#if PLATFORM(MAC) &amp;&amp; ENABLE(MEDIA_SOURCE)
+        cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique&lt;CDMPrivateMediaSourceAVFObjC&gt;(cdm); },
+            CDMPrivateMediaSourceAVFObjC::supportsKeySystem, CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType));
+#endif
+    }
+
+    return cdms;
+}
+
+void CDM::registerCDMFactory(CreateCDM constructor, CDMSupportsKeySystem supportsKeySystem, CDMSupportsKeySystemAndMimeType supportsKeySystemAndMimeType)
+{
+    installedCDMFactories().append(new CDMFactory(constructor, supportsKeySystem, supportsKeySystemAndMimeType));
+}
+
+static CDMFactory* CDMFactoryForKeySystem(const String&amp; keySystem)
+{
+    for (auto&amp; factory : installedCDMFactories()) {
+        if (factory-&gt;supportsKeySystem(keySystem))
+            return factory;
+    }
+    return 0;
+}
+
+bool CDM::supportsKeySystem(const String&amp; keySystem)
+{
+    return CDMFactoryForKeySystem(keySystem);
+}
+
+bool CDM::keySystemSupportsMimeType(const String&amp; keySystem, const String&amp; mimeType)
+{
+    if (CDMFactory* factory = CDMFactoryForKeySystem(keySystem))
+        return factory-&gt;supportsKeySystemAndMimeType(keySystem, mimeType);
+    return false;
+}
+
+std::unique_ptr&lt;CDM&gt; CDM::create(const String&amp; keySystem)
+{
+    if (!supportsKeySystem(keySystem))
+        return nullptr;
+
+    return std::make_unique&lt;CDM&gt;(keySystem);
+}
+
+CDM::CDM(const String&amp; keySystem)
+    : m_keySystem(keySystem)
+    , m_client(nullptr)
+{
+    m_private = CDMFactoryForKeySystem(keySystem)-&gt;constructor(this);
+}
+
+CDM::~CDM()
+{
+}
+
+bool CDM::supportsMIMEType(const String&amp; mimeType) const
+{
+    return m_private-&gt;supportsMIMEType(mimeType);
+}
+
+std::unique_ptr&lt;CDMSession&gt; CDM::createSession(CDMSessionClient&amp; client)
+{
+    auto session = m_private-&gt;createSession(&amp;client);
+    if (mediaPlayer())
+        mediaPlayer()-&gt;setCDMSession(session.get());
+    return session;
+}
+
+MediaPlayer* CDM::mediaPlayer() const
+{
+    if (!m_client)
+        return 0;
+    return m_client-&gt;cdmMediaPlayer(this);
+}
+
+}
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMhfromrev209935trunkSourceWebCoreModulesencryptedmediaCDMh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.h (from rev 209935, trunk/Source/WebCore/Modules/encryptedmedia/CDM.h) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,81 @@
</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.
+ */
+
+#pragma once
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;LegacyCDMSession.h&quot;
+#include &lt;runtime/Uint8Array.h&gt;
+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class CDM;
+class CDMPrivateInterface;
+class MediaPlayer;
+
+typedef std::function&lt;std::unique_ptr&lt;CDMPrivateInterface&gt; (CDM*)&gt; CreateCDM;
+typedef bool (*CDMSupportsKeySystem)(const String&amp;);
+typedef bool (*CDMSupportsKeySystemAndMimeType)(const String&amp;, const String&amp;);
+
+class CDMClient {
+public:
+    virtual ~CDMClient() { }
+
+    virtual MediaPlayer* cdmMediaPlayer(const CDM*) const = 0;
+};
+
+class CDM {
+public:
+    explicit CDM(const String&amp; keySystem);
+
+    enum CDMErrorCode { NoError, UnknownError, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
+    static bool supportsKeySystem(const String&amp;);
+    static bool keySystemSupportsMimeType(const String&amp; keySystem, const String&amp; mimeType);
+    static std::unique_ptr&lt;CDM&gt; create(const String&amp; keySystem);
+    WEBCORE_EXPORT static void registerCDMFactory(CreateCDM, CDMSupportsKeySystem, CDMSupportsKeySystemAndMimeType);
+    ~CDM();
+
+    bool supportsMIMEType(const String&amp;) const;
+    std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient&amp;);
+
+    const String&amp; keySystem() const { return m_keySystem; }
+
+    CDMClient* client() const { return m_client; }
+    void setClient(CDMClient* client) { m_client = client; }
+
+    MediaPlayer* mediaPlayer() const;
+
+private:
+    String m_keySystem;
+    std::unique_ptr&lt;CDMPrivateInterface&gt; m_private;
+    CDMClient* m_client;
+};
+
+}
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivatehfromrev209935trunkSourceWebCoreModulesencryptedmediaCDMPrivateh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivate.h (from rev 209935, trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivate.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivate.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,49 @@
</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.
+ */
+
+#pragma once
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class CDMSession;
+class CDMSessionClient;
+
+class CDMPrivateInterface {
+public:
+    CDMPrivateInterface() { }
+    virtual ~CDMPrivateInterface() { }
+
+    virtual bool supportsMIMEType(const String&amp;) = 0;
+
+    virtual std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient*) = 0;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivateClearKeycppfromrev209935trunkSourceWebCoreModulesencryptedmediaCDMPrivateClearKeycpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp (from rev 209935, trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2015 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;LegacyCDMPrivateClearKey.h&quot;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;LegacyCDM.h&quot;
+#include &quot;LegacyCDMSessionClearKey.h&quot;
+#include &quot;ContentType.h&quot;
+#include &quot;MediaPlayer.h&quot;
+
+namespace WebCore {
+
+bool CDMPrivateClearKey::supportsKeySystem(const String&amp; keySystem)
+{
+    if (!equalLettersIgnoringASCIICase(keySystem, &quot;org.w3c.clearkey&quot;))
+        return false;
+
+    // The MediaPlayer must also support the key system:
+    return MediaPlayer::supportsKeySystem(keySystem, emptyString());
+}
+
+bool CDMPrivateClearKey::supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType)
+{
+    if (!equalLettersIgnoringASCIICase(keySystem, &quot;org.w3c.clearkey&quot;))
+        return false;
+
+    // The MediaPlayer must also support the key system:
+    return MediaPlayer::supportsKeySystem(keySystem, mimeType);
+}
+
+bool CDMPrivateClearKey::supportsMIMEType(const String&amp; mimeType)
+{
+    return MediaPlayer::supportsKeySystem(m_cdm-&gt;keySystem(), mimeType);
+}
+
+std::unique_ptr&lt;CDMSession&gt; CDMPrivateClearKey::createSession(CDMSessionClient* client)
+{
+    return std::make_unique&lt;CDMSessionClearKey&gt;(client);
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivateClearKeyhfromrev209935trunkSourceWebCoreModulesencryptedmediaCDMPrivateClearKeyh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h (from rev 209935, trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#pragma once
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;LegacyCDMPrivate.h&quot;
+
+namespace WebCore {
+
+class CDM;
+
+class CDMPrivateClearKey : public CDMPrivateInterface {
+public:
+    explicit CDMPrivateClearKey(CDM* cdm)
+        : m_cdm(cdm)
+    {
+    }
+
+    virtual ~CDMPrivateClearKey() { }
+
+    static bool supportsKeySystem(const String&amp;);
+    static bool supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType);
+
+    bool supportsMIMEType(const String&amp; mimeType) override;
+    std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient*) override;
+
+protected:
+    CDM* m_cdm;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivateMediaPlayercppfromrev209935trunkSourceWebCoreModulesencryptedmediaCDMPrivateMediaPlayercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp (from rev 209935, trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2014 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;LegacyCDMPrivateMediaPlayer.h&quot;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;LegacyCDM.h&quot;
+#include &quot;LegacyCDMSession.h&quot;
+#include &quot;ContentType.h&quot;
+#include &quot;MediaPlayer.h&quot;
+
+#if PLATFORM(IOS)
+#include &quot;SoftLinking.h&quot;
+#endif
+
+namespace WebCore {
+
+bool CDMPrivateMediaPlayer::supportsKeySystem(const String&amp; keySystem)
+{
+    return MediaPlayer::supportsKeySystem(keySystem, emptyString());
+}
+
+bool CDMPrivateMediaPlayer::supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType)
+{
+    return MediaPlayer::supportsKeySystem(keySystem, mimeType);
+}
+
+bool CDMPrivateMediaPlayer::supportsMIMEType(const String&amp; mimeType)
+{
+    return MediaPlayer::supportsKeySystem(m_cdm-&gt;keySystem(), mimeType);
+}
+
+std::unique_ptr&lt;CDMSession&gt; CDMPrivateMediaPlayer::createSession(CDMSessionClient* client)
+{
+    MediaPlayer* mediaPlayer = m_cdm-&gt;mediaPlayer();
+    if (!mediaPlayer)
+        return nullptr;
+
+    return mediaPlayer-&gt;createSession(m_cdm-&gt;keySystem(), client);
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMPrivateMediaPlayerhfromrev209935trunkSourceWebCoreModulesencryptedmediaCDMPrivateMediaPlayerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h (from rev 209935, trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2014 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.
+ */
+
+#pragma once
+
+#include &quot;LegacyCDMPrivate.h&quot;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+namespace WebCore {
+
+class CDM;
+
+class CDMPrivateMediaPlayer : public CDMPrivateInterface {
+public:
+    explicit CDMPrivateMediaPlayer(CDM* cdm)
+        : m_cdm(cdm)
+    { }
+
+    static bool supportsKeySystem(const String&amp;);
+    static bool supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType);
+
+    virtual ~CDMPrivateMediaPlayer() { }
+
+    bool supportsMIMEType(const String&amp; mimeType) override;
+    std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient*) override;
+
+    CDM* cdm() const { return m_cdm; }
+
+protected:
+    CDM* m_cdm;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMSessionClearKeycppfromrev209935trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeycpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp (from rev 209935, trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,191 @@
</span><ins>+/*
+ * Copyright (C) 2015 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;LegacyCDMSessionClearKey.h&quot;
+
+#include &quot;ArrayValue.h&quot;
+#include &quot;Dictionary.h&quot;
+#include &quot;JSMainThreadExecState.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;TextEncoding.h&quot;
+#include &quot;UUID.h&quot;
+#include &quot;WebKitMediaKeyError.h&quot;
+#include &lt;runtime/JSGlobalObject.h&gt;
+#include &lt;runtime/JSLock.h&gt;
+#include &lt;runtime/JSONObject.h&gt;
+#include &lt;runtime/VM.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/text/Base64.h&gt;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+using namespace JSC;
+
+namespace WebCore {
+
+static VM&amp; clearKeyVM()
+{
+    static NeverDestroyed&lt;RefPtr&lt;VM&gt;&gt; vm;
+    if (!vm.get())
+        vm.get() = VM::create();
+
+    return *vm.get();
+}
+
+CDMSessionClearKey::CDMSessionClearKey(CDMSessionClient* client)
+    : m_client(client)
+    , m_sessionId(createCanonicalUUIDString())
+{
+}
+
+CDMSessionClearKey::~CDMSessionClearKey()
+{
+}
+
+RefPtr&lt;Uint8Array&gt; CDMSessionClearKey::generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, uint32_t&amp; systemCode)
+{
+    UNUSED_PARAM(mimeType);
+    UNUSED_PARAM(destinationURL);
+    UNUSED_PARAM(systemCode);
+
+    if (!initData) {
+        errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
+        return nullptr;
+    }
+    m_initData = initData;
+
+    bool sawError = false;
+    String keyID = UTF8Encoding().decode(reinterpret_cast_ptr&lt;char*&gt;(m_initData-&gt;baseAddress()), m_initData-&gt;byteLength(), true, sawError);
+    if (sawError) {
+        errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
+        return nullptr;
+    }
+
+    return initData;
+}
+
+void CDMSessionClearKey::releaseKeys()
+{
+    m_cachedKeys.clear();
+}
+
+bool CDMSessionClearKey::update(Uint8Array* rawKeysData, RefPtr&lt;Uint8Array&gt;&amp; nextMessage, unsigned short&amp; errorCode, uint32_t&amp; systemCode)
+{
+    UNUSED_PARAM(nextMessage);
+    UNUSED_PARAM(systemCode);
+    ASSERT(rawKeysData);
+
+    do {
+        String rawKeysString = String::fromUTF8(rawKeysData-&gt;data(), rawKeysData-&gt;length());
+        if (rawKeysString.isEmpty())  {
+            LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: empty message&quot;, this);
+            continue;
+        }
+
+        VM&amp; vm = clearKeyVM();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_THROW_SCOPE(vm);
+        JSGlobalObject* globalObject = JSGlobalObject::create(vm, JSGlobalObject::createStructure(vm, jsNull()));
+        ExecState* exec = globalObject-&gt;globalExec();
+
+        JSLockHolder locker(clearKeyVM());
+        JSValue keysDataObject = JSONParse(exec, rawKeysString);
+        if (scope.exception() || !keysDataObject) {
+            LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: invalid JSON&quot;, this);
+            break;
+        }
+        Dictionary keysDataDictionary(exec, keysDataObject);
+        ArrayValue keysArray;
+        size_t length;
+        if (!keysDataDictionary.get(&quot;keys&quot;, keysArray) || keysArray.isUndefinedOrNull() || !keysArray.length(length) || !length) {
+            LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: keys array missing or empty&quot;, this);
+            break;
+        }
+
+        bool foundValidKey = false;
+        for (size_t i = 0; i &lt; length; ++i) {
+            Dictionary keyDictionary;
+            if (!keysArray.get(i, keyDictionary) || keyDictionary.isUndefinedOrNull()) {
+                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: null keyDictionary&quot;, this);
+                continue;
+            }
+
+            String algorithm;
+            if (!keyDictionary.get(&quot;alg&quot;, algorithm) || !equalLettersIgnoringASCIICase(algorithm, &quot;a128kw&quot;)) {
+                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: algorithm unsupported&quot;, this);
+                continue;
+            }
+
+            String keyType;
+            if (!keyDictionary.get(&quot;kty&quot;, keyType) || !equalLettersIgnoringASCIICase(keyType, &quot;oct&quot;)) {
+                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: keyType unsupported&quot;, this);
+                continue;
+            }
+
+            String keyId;
+            if (!keyDictionary.get(&quot;kid&quot;, keyId) || keyId.isEmpty()) {
+                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: keyId missing or empty&quot;, this);
+                continue;
+            }
+
+            String rawKeyData;
+            if (!keyDictionary.get(&quot;k&quot;, rawKeyData) || rawKeyData.isEmpty())  {
+                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: key missing or empty&quot;, this);
+                continue;
+            }
+
+            Vector&lt;uint8_t&gt; keyData;
+            if (!base64Decode(rawKeyData, keyData) ||  keyData.isEmpty()) {
+                LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: unable to base64 decode key&quot;, this);
+                continue;
+            }
+
+            m_cachedKeys.set(keyId, WTFMove(keyData));
+            foundValidKey = true;
+        }
+
+        if (foundValidKey)
+            return true;
+
+    } while (false);
+
+    errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
+    return false;
+}
+
+RefPtr&lt;ArrayBuffer&gt; CDMSessionClearKey::cachedKeyForKeyID(const String&amp; keyId) const
+{
+    if (!m_cachedKeys.contains(keyId))
+        return nullptr;
+
+    auto keyData = m_cachedKeys.get(keyId);
+    RefPtr&lt;Uint8Array&gt; keyDataArray = Uint8Array::create(keyData.data(), keyData.size());
+    return keyDataArray-&gt;unsharedBuffer();
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMSessionClearKeyhfromrev209935trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeyh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h (from rev 209935, trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#pragma once
+
+#include &quot;LegacyCDMSession.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+namespace WebCore {
+
+class CDMSessionClearKey : public CDMSession {
+public:
+    CDMSessionClearKey(CDMSessionClient*);
+    virtual ~CDMSessionClearKey();
+
+    // CDMSessionPrivate
+    CDMSessionType type() override { return CDMSessionTypeClearKey; }
+    void setClient(CDMSessionClient* client) override { m_client = client; }
+    const String&amp; sessionId() const override { return m_sessionId; }
+    RefPtr&lt;Uint8Array&gt; generateKeyRequest(const String&amp; mimeType, Uint8Array*, String&amp;, unsigned short&amp;, uint32_t&amp;) override;
+    void releaseKeys() override;
+    bool update(Uint8Array*, RefPtr&lt;Uint8Array&gt;&amp;, unsigned short&amp;, uint32_t&amp;) override;
+    RefPtr&lt;ArrayBuffer&gt; cachedKeyForKeyID(const String&amp;) const override;
+
+protected:
+    CDMSessionClient* m_client;
+    RefPtr&lt;Uint8Array&gt; m_initData;
+    HashMap&lt;String, Vector&lt;uint8_t&gt;&gt; m_cachedKeys;
+    String m_sessionId;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><del>-#include &quot;CDMSession.h&quot;
</del><ins>+#include &quot;LegacyCDMSession.h&quot;
</ins><span class="cx"> #include &quot;EventTarget.h&quot;
</span><span class="cx"> #include &quot;ExceptionOr.h&quot;
</span><span class="cx"> #include &quot;GenericEventQueue.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeysh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx"> 
</span><del>-#include &quot;CDM.h&quot;
</del><ins>+#include &quot;LegacyCDM.h&quot;
</ins><span class="cx"> #include &quot;ExceptionOr.h&quot;
</span><span class="cx"> #include &lt;runtime/Uint8Array.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -5839,7 +5839,7 @@
</span><span class="cx">                 CDA98DE016026A3700FEA3B1 /* JSWebKitMediaKeyNeededEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DDD16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.cpp */; };
</span><span class="cx">                 CDA98E0416039E1A00FEA3B1 /* JSWebKitMediaKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DCE1601597900FEA3B1 /* JSWebKitMediaKeys.cpp */; };
</span><span class="cx">                 CDA98E0616039E1F00FEA3B1 /* JSWebKitMediaKeySession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DD01601597900FEA3B1 /* JSWebKitMediaKeySession.cpp */; };
</span><del>-                CDA98E0B1603CD6000FEA3B1 /* CDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98E091603CD5900FEA3B1 /* CDM.cpp */; };
</del><ins>+                CDA98E0B1603CD6000FEA3B1 /* LegacyCDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98E091603CD5900FEA3B1 /* LegacyCDM.cpp */; };
</ins><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">@@ -5851,8 +5851,8 @@
</span><span class="cx">                 CDAE8C091746B95700532D78 /* PlatformMediaSessionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAE8C071746B95700532D78 /* PlatformMediaSessionManager.cpp */; };
</span><span class="cx">                 CDBEAEAC19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDBEAEAA19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm */; };
</span><span class="cx">                 CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDBEAEAB19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h */; };
</span><del>-                CDC26B40160A8CC60026757B /* MockCDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDC26B3C160A62B00026757B /* MockCDM.cpp */; };
-                CDC26B41160A8CCE0026757B /* MockCDM.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC26B3D160A62B00026757B /* MockCDM.h */; };
</del><ins>+                CDC26B40160A8CC60026757B /* LegacyMockCDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDC26B3C160A62B00026757B /* LegacyMockCDM.cpp */; };
+                CDC26B41160A8CCE0026757B /* LegacyMockCDM.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC26B3D160A62B00026757B /* LegacyMockCDM.h */; };
</ins><span class="cx">                 CDC69DD61632026C007C38DF /* WebCoreFullScreenWarningView.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC69DD41632026C007C38DF /* WebCoreFullScreenWarningView.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CDC69DD71632026C007C38DF /* WebCoreFullScreenWarningView.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC69DD51632026C007C38DF /* WebCoreFullScreenWarningView.mm */; };
</span><span class="cx">                 CDC69DDA16371FD4007C38DF /* WebCoreFullScreenPlaceholderView.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC69DD816371FD3007C38DF /* WebCoreFullScreenPlaceholderView.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5868,7 +5868,7 @@
</span><span class="cx">                 CDC8B5AD1804AE5D0016E685 /* SourceBufferPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */; };
</span><span class="cx">                 CDC979F41C498C0900DB50D4 /* WebCoreNSErrorExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */; };
</span><span class="cx">                 CDC979F51C498C0900DB50D4 /* WebCoreNSErrorExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */; };
</span><del>-                CDCA98EB18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCA98EA18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp */; };
</del><ins>+                CDCA98EB18B2C8EB00C12FF9 /* LegacyCDMPrivateMediaPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCA98EA18B2C8EB00C12FF9 /* LegacyCDMPrivateMediaPlayer.cpp */; };
</ins><span class="cx">                 CDCD41E71C3DDB0900965D99 /* ParsedContentRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCD41E51C3DDB0900965D99 /* ParsedContentRange.cpp */; };
</span><span class="cx">                 CDCD41E81C3DDB0A00965D99 /* ParsedContentRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCD41E61C3DDB0900965D99 /* ParsedContentRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CDCFABBD18C0AF78006F8450 /* SelectionSubtreeRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCFABBB18C0AE31006F8450 /* SelectionSubtreeRoot.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5877,7 +5877,6 @@
</span><span class="cx">                 CDD7089618359F6F002B3DC6 /* SampleMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDD7089418359F6E002B3DC6 /* SampleMap.cpp */; };
</span><span class="cx">                 CDD7089718359F6F002B3DC6 /* SampleMap.h in Headers */ = {isa = PBXBuildFile; fileRef = CDD7089518359F6F002B3DC6 /* SampleMap.h */; };
</span><span class="cx">                 CDDC1E7A18A952F30027A9D4 /* MediaSourcePrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CDDC1E7918A952F30027A9D4 /* MediaSourcePrivateClient.h */; };
</span><del>-                CDDD571518B57A8200A94FCB /* CDMSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CDDE02E918B3DFC700CF7FF1 /* CDMSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 CDDE02ED18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDDE02EB18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm */; };
</span><span class="cx">                 CDDE02F018B5651300CF7FF1 /* CDMSessionAVStreamSession.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDDE02EF18B5651200CF7FF1 /* CDMSessionAVStreamSession.mm */; };
</span><span class="cx">                 CDE3A85417F5FCE600C5BE20 /* AudioTrackPrivateAVF.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE3A85217F5FCE600C5BE20 /* AudioTrackPrivateAVF.h */; };
</span><span class="lines">@@ -5891,10 +5890,10 @@
</span><span class="cx">                 CDE83DB1183C44060031EAA3 /* VideoPlaybackQuality.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE83DAF183C44060031EAA3 /* VideoPlaybackQuality.cpp */; };
</span><span class="cx">                 CDE83DB2183C44060031EAA3 /* VideoPlaybackQuality.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE83DB0183C44060031EAA3 /* VideoPlaybackQuality.h */; };
</span><span class="cx">                 CDE83DB6183D352A0031EAA3 /* JSVideoPlaybackQuality.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE83DB4183D352A0031EAA3 /* JSVideoPlaybackQuality.cpp */; };
</span><del>-                CDE8B5EC1A69777300B4B66A /* CDMPrivateClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE8B5EA1A69777300B4B66A /* CDMPrivateClearKey.cpp */; };
-                CDE8B5ED1A69777300B4B66A /* CDMPrivateClearKey.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE8B5EB1A69777300B4B66A /* CDMPrivateClearKey.h */; };
-                CDE8B5F01A69778B00B4B66A /* CDMSessionClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE8B5EE1A69778B00B4B66A /* CDMSessionClearKey.cpp */; };
-                CDE8B5F11A69778B00B4B66A /* CDMSessionClearKey.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE8B5EF1A69778B00B4B66A /* CDMSessionClearKey.h */; };
</del><ins>+                CDE8B5EC1A69777300B4B66A /* LegacyCDMPrivateClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE8B5EA1A69777300B4B66A /* LegacyCDMPrivateClearKey.cpp */; };
+                CDE8B5ED1A69777300B4B66A /* LegacyCDMPrivateClearKey.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE8B5EB1A69777300B4B66A /* LegacyCDMPrivateClearKey.h */; };
+                CDE8B5F01A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE8B5EE1A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp */; };
+                CDE8B5F11A69778B00B4B66A /* LegacyCDMSessionClearKey.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE8B5EF1A69778B00B4B66A /* LegacyCDMSessionClearKey.h */; };
</ins><span class="cx">                 CDEA763014608A53008B31F1 /* PlatformClockCA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */; };
</span><span class="cx">                 CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA76321460AE29008B31F1 /* ClockGeneric.cpp */; };
</span><span class="cx">                 CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA76331460B462008B31F1 /* Clock.cpp */; };
</span><span class="lines">@@ -5912,6 +5911,7 @@
</span><span class="cx">                 CDF2B0161820540700F2B424 /* MockSourceBufferPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDF2B00C1820540600F2B424 /* MockSourceBufferPrivate.cpp */; };
</span><span class="cx">                 CDF2B0171820540700F2B424 /* MockSourceBufferPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CDF2B00D1820540600F2B424 /* MockSourceBufferPrivate.h */; };
</span><span class="cx">                 CDF2B0191820540700F2B424 /* MockTracks.h in Headers */ = {isa = PBXBuildFile; fileRef = CDF2B00F1820540600F2B424 /* MockTracks.h */; };
</span><ins>+                CDF4B7121E0087AE00E235A2 /* LegacyCDMSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CDDE02E918B3DFC700CF7FF1 /* LegacyCDMSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 CDF65CC8145B1E7500C4C7AA /* MediaController.h in Headers */ = {isa = PBXBuildFile; fileRef = CD27F6E4145767870078207D /* MediaController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CDF65CCA145B448800C4C7AA /* MediaControllerInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = CDF65CC9145B43A700C4C7AA /* MediaControllerInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CDF7483E18FEBCEC0006ECC0 /* GridPositionsResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDF7483C18FEBCEC0006ECC0 /* GridPositionsResolver.cpp */; };
</span><span class="lines">@@ -13787,9 +13787,9 @@
</span><span class="cx">                 CDA98DDC16026A1900FEA3B1 /* JSWebKitMediaKeyMessageEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSWebKitMediaKeyMessageEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDA98DDD16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMediaKeyNeededEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDA98DDE16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSWebKitMediaKeyNeededEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CDA98E091603CD5900FEA3B1 /* CDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CDM.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98E0A1603CD5900FEA3B1 /* CDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDM.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDA98E0C1603CF3C00FEA3B1 /* CDMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                CDA98E091603CD5900FEA3B1 /* LegacyCDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDM.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98E0A1603CD5900FEA3B1 /* LegacyCDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyCDM.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDA98E0C1603CF3C00FEA3B1 /* LegacyCDMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDAA8D0714D385600061EA60 /* PlatformClockCM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCM.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformClockCM.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDAAF45D1869094E003C1717 /* mediaControlsiOS.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = mediaControlsiOS.css; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13806,8 +13806,8 @@
</span><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><del>-                CDC26B3C160A62B00026757B /* MockCDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MockCDM.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDC26B3D160A62B00026757B /* MockCDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockCDM.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                CDC26B3C160A62B00026757B /* LegacyMockCDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyMockCDM.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDC26B3D160A62B00026757B /* LegacyMockCDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyMockCDM.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDC69DD41632026C007C38DF /* WebCoreFullScreenWarningView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenWarningView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC69DD51632026C007C38DF /* WebCoreFullScreenWarningView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFullScreenWarningView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC69DD816371FD3007C38DF /* WebCoreFullScreenPlaceholderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenPlaceholderView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13823,8 +13823,8 @@
</span><span class="cx">                 CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivateClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSErrorExtras.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreNSErrorExtras.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CDCA98E918B2C8D000C12FF9 /* CDMPrivateMediaPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivateMediaPlayer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDCA98EA18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMPrivateMediaPlayer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                CDCA98E918B2C8D000C12FF9 /* LegacyCDMPrivateMediaPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMPrivateMediaPlayer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDCA98EA18B2C8EB00C12FF9 /* LegacyCDMPrivateMediaPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDMPrivateMediaPlayer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDCD41E51C3DDB0900965D99 /* ParsedContentRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentRange.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDCD41E61C3DDB0900965D99 /* ParsedContentRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParsedContentRange.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDCE5CD014633BC900D47CCA /* EventTargetFactory.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventTargetFactory.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13834,7 +13834,7 @@
</span><span class="cx">                 CDD7089418359F6E002B3DC6 /* SampleMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SampleMap.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDD7089518359F6F002B3DC6 /* SampleMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleMap.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDDC1E7918A952F30027A9D4 /* MediaSourcePrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourcePrivateClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CDDE02E918B3DFC700CF7FF1 /* CDMSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDMSession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                CDDE02E918B3DFC700CF7FF1 /* LegacyCDMSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyCDMSession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDDE02EA18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMSessionAVFoundationObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDDE02EB18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDMSessionAVFoundationObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDDE02EE18B564FA00CF7FF1 /* CDMSessionAVStreamSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDMSessionAVStreamSession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13854,10 +13854,10 @@
</span><span class="cx">                 CDE83DB3183C441E0031EAA3 /* VideoPlaybackQuality.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = VideoPlaybackQuality.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDE83DB4183D352A0031EAA3 /* JSVideoPlaybackQuality.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVideoPlaybackQuality.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDE83DB5183D352A0031EAA3 /* JSVideoPlaybackQuality.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVideoPlaybackQuality.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CDE8B5EA1A69777300B4B66A /* CDMPrivateClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMPrivateClearKey.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDE8B5EB1A69777300B4B66A /* CDMPrivateClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivateClearKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDE8B5EE1A69778B00B4B66A /* CDMSessionClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMSessionClearKey.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDE8B5EF1A69778B00B4B66A /* CDMSessionClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMSessionClearKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                CDE8B5EA1A69777300B4B66A /* LegacyCDMPrivateClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDMPrivateClearKey.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDE8B5EB1A69777300B4B66A /* LegacyCDMPrivateClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMPrivateClearKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDE8B5EE1A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDMSessionClearKey.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDE8B5EF1A69778B00B4B66A /* LegacyCDMSessionClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMSessionClearKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDEA762C14608224008B31F1 /* Clock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clock.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformClockCA.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDEA762F146084EE008B31F1 /* PlatformClockCA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCA.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16350,6 +16350,15 @@
</span><span class="cx">                 2D0621461DA639EC00A7FB26 /* legacy */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                CDA98E091603CD5900FEA3B1 /* LegacyCDM.cpp */,
+                                CDA98E0A1603CD5900FEA3B1 /* LegacyCDM.h */,
+                                CDA98E0C1603CF3C00FEA3B1 /* LegacyCDMPrivate.h */,
+                                CDE8B5EA1A69777300B4B66A /* LegacyCDMPrivateClearKey.cpp */,
+                                CDE8B5EB1A69777300B4B66A /* LegacyCDMPrivateClearKey.h */,
+                                CDCA98EA18B2C8EB00C12FF9 /* LegacyCDMPrivateMediaPlayer.cpp */,
+                                CDCA98E918B2C8D000C12FF9 /* LegacyCDMPrivateMediaPlayer.h */,
+                                CDE8B5EE1A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp */,
+                                CDE8B5EF1A69778B00B4B66A /* LegacyCDMSessionClearKey.h */,
</ins><span class="cx">                                 2D0621421DA6398800A7FB26 /* WebKitMediaKeyMessageEvent.cpp */,
</span><span class="cx">                                 2D0621431DA6398800A7FB26 /* WebKitMediaKeyMessageEvent.h */,
</span><span class="cx">                                 2D0621531DA63ABF00A7FB26 /* WebKitMediaKeyMessageEvent.idl */,
</span><span class="lines">@@ -16555,8 +16564,8 @@
</span><span class="cx">                                 A7BE7EDE14C9175A0014489D /* MallocStatistics.idl */,
</span><span class="cx">                                 CD5393CB175DCCE600C07123 /* MemoryInfo.h */,
</span><span class="cx">                                 CD5393CC175DCCE600C07123 /* MemoryInfo.idl */,
</span><del>-                                CDC26B3C160A62B00026757B /* MockCDM.cpp */,
-                                CDC26B3D160A62B00026757B /* MockCDM.h */,
</del><ins>+                                CDC26B3C160A62B00026757B /* LegacyMockCDM.cpp */,
+                                CDC26B3D160A62B00026757B /* LegacyMockCDM.h */,
</ins><span class="cx">                                 A1BF6B801AA96C7D00AF4A8A /* MockContentFilter.cpp */,
</span><span class="cx">                                 A1BF6B811AA96C7D00AF4A8A /* MockContentFilter.h */,
</span><span class="cx">                                 A1B5B29C1AAA846E008B6042 /* MockContentFilterSettings.cpp */,
</span><span class="lines">@@ -21556,7 +21565,7 @@
</span><span class="cx">                                 BEF29EE91715DD0900C4B4C9 /* AudioTrackPrivate.h */,
</span><span class="cx">                                 A89943270B42338700D7C802 /* BitmapImage.cpp */,
</span><span class="cx">                                 A89943260B42338700D7C802 /* BitmapImage.h */,
</span><del>-                                CDDE02E918B3DFC700CF7FF1 /* CDMSession.h */,
</del><ins>+                                CDDE02E918B3DFC700CF7FF1 /* LegacyCDMSession.h */,
</ins><span class="cx">                                 B27535380B053814002CE64F /* Color.cpp */,
</span><span class="cx">                                 B27535390B053814002CE64F /* Color.h */,
</span><span class="cx">                                 3103B7DE1DB01556008BB890 /* ColorHash.h */,
</span><span class="lines">@@ -22755,15 +22764,6 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 2D0621461DA639EC00A7FB26 /* legacy */,
</span><del>-                                CDA98E091603CD5900FEA3B1 /* CDM.cpp */,
-                                CDA98E0A1603CD5900FEA3B1 /* CDM.h */,
-                                CDA98E0C1603CF3C00FEA3B1 /* CDMPrivate.h */,
-                                CDE8B5EA1A69777300B4B66A /* CDMPrivateClearKey.cpp */,
-                                CDE8B5EB1A69777300B4B66A /* CDMPrivateClearKey.h */,
-                                CDCA98EA18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp */,
-                                CDCA98E918B2C8D000C12FF9 /* CDMPrivateMediaPlayer.h */,
-                                CDE8B5EE1A69778B00B4B66A /* CDMSessionClearKey.cpp */,
-                                CDE8B5EF1A69778B00B4B66A /* CDMSessionClearKey.h */,
</del><span class="cx">                                 2D9BF72F1DBFDC0F007A7D99 /* MediaKeyMessageEvent.cpp */,
</span><span class="cx">                                 2D9BF7301DBFDC0F007A7D99 /* MediaKeyMessageEvent.h */,
</span><span class="cx">                                 2D9BF6F51DBFB71F007A7D99 /* MediaKeyMessageEvent.idl */,
</span><span class="lines">@@ -24777,7 +24777,7 @@
</span><span class="cx">                                 CD5393D4175E018600C07123 /* JSMemoryInfo.h in Headers */,
</span><span class="cx">                                 A19AEA211AAA808600B52B25 /* JSMockContentFilterSettings.h in Headers */,
</span><span class="cx">                                 EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */,
</span><del>-                                CDC26B41160A8CCE0026757B /* MockCDM.h in Headers */,
</del><ins>+                                CDC26B41160A8CCE0026757B /* LegacyMockCDM.h in Headers */,
</ins><span class="cx">                                 A1BF6B831AA96C7D00AF4A8A /* MockContentFilter.h in Headers */,
</span><span class="cx">                                 A1B5B29F1AAA846F008B6042 /* MockContentFilterSettings.h in Headers */,
</span><span class="cx">                                 51058ADC1D6792C1009A538C /* MockGamepad.h in Headers */,
</span><span class="lines">@@ -25038,10 +25038,9 @@
</span><span class="cx">                                 99CC0B4F18BE9849006CEBCC /* CapturingInputCursor.h in Headers */,
</span><span class="cx">                                 CDC734151977896D0046BFC5 /* CARingBuffer.h in Headers */,
</span><span class="cx">                                 6550B69E099DF0270090D781 /* CDATASection.h in Headers */,
</span><del>-                                CDE8B5ED1A69777300B4B66A /* CDMPrivateClearKey.h in Headers */,
</del><ins>+                                CDE8B5ED1A69777300B4B66A /* LegacyCDMPrivateClearKey.h in Headers */,
</ins><span class="cx">                                 CD318623199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h in Headers */,
</span><del>-                                CDDD571518B57A8200A94FCB /* CDMSession.h in Headers */,
-                                CDE8B5F11A69778B00B4B66A /* CDMSessionClearKey.h in Headers */,
</del><ins>+                                CDE8B5F11A69778B00B4B66A /* LegacyCDMSessionClearKey.h in Headers */,
</ins><span class="cx">                                 CDE595971BF26E2100A1CBE8 /* CDMSessionMediaSourceAVFObjC.h in Headers */,
</span><span class="cx">                                 5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */,
</span><span class="cx">                                 A10D7FEC1C2676D100C6C115 /* CFNetworkConnectionCacheSPI.h in Headers */,
</span><span class="lines">@@ -27669,6 +27668,7 @@
</span><span class="cx">                                 F47A5E3E195B8C8A00483100 /* StyleScrollSnapPoints.h in Headers */,
</span><span class="cx">                                 9D6380101AF173220031A15C /* StyleSelfAlignmentData.h in Headers */,
</span><span class="cx">                                 E47A3AC61C5EAC9D00CCBFA7 /* StyleSharingResolver.h in Headers */,
</span><ins>+                                CDF4B7121E0087AE00E235A2 /* LegacyCDMSession.h in Headers */,
</ins><span class="cx">                                 A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */,
</span><span class="cx">                                 E4F9EEF3156DA00700D23E7E /* StyleSheetContents.h in Headers */,
</span><span class="cx">                                 A8EA800A0A19516E00A8EF5F /* StyleSheetList.h in Headers */,
</span><span class="lines">@@ -28667,7 +28667,7 @@
</span><span class="cx">                                 A1E5B31F1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp in Sources */,
</span><span class="cx">                                 2D4150DE1C1F868C000A3BA2 /* JSMockPageOverlay.cpp in Sources */,
</span><span class="cx">                                 EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
</span><del>-                                CDC26B40160A8CC60026757B /* MockCDM.cpp in Sources */,
</del><ins>+                                CDC26B40160A8CC60026757B /* LegacyMockCDM.cpp in Sources */,
</ins><span class="cx">                                 A1BF6B821AA96C7D00AF4A8A /* MockContentFilter.cpp in Sources */,
</span><span class="cx">                                 A1B5B29E1AAA846E008B6042 /* MockContentFilterSettings.cpp in Sources */,
</span><span class="cx">                                 51058ADB1D6792C1009A538C /* MockGamepad.cpp in Sources */,
</span><span class="lines">@@ -28887,14 +28887,14 @@
</span><span class="cx">                                 99CC0B4E18BE9849006CEBCC /* CapturingInputCursor.cpp in Sources */,
</span><span class="cx">                                 CDC734141977896C0046BFC5 /* CARingBuffer.cpp in Sources */,
</span><span class="cx">                                 6550B69D099DF0270090D781 /* CDATASection.cpp in Sources */,
</span><del>-                                CDA98E0B1603CD6000FEA3B1 /* CDM.cpp in Sources */,
-                                CDE8B5EC1A69777300B4B66A /* CDMPrivateClearKey.cpp in Sources */,
-                                CDCA98EB18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp in Sources */,
</del><ins>+                                CDA98E0B1603CD6000FEA3B1 /* LegacyCDM.cpp in Sources */,
+                                CDE8B5EC1A69777300B4B66A /* LegacyCDMPrivateClearKey.cpp in Sources */,
+                                CDCA98EB18B2C8EB00C12FF9 /* LegacyCDMPrivateMediaPlayer.cpp in Sources */,
</ins><span class="cx">                                 CD318622199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm in Sources */,
</span><span class="cx">                                 CDE595951BF16DF300A1CBE8 /* CDMSessionAVContentKeySession.mm in Sources */,
</span><span class="cx">                                 CDDE02ED18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm in Sources */,
</span><span class="cx">                                 CDDE02F018B5651300CF7FF1 /* CDMSessionAVStreamSession.mm in Sources */,
</span><del>-                                CDE8B5F01A69778B00B4B66A /* CDMSessionClearKey.cpp in Sources */,
</del><ins>+                                CDE8B5F01A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp in Sources */,
</ins><span class="cx">                                 CDE5959D1BF2757100A1CBE8 /* CDMSessionMediaSourceAVFObjC.mm in Sources */,
</span><span class="cx">                                 5F2DBBE9178E3C8100141486 /* CertificateInfoMac.mm in Sources */,
</span><span class="cx">                                 E1A8E56617552B2A007488E7 /* CFURLExtras.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -156,6 +156,10 @@
</span><span class="cx"> #include &lt;bindings/ScriptObject.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(ENCRYPTED_MEDIA)
+#include &quot;NotImplemented.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static const double SeekRepeatDelay = 0.1;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsCDMSessionh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/CDMSession.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/CDMSession.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/CDMSession.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,83 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 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 CDMSession_h
-#define CDMSession_h
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &lt;runtime/Uint8Array.h&gt;
-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-class CDMSessionClient {
-public:
-    virtual ~CDMSessionClient() { };
-    virtual void sendMessage(Uint8Array*, String destinationURL) = 0;
-
-    enum {
-        MediaKeyErrorUnknown = 1,
-        MediaKeyErrorClient,
-        MediaKeyErrorService,
-        MediaKeyErrorOutput,
-        MediaKeyErrorHardwareChange,
-        MediaKeyErrorDomain,
-    };
-    typedef unsigned short MediaKeyErrorCode;
-    virtual void sendError(MediaKeyErrorCode, uint32_t systemCode) = 0;
-
-    virtual String mediaKeysStorageDirectory() const = 0;
-};
-
-enum CDMSessionType {
-    CDMSessionTypeUnknown,
-    CDMSessionTypeClearKey,
-    CDMSessionTypeAVFoundationObjC,
-    CDMSessionTypeAVStreamSession,
-    CDMSessionTypeAVContentKeySession,
-};
-
-class CDMSession {
-public:
-    CDMSession() { }
-    virtual ~CDMSession() { }
-
-    virtual CDMSessionType type() { return CDMSessionTypeUnknown; }
-    virtual void setClient(CDMSessionClient*) = 0;
-    virtual const String&amp; sessionId() const = 0;
-    virtual RefPtr&lt;Uint8Array&gt; generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, uint32_t&amp; systemCode) = 0;
-    virtual void releaseKeys() = 0;
-    virtual bool update(Uint8Array*, RefPtr&lt;Uint8Array&gt;&amp; nextMessage, unsigned short&amp; errorCode, uint32_t&amp; systemCode) = 0;
-    virtual RefPtr&lt;ArrayBuffer&gt; cachedKeyForKeyID(const String&amp;) const { return nullptr; }
-};
-
-}
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#endif // CDMSession_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsLegacyCDMSessionhfromrev209935trunkSourceWebCoreplatformgraphicsCDMSessionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/LegacyCDMSession.h (from rev 209935, trunk/Source/WebCore/platform/graphics/CDMSession.h) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/LegacyCDMSession.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/LegacyCDMSession.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+/*
+ * Copyright (C) 2014 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 CDMSession_h
+#define CDMSession_h
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &lt;runtime/Uint8Array.h&gt;
+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class CDMSessionClient {
+public:
+    virtual ~CDMSessionClient() { };
+    virtual void sendMessage(Uint8Array*, String destinationURL) = 0;
+
+    enum {
+        MediaKeyErrorUnknown = 1,
+        MediaKeyErrorClient,
+        MediaKeyErrorService,
+        MediaKeyErrorOutput,
+        MediaKeyErrorHardwareChange,
+        MediaKeyErrorDomain,
+    };
+    typedef unsigned short MediaKeyErrorCode;
+    virtual void sendError(MediaKeyErrorCode, uint32_t systemCode) = 0;
+
+    virtual String mediaKeysStorageDirectory() const = 0;
+};
+
+enum CDMSessionType {
+    CDMSessionTypeUnknown,
+    CDMSessionTypeClearKey,
+    CDMSessionTypeAVFoundationObjC,
+    CDMSessionTypeAVStreamSession,
+    CDMSessionTypeAVContentKeySession,
+};
+
+class CDMSession {
+public:
+    CDMSession() { }
+    virtual ~CDMSession() { }
+
+    virtual CDMSessionType type() { return CDMSessionTypeUnknown; }
+    virtual void setClient(CDMSessionClient*) = 0;
+    virtual const String&amp; sessionId() const = 0;
+    virtual RefPtr&lt;Uint8Array&gt; generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, uint32_t&amp; systemCode) = 0;
+    virtual void releaseKeys() = 0;
+    virtual bool update(Uint8Array*, RefPtr&lt;Uint8Array&gt;&amp; nextMessage, unsigned short&amp; errorCode, uint32_t&amp; systemCode) = 0;
+    virtual RefPtr&lt;ArrayBuffer&gt; cachedKeyForKeyID(const String&amp;) const { return nullptr; }
+};
+
+}
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#endif // CDMSession_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include &quot;GraphicsTypes3D.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AudioTrackPrivate.h&quot;
</span><del>-#include &quot;CDMSession.h&quot;
</del><ins>+#include &quot;LegacyCDMSession.h&quot;
</ins><span class="cx"> #include &quot;InbandTextTrackPrivate.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="cx"> #include &quot;URL.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationCDMPrivateMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA) &amp;&amp; ENABLE(MEDIA_SOURCE)
</span><span class="cx"> 
</span><del>-#include &quot;CDMPrivate.h&quot;
</del><ins>+#include &quot;LegacyCDMPrivate.h&quot;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationCDMPrivateMediaSourceAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -28,10 +28,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA) &amp;&amp; ENABLE(MEDIA_SOURCE)
</span><span class="cx"> 
</span><del>-#import &quot;CDM.h&quot;
</del><span class="cx"> #import &quot;CDMSessionAVContentKeySession.h&quot;
</span><span class="cx"> #import &quot;CDMSessionAVStreamSession.h&quot;
</span><span class="cx"> #import &quot;ContentType.h&quot;
</span><ins>+#import &quot;LegacyCDM.h&quot;
</ins><span class="cx"> #import &quot;MediaPlayerPrivateMediaSourceAVFObjC.h&quot;
</span><span class="cx"> #import &quot;WebCoreSystemInterface.h&quot;
</span><span class="cx"> #import &lt;wtf/NeverDestroyed.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVContentKeySessionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA) &amp;&amp; ENABLE(MEDIA_SOURCE)
</span><span class="cx"> 
</span><del>-#import &quot;CDM.h&quot;
</del><ins>+#import &quot;LegacyCDM.h&quot;
</ins><span class="cx"> #import &quot;CDMPrivateMediaSourceAVFObjC.h&quot;
</span><span class="cx"> #import &quot;FileSystem.h&quot;
</span><span class="cx"> #import &quot;Logging.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #ifndef CDMSessionAVFoundationObjC_h
</span><span class="cx"> #define CDMSessionAVFoundationObjC_h
</span><span class="cx"> 
</span><del>-#include &quot;CDMSession.h&quot;
</del><ins>+#include &quot;LegacyCDMSession.h&quot;
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/WeakPtr.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -28,8 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx"> 
</span><del>-#import &quot;CDM.h&quot;
-#import &quot;CDMSession.h&quot;
</del><ins>+#import &quot;LegacyCDM.h&quot;
+#import &quot;LegacyCDMSession.h&quot;
</ins><span class="cx"> #import &quot;MediaPlayer.h&quot;
</span><span class="cx"> #import &quot;MediaPlayerPrivateAVFoundationObjC.h&quot;
</span><span class="cx"> #import &quot;SoftLinking.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVStreamSessionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA) &amp;&amp; ENABLE(MEDIA_SOURCE)
</span><span class="cx"> 
</span><span class="cx"> #import &quot;AVFoundationSPI.h&quot;
</span><del>-#import &quot;CDM.h&quot;
</del><ins>+#import &quot;LegacyCDM.h&quot;
</ins><span class="cx"> #import &quot;CDMPrivateMediaSourceAVFObjC.h&quot;
</span><span class="cx"> #import &quot;FileSystem.h&quot;
</span><span class="cx"> #import &quot;Logging.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #ifndef CDMSessionMediaSourceAVFObjC_h
</span><span class="cx"> #define CDMSessionMediaSourceAVFObjC_h
</span><span class="cx"> 
</span><del>-#include &quot;CDMSession.h&quot;
</del><ins>+#include &quot;LegacyCDMSession.h&quot;
</ins><span class="cx"> #include &quot;SourceBufferPrivateAVFObjC.h&quot;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/WeakPtr.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -156,7 +156,9 @@
</span><span class="cx"> 
</span><span class="cx">     MediaSourcePrivateAVFObjC* m_mediaSource;
</span><span class="cx">     SourceBufferPrivateClient* m_client;
</span><ins>+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins><span class="cx">     CDMSessionMediaSourceAVFObjC* m_session { nullptr };
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     std::optional&lt;FloatSize&gt; m_cachedSize;
</span><span class="cx">     FloatSize m_currentSize;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -607,6 +607,7 @@
</span><span class="cx">     }
</span><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(initData);
</span><ins>+    UNUSED_PARAM(hasSessionSemaphore);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -680,8 +681,10 @@
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::destroyParser()
</span><span class="cx"> {
</span><ins>+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins><span class="cx">     if (m_mediaSource &amp;&amp; m_mediaSource-&gt;player()-&gt;hasStreamSession())
</span><span class="cx">         [m_mediaSource-&gt;player()-&gt;streamSession() removeStreamDataParser:m_parser.get()];
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     [m_delegate invalidate];
</span><span class="cx">     m_delegate = nullptr;
</span><span class="lines">@@ -801,6 +804,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::setCDMSession(CDMSessionMediaSourceAVFObjC* session)
</span><span class="cx"> {
</span><ins>+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins><span class="cx">     if (session == m_session)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -827,6 +831,9 @@
</span><span class="cx">             });
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+#else
+    UNUSED_PARAM(session);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::flush()
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -158,8 +158,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-#include &quot;CDM.h&quot;
-#include &quot;MockCDM.h&quot;
</del><ins>+#include &quot;LegacyCDM.h&quot;
+#include &quot;LegacyMockCDM.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebCoretestingLegacyMockCDMcppfromrev209935trunkSourceWebCoretestingMockCDMcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/testing/LegacyMockCDM.cpp (from rev 209935, trunk/Source/WebCore/testing/MockCDM.cpp) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/LegacyMockCDM.cpp                                (rev 0)
+++ trunk/Source/WebCore/testing/LegacyMockCDM.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,144 @@
</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;LegacyMockCDM.h&quot;
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;LegacyCDM.h&quot;
+#include &quot;LegacyCDMSession.h&quot;
+#include &quot;WebKitMediaKeyError.h&quot;
+#include &lt;runtime/JSCInlines.h&gt;
+#include &lt;runtime/TypedArrayInlines.h&gt;
+#include &lt;runtime/Uint8Array.h&gt;
+
+namespace WebCore {
+
+class MockCDMSession : public CDMSession {
+public:
+    MockCDMSession(CDMSessionClient*);
+    virtual ~MockCDMSession() { }
+
+    void setClient(CDMSessionClient* client) override { m_client = client; }
+    const String&amp; sessionId() const override { return m_sessionId; }
+    RefPtr&lt;Uint8Array&gt; generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, uint32_t&amp; systemCode) override;
+    void releaseKeys() override;
+    bool update(Uint8Array*, RefPtr&lt;Uint8Array&gt;&amp; nextMessage, unsigned short&amp; errorCode, uint32_t&amp; systemCode) override;
+
+protected:
+    CDMSessionClient* m_client;
+    String m_sessionId;
+};
+
+bool MockCDM::supportsKeySystem(const String&amp; keySystem)
+{
+    return equalLettersIgnoringASCIICase(keySystem, &quot;com.webcore.mock&quot;);
+}
+
+bool MockCDM::supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType)
+{
+    if (!supportsKeySystem(keySystem))
+        return false;
+
+    return equalLettersIgnoringASCIICase(mimeType, &quot;video/mock&quot;);
+}
+
+bool MockCDM::supportsMIMEType(const String&amp; mimeType)
+{
+    return equalLettersIgnoringASCIICase(mimeType, &quot;video/mock&quot;);
+}
+
+std::unique_ptr&lt;CDMSession&gt; MockCDM::createSession(CDMSessionClient* client)
+{
+    return std::make_unique&lt;MockCDMSession&gt;(client);
+}
+
+static Uint8Array* initDataPrefix()
+{
+    const unsigned char prefixData[] = { 'm', 'o', 'c', 'k' };
+    static Uint8Array* prefix = Uint8Array::create(prefixData, WTF_ARRAY_LENGTH(prefixData)).leakRef();
+
+    return prefix;
+}
+
+static Uint8Array* keyPrefix()
+{
+    static const unsigned char prefixData[] = {'k', 'e', 'y'};
+    static Uint8Array* prefix = Uint8Array::create(prefixData, WTF_ARRAY_LENGTH(prefixData)).leakRef();
+
+    return prefix;
+}
+
+static Uint8Array* keyRequest()
+{
+    static const unsigned char requestData[] = {'r', 'e', 'q', 'u', 'e', 's', 't'};
+    static Uint8Array* request = Uint8Array::create(requestData, WTF_ARRAY_LENGTH(requestData)).leakRef();
+
+    return request;
+}
+
+static String generateSessionId()
+{
+    static int monotonicallyIncreasingSessionId = 0;
+    return String::number(monotonicallyIncreasingSessionId++);
+}
+
+MockCDMSession::MockCDMSession(CDMSessionClient* client)
+    : m_client(client)
+    , m_sessionId(generateSessionId())
+{
+}
+
+RefPtr&lt;Uint8Array&gt; MockCDMSession::generateKeyRequest(const String&amp;, Uint8Array* initData, String&amp;, unsigned short&amp; errorCode, uint32_t&amp;)
+{
+    for (unsigned i = 0; i &lt; initDataPrefix()-&gt;length(); ++i) {
+        if (!initData || i &gt;= initData-&gt;length() || initData-&gt;item(i) != initDataPrefix()-&gt;item(i)) {
+            errorCode = WebKitMediaKeyError::MEDIA_KEYERR_UNKNOWN;
+            return nullptr;
+        }
+    }
+    return keyRequest();
+}
+
+void MockCDMSession::releaseKeys()
+{
+    // no-op
+}
+
+bool MockCDMSession::update(Uint8Array* key, RefPtr&lt;Uint8Array&gt;&amp;, unsigned short&amp; errorCode, uint32_t&amp;)
+{
+    for (unsigned i = 0; i &lt; keyPrefix()-&gt;length(); ++i) {
+        if (i &gt;= key-&gt;length() || key-&gt;item(i) != keyPrefix()-&gt;item(i)) {
+            errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
+            return false;
+        }
+    }
+    return true;
+}
+
+}
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingLegacyMockCDMhfromrev209935trunkSourceWebCoretestingMockCDMh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/testing/LegacyMockCDM.h (from rev 209935, trunk/Source/WebCore/testing/MockCDM.h) (0 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/LegacyMockCDM.h                                (rev 0)
+++ trunk/Source/WebCore/testing/LegacyMockCDM.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -0,0 +1,57 @@
</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.
+ */
+
+#pragma once
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include &quot;LegacyCDMPrivate.h&quot;
+
+namespace WebCore {
+
+class CDM;
+
+class MockCDM : public CDMPrivateInterface {
+public:
+    explicit MockCDM(CDM* cdm)
+        : m_cdm(cdm)
+    { }
+
+    // CDMFactory support:
+    static bool supportsKeySystem(const String&amp;);
+    static bool supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType);
+
+    virtual ~MockCDM() { }
+
+    bool supportsMIMEType(const String&amp; mimeType) override;
+    std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient*) override;
+
+protected:
+    CDM* m_cdm;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingMockCDMcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/testing/MockCDM.cpp (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/MockCDM.cpp        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/testing/MockCDM.cpp        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,144 +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;MockCDM.h&quot;
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDM.h&quot;
-#include &quot;CDMSession.h&quot;
-#include &quot;WebKitMediaKeyError.h&quot;
-#include &lt;runtime/JSCInlines.h&gt;
-#include &lt;runtime/TypedArrayInlines.h&gt;
-#include &lt;runtime/Uint8Array.h&gt;
-
-namespace WebCore {
-
-class MockCDMSession : public CDMSession {
-public:
-    MockCDMSession(CDMSessionClient*);
-    virtual ~MockCDMSession() { }
-
-    void setClient(CDMSessionClient* client) override { m_client = client; }
-    const String&amp; sessionId() const override { return m_sessionId; }
-    RefPtr&lt;Uint8Array&gt; generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, uint32_t&amp; systemCode) override;
-    void releaseKeys() override;
-    bool update(Uint8Array*, RefPtr&lt;Uint8Array&gt;&amp; nextMessage, unsigned short&amp; errorCode, uint32_t&amp; systemCode) override;
-
-protected:
-    CDMSessionClient* m_client;
-    String m_sessionId;
-};
-
-bool MockCDM::supportsKeySystem(const String&amp; keySystem)
-{
-    return equalLettersIgnoringASCIICase(keySystem, &quot;com.webcore.mock&quot;);
-}
-
-bool MockCDM::supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType)
-{
-    if (!supportsKeySystem(keySystem))
-        return false;
-
-    return equalLettersIgnoringASCIICase(mimeType, &quot;video/mock&quot;);
-}
-
-bool MockCDM::supportsMIMEType(const String&amp; mimeType)
-{
-    return equalLettersIgnoringASCIICase(mimeType, &quot;video/mock&quot;);
-}
-
-std::unique_ptr&lt;CDMSession&gt; MockCDM::createSession(CDMSessionClient* client)
-{
-    return std::make_unique&lt;MockCDMSession&gt;(client);
-}
-
-static Uint8Array* initDataPrefix()
-{
-    const unsigned char prefixData[] = { 'm', 'o', 'c', 'k' };
-    static Uint8Array* prefix = Uint8Array::create(prefixData, WTF_ARRAY_LENGTH(prefixData)).leakRef();
-
-    return prefix;
-}
-
-static Uint8Array* keyPrefix()
-{
-    static const unsigned char prefixData[] = {'k', 'e', 'y'};
-    static Uint8Array* prefix = Uint8Array::create(prefixData, WTF_ARRAY_LENGTH(prefixData)).leakRef();
-
-    return prefix;
-}
-
-static Uint8Array* keyRequest()
-{
-    static const unsigned char requestData[] = {'r', 'e', 'q', 'u', 'e', 's', 't'};
-    static Uint8Array* request = Uint8Array::create(requestData, WTF_ARRAY_LENGTH(requestData)).leakRef();
-
-    return request;
-}
-
-static String generateSessionId()
-{
-    static int monotonicallyIncreasingSessionId = 0;
-    return String::number(monotonicallyIncreasingSessionId++);
-}
-
-MockCDMSession::MockCDMSession(CDMSessionClient* client)
-    : m_client(client)
-    , m_sessionId(generateSessionId())
-{
-}
-
-RefPtr&lt;Uint8Array&gt; MockCDMSession::generateKeyRequest(const String&amp;, Uint8Array* initData, String&amp;, unsigned short&amp; errorCode, uint32_t&amp;)
-{
-    for (unsigned i = 0; i &lt; initDataPrefix()-&gt;length(); ++i) {
-        if (!initData || i &gt;= initData-&gt;length() || initData-&gt;item(i) != initDataPrefix()-&gt;item(i)) {
-            errorCode = WebKitMediaKeyError::MEDIA_KEYERR_UNKNOWN;
-            return nullptr;
-        }
-    }
-    return keyRequest();
-}
-
-void MockCDMSession::releaseKeys()
-{
-    // no-op
-}
-
-bool MockCDMSession::update(Uint8Array* key, RefPtr&lt;Uint8Array&gt;&amp;, unsigned short&amp; errorCode, uint32_t&amp;)
-{
-    for (unsigned i = 0; i &lt; keyPrefix()-&gt;length(); ++i) {
-        if (i &gt;= key-&gt;length() || key-&gt;item(i) != keyPrefix()-&gt;item(i)) {
-            errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
-            return false;
-        }
-    }
-    return true;
-}
-
-}
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</del></span></pre></div>
<a id="trunkSourceWebCoretestingMockCDMh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/testing/MockCDM.h (209935 => 209936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/MockCDM.h        2016-12-16 21:42:50 UTC (rev 209935)
+++ trunk/Source/WebCore/testing/MockCDM.h        2016-12-16 21:52:38 UTC (rev 209936)
</span><span class="lines">@@ -1,57 +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.
- */
-
-#pragma once
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include &quot;CDMPrivate.h&quot;
-
-namespace WebCore {
-
-class CDM;
-
-class MockCDM : public CDMPrivateInterface {
-public:
-    explicit MockCDM(CDM* cdm)
-        : m_cdm(cdm)
-    { }
-
-    // CDMFactory support:
-    static bool supportsKeySystem(const String&amp;);
-    static bool supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType);
-
-    virtual ~MockCDM() { }
-
-    bool supportsMIMEType(const String&amp; mimeType) override;
-    std::unique_ptr&lt;CDMSession&gt; createSession(CDMSessionClient*) override;
-
-protected:
-    CDM* m_cdm;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</del></span></pre>
</div>
</div>

</body>
</html>