<!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 <jer.noble@apple.com>
+
+ 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 <akling@apple.com>
</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 "config.h"
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include "CDM.h"
-
-#include "CDMPrivateClearKey.h"
-#include "CDMPrivateMediaPlayer.h"
-#include "CDMSession.h"
-#include "MediaPlayer.h"
-#include "WebKitMediaKeys.h"
-#include <wtf/NeverDestroyed.h>
-#include <wtf/text/WTFString.h>
-
-#if PLATFORM(MAC) && ENABLE(MEDIA_SOURCE)
-#include "CDMPrivateMediaSourceAVFObjC.h"
-#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<CDMFactory*>& installedCDMFactories()
-{
- static NeverDestroyed<Vector<CDMFactory*>> cdms;
- static bool queriedCDMs = false;
- if (!queriedCDMs) {
- queriedCDMs = true;
-
- cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique<CDMPrivateClearKey>(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<CDMPrivateMediaPlayer>(cdm); },
- CDMPrivateMediaPlayer::supportsKeySystem, CDMPrivateMediaPlayer::supportsKeySystemAndMimeType));
-
-#if PLATFORM(MAC) && ENABLE(MEDIA_SOURCE)
- cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique<CDMPrivateMediaSourceAVFObjC>(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& keySystem)
-{
- for (auto& factory : installedCDMFactories()) {
- if (factory->supportsKeySystem(keySystem))
- return factory;
- }
- return 0;
-}
-
-bool CDM::supportsKeySystem(const String& keySystem)
-{
- return CDMFactoryForKeySystem(keySystem);
-}
-
-bool CDM::keySystemSupportsMimeType(const String& keySystem, const String& mimeType)
-{
- if (CDMFactory* factory = CDMFactoryForKeySystem(keySystem))
- return factory->supportsKeySystemAndMimeType(keySystem, mimeType);
- return false;
-}
-
-std::unique_ptr<CDM> CDM::create(const String& keySystem)
-{
- if (!supportsKeySystem(keySystem))
- return nullptr;
-
- return std::make_unique<CDM>(keySystem);
-}
-
-CDM::CDM(const String& keySystem)
- : m_keySystem(keySystem)
- , m_client(nullptr)
-{
- m_private = CDMFactoryForKeySystem(keySystem)->constructor(this);
-}
-
-CDM::~CDM()
-{
-}
-
-bool CDM::supportsMIMEType(const String& mimeType) const
-{
- return m_private->supportsMIMEType(mimeType);
-}
-
-std::unique_ptr<CDMSession> CDM::createSession(CDMSessionClient& client)
-{
- auto session = m_private->createSession(&client);
- if (mediaPlayer())
- mediaPlayer()->setCDMSession(session.get());
- return session;
-}
-
-MediaPlayer* CDM::mediaPlayer() const
-{
- if (!m_client)
- return 0;
- return m_client->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 "CDMSession.h"
-#include <runtime/Uint8Array.h>
-#include <wtf/Forward.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class CDM;
-class CDMPrivateInterface;
-class MediaPlayer;
-
-typedef std::function<std::unique_ptr<CDMPrivateInterface> (CDM*)> CreateCDM;
-typedef bool (*CDMSupportsKeySystem)(const String&);
-typedef bool (*CDMSupportsKeySystemAndMimeType)(const String&, const String&);
-
-class CDMClient {
-public:
- virtual ~CDMClient() { }
-
- virtual MediaPlayer* cdmMediaPlayer(const CDM*) const = 0;
-};
-
-class CDM {
-public:
- explicit CDM(const String& keySystem);
-
- enum CDMErrorCode { NoError, UnknownError, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
- static bool supportsKeySystem(const String&);
- static bool keySystemSupportsMimeType(const String& keySystem, const String& mimeType);
- static std::unique_ptr<CDM> create(const String& keySystem);
- WEBCORE_EXPORT static void registerCDMFactory(CreateCDM, CDMSupportsKeySystem, CDMSupportsKeySystemAndMimeType);
- ~CDM();
-
- bool supportsMIMEType(const String&) const;
- std::unique_ptr<CDMSession> createSession(CDMSessionClient&);
-
- const String& 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<CDMPrivateInterface> 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 <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class CDMSession;
-class CDMSessionClient;
-
-class CDMPrivateInterface {
-public:
- CDMPrivateInterface() { }
- virtual ~CDMPrivateInterface() { }
-
- virtual bool supportsMIMEType(const String&) = 0;
-
- virtual std::unique_ptr<CDMSession> 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 "config.h"
-#include "CDMPrivateClearKey.h"
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include "CDM.h"
-#include "CDMSessionClearKey.h"
-#include "ContentType.h"
-#include "MediaPlayer.h"
-
-namespace WebCore {
-
-bool CDMPrivateClearKey::supportsKeySystem(const String& keySystem)
-{
- if (!equalLettersIgnoringASCIICase(keySystem, "org.w3c.clearkey"))
- return false;
-
- // The MediaPlayer must also support the key system:
- return MediaPlayer::supportsKeySystem(keySystem, emptyString());
-}
-
-bool CDMPrivateClearKey::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
-{
- if (!equalLettersIgnoringASCIICase(keySystem, "org.w3c.clearkey"))
- return false;
-
- // The MediaPlayer must also support the key system:
- return MediaPlayer::supportsKeySystem(keySystem, mimeType);
-}
-
-bool CDMPrivateClearKey::supportsMIMEType(const String& mimeType)
-{
- return MediaPlayer::supportsKeySystem(m_cdm->keySystem(), mimeType);
-}
-
-std::unique_ptr<CDMSession> CDMPrivateClearKey::createSession(CDMSessionClient* client)
-{
- return std::make_unique<CDMSessionClearKey>(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 "CDMPrivate.h"
-
-namespace WebCore {
-
-class CDM;
-
-class CDMPrivateClearKey : public CDMPrivateInterface {
-public:
- explicit CDMPrivateClearKey(CDM* cdm)
- : m_cdm(cdm)
- {
- }
-
- virtual ~CDMPrivateClearKey() { }
-
- static bool supportsKeySystem(const String&);
- static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
-
- bool supportsMIMEType(const String& mimeType) override;
- std::unique_ptr<CDMSession> 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 "config.h"
-#include "CDMPrivateMediaPlayer.h"
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include "CDM.h"
-#include "CDMSession.h"
-#include "ContentType.h"
-#include "MediaPlayer.h"
-
-#if PLATFORM(IOS)
-#include "SoftLinking.h"
-#endif
-
-namespace WebCore {
-
-bool CDMPrivateMediaPlayer::supportsKeySystem(const String& keySystem)
-{
- return MediaPlayer::supportsKeySystem(keySystem, emptyString());
-}
-
-bool CDMPrivateMediaPlayer::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
-{
- return MediaPlayer::supportsKeySystem(keySystem, mimeType);
-}
-
-bool CDMPrivateMediaPlayer::supportsMIMEType(const String& mimeType)
-{
- return MediaPlayer::supportsKeySystem(m_cdm->keySystem(), mimeType);
-}
-
-std::unique_ptr<CDMSession> CDMPrivateMediaPlayer::createSession(CDMSessionClient* client)
-{
- MediaPlayer* mediaPlayer = m_cdm->mediaPlayer();
- if (!mediaPlayer)
- return nullptr;
-
- return mediaPlayer->createSession(m_cdm->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 "CDMPrivate.h"
-
-#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&);
- static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
-
- virtual ~CDMPrivateMediaPlayer() { }
-
- bool supportsMIMEType(const String& mimeType) override;
- std::unique_ptr<CDMSession> 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 "config.h"
-#include "CDMSessionClearKey.h"
-
-#include "ArrayValue.h"
-#include "Dictionary.h"
-#include "JSMainThreadExecState.h"
-#include "Logging.h"
-#include "TextEncoding.h"
-#include "UUID.h"
-#include "WebKitMediaKeyError.h"
-#include <runtime/JSGlobalObject.h>
-#include <runtime/JSLock.h>
-#include <runtime/JSONObject.h>
-#include <runtime/VM.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/text/Base64.h>
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-using namespace JSC;
-
-namespace WebCore {
-
-static VM& clearKeyVM()
-{
- static NeverDestroyed<RefPtr<VM>> vm;
- if (!vm.get())
- vm.get() = VM::create();
-
- return *vm.get();
-}
-
-CDMSessionClearKey::CDMSessionClearKey(CDMSessionClient* client)
- : m_client(client)
- , m_sessionId(createCanonicalUUIDString())
-{
-}
-
-CDMSessionClearKey::~CDMSessionClearKey()
-{
-}
-
-RefPtr<Uint8Array> CDMSessionClearKey::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& 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<char*>(m_initData->baseAddress()), m_initData->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<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode)
-{
- UNUSED_PARAM(nextMessage);
- UNUSED_PARAM(systemCode);
- ASSERT(rawKeysData);
-
- do {
- String rawKeysString = String::fromUTF8(rawKeysData->data(), rawKeysData->length());
- if (rawKeysString.isEmpty()) {
- LOG(Media, "CDMSessionClearKey::update(%p) - failed: empty message", this);
- continue;
- }
-
- VM& vm = clearKeyVM();
- JSLockHolder lock(vm);
- auto scope = DECLARE_THROW_SCOPE(vm);
- JSGlobalObject* globalObject = JSGlobalObject::create(vm, JSGlobalObject::createStructure(vm, jsNull()));
- ExecState* exec = globalObject->globalExec();
-
- JSLockHolder locker(clearKeyVM());
- JSValue keysDataObject = JSONParse(exec, rawKeysString);
- if (scope.exception() || !keysDataObject) {
- LOG(Media, "CDMSessionClearKey::update(%p) - failed: invalid JSON", this);
- break;
- }
- Dictionary keysDataDictionary(exec, keysDataObject);
- ArrayValue keysArray;
- size_t length;
- if (!keysDataDictionary.get("keys", keysArray) || keysArray.isUndefinedOrNull() || !keysArray.length(length) || !length) {
- LOG(Media, "CDMSessionClearKey::update(%p) - failed: keys array missing or empty", this);
- break;
- }
-
- bool foundValidKey = false;
- for (size_t i = 0; i < length; ++i) {
- Dictionary keyDictionary;
- if (!keysArray.get(i, keyDictionary) || keyDictionary.isUndefinedOrNull()) {
- LOG(Media, "CDMSessionClearKey::update(%p) - failed: null keyDictionary", this);
- continue;
- }
-
- String algorithm;
- if (!keyDictionary.get("alg", algorithm) || !equalLettersIgnoringASCIICase(algorithm, "a128kw")) {
- LOG(Media, "CDMSessionClearKey::update(%p) - failed: algorithm unsupported", this);
- continue;
- }
-
- String keyType;
- if (!keyDictionary.get("kty", keyType) || !equalLettersIgnoringASCIICase(keyType, "oct")) {
- LOG(Media, "CDMSessionClearKey::update(%p) - failed: keyType unsupported", this);
- continue;
- }
-
- String keyId;
- if (!keyDictionary.get("kid", keyId) || keyId.isEmpty()) {
- LOG(Media, "CDMSessionClearKey::update(%p) - failed: keyId missing or empty", this);
- continue;
- }
-
- String rawKeyData;
- if (!keyDictionary.get("k", rawKeyData) || rawKeyData.isEmpty()) {
- LOG(Media, "CDMSessionClearKey::update(%p) - failed: key missing or empty", this);
- continue;
- }
-
- Vector<uint8_t> keyData;
- if (!base64Decode(rawKeyData, keyData) || keyData.isEmpty()) {
- LOG(Media, "CDMSessionClearKey::update(%p) - failed: unable to base64 decode key", this);
- continue;
- }
-
- m_cachedKeys.set(keyId, WTFMove(keyData));
- foundValidKey = true;
- }
-
- if (foundValidKey)
- return true;
-
- } while (false);
-
- errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
- return false;
-}
-
-RefPtr<ArrayBuffer> CDMSessionClearKey::cachedKeyForKeyID(const String& keyId) const
-{
- if (!m_cachedKeys.contains(keyId))
- return nullptr;
-
- auto keyData = m_cachedKeys.get(keyId);
- RefPtr<Uint8Array> keyDataArray = Uint8Array::create(keyData.data(), keyData.size());
- return keyDataArray->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 "CDMSession.h"
-#include <wtf/HashMap.h>
-
-#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& sessionId() const override { return m_sessionId; }
- RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array*, String&, unsigned short&, uint32_t&) override;
- void releaseKeys() override;
- bool update(Uint8Array*, RefPtr<Uint8Array>&, unsigned short&, uint32_t&) override;
- RefPtr<ArrayBuffer> cachedKeyForKeyID(const String&) const override;
-
-protected:
- CDMSessionClient* m_client;
- RefPtr<Uint8Array> m_initData;
- HashMap<String, Vector<uint8_t>> 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 "config.h"
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include "LegacyCDM.h"
+
+#include "LegacyCDMPrivateClearKey.h"
+#include "LegacyCDMPrivateMediaPlayer.h"
+#include "LegacyCDMSession.h"
+#include "MediaPlayer.h"
+#include "WebKitMediaKeys.h"
+#include <wtf/NeverDestroyed.h>
+#include <wtf/text/WTFString.h>
+
+#if PLATFORM(MAC) && ENABLE(MEDIA_SOURCE)
+#include "CDMPrivateMediaSourceAVFObjC.h"
+#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<CDMFactory*>& installedCDMFactories()
+{
+ static NeverDestroyed<Vector<CDMFactory*>> cdms;
+ static bool queriedCDMs = false;
+ if (!queriedCDMs) {
+ queriedCDMs = true;
+
+ cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique<CDMPrivateClearKey>(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<CDMPrivateMediaPlayer>(cdm); },
+ CDMPrivateMediaPlayer::supportsKeySystem, CDMPrivateMediaPlayer::supportsKeySystemAndMimeType));
+
+#if PLATFORM(MAC) && ENABLE(MEDIA_SOURCE)
+ cdms.get().append(new CDMFactory([](CDM* cdm) { return std::make_unique<CDMPrivateMediaSourceAVFObjC>(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& keySystem)
+{
+ for (auto& factory : installedCDMFactories()) {
+ if (factory->supportsKeySystem(keySystem))
+ return factory;
+ }
+ return 0;
+}
+
+bool CDM::supportsKeySystem(const String& keySystem)
+{
+ return CDMFactoryForKeySystem(keySystem);
+}
+
+bool CDM::keySystemSupportsMimeType(const String& keySystem, const String& mimeType)
+{
+ if (CDMFactory* factory = CDMFactoryForKeySystem(keySystem))
+ return factory->supportsKeySystemAndMimeType(keySystem, mimeType);
+ return false;
+}
+
+std::unique_ptr<CDM> CDM::create(const String& keySystem)
+{
+ if (!supportsKeySystem(keySystem))
+ return nullptr;
+
+ return std::make_unique<CDM>(keySystem);
+}
+
+CDM::CDM(const String& keySystem)
+ : m_keySystem(keySystem)
+ , m_client(nullptr)
+{
+ m_private = CDMFactoryForKeySystem(keySystem)->constructor(this);
+}
+
+CDM::~CDM()
+{
+}
+
+bool CDM::supportsMIMEType(const String& mimeType) const
+{
+ return m_private->supportsMIMEType(mimeType);
+}
+
+std::unique_ptr<CDMSession> CDM::createSession(CDMSessionClient& client)
+{
+ auto session = m_private->createSession(&client);
+ if (mediaPlayer())
+ mediaPlayer()->setCDMSession(session.get());
+ return session;
+}
+
+MediaPlayer* CDM::mediaPlayer() const
+{
+ if (!m_client)
+ return 0;
+ return m_client->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 "LegacyCDMSession.h"
+#include <runtime/Uint8Array.h>
+#include <wtf/Forward.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class CDM;
+class CDMPrivateInterface;
+class MediaPlayer;
+
+typedef std::function<std::unique_ptr<CDMPrivateInterface> (CDM*)> CreateCDM;
+typedef bool (*CDMSupportsKeySystem)(const String&);
+typedef bool (*CDMSupportsKeySystemAndMimeType)(const String&, const String&);
+
+class CDMClient {
+public:
+ virtual ~CDMClient() { }
+
+ virtual MediaPlayer* cdmMediaPlayer(const CDM*) const = 0;
+};
+
+class CDM {
+public:
+ explicit CDM(const String& keySystem);
+
+ enum CDMErrorCode { NoError, UnknownError, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
+ static bool supportsKeySystem(const String&);
+ static bool keySystemSupportsMimeType(const String& keySystem, const String& mimeType);
+ static std::unique_ptr<CDM> create(const String& keySystem);
+ WEBCORE_EXPORT static void registerCDMFactory(CreateCDM, CDMSupportsKeySystem, CDMSupportsKeySystemAndMimeType);
+ ~CDM();
+
+ bool supportsMIMEType(const String&) const;
+ std::unique_ptr<CDMSession> createSession(CDMSessionClient&);
+
+ const String& 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<CDMPrivateInterface> 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 <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class CDMSession;
+class CDMSessionClient;
+
+class CDMPrivateInterface {
+public:
+ CDMPrivateInterface() { }
+ virtual ~CDMPrivateInterface() { }
+
+ virtual bool supportsMIMEType(const String&) = 0;
+
+ virtual std::unique_ptr<CDMSession> 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 "config.h"
+#include "LegacyCDMPrivateClearKey.h"
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include "LegacyCDM.h"
+#include "LegacyCDMSessionClearKey.h"
+#include "ContentType.h"
+#include "MediaPlayer.h"
+
+namespace WebCore {
+
+bool CDMPrivateClearKey::supportsKeySystem(const String& keySystem)
+{
+ if (!equalLettersIgnoringASCIICase(keySystem, "org.w3c.clearkey"))
+ return false;
+
+ // The MediaPlayer must also support the key system:
+ return MediaPlayer::supportsKeySystem(keySystem, emptyString());
+}
+
+bool CDMPrivateClearKey::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
+{
+ if (!equalLettersIgnoringASCIICase(keySystem, "org.w3c.clearkey"))
+ return false;
+
+ // The MediaPlayer must also support the key system:
+ return MediaPlayer::supportsKeySystem(keySystem, mimeType);
+}
+
+bool CDMPrivateClearKey::supportsMIMEType(const String& mimeType)
+{
+ return MediaPlayer::supportsKeySystem(m_cdm->keySystem(), mimeType);
+}
+
+std::unique_ptr<CDMSession> CDMPrivateClearKey::createSession(CDMSessionClient* client)
+{
+ return std::make_unique<CDMSessionClearKey>(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 "LegacyCDMPrivate.h"
+
+namespace WebCore {
+
+class CDM;
+
+class CDMPrivateClearKey : public CDMPrivateInterface {
+public:
+ explicit CDMPrivateClearKey(CDM* cdm)
+ : m_cdm(cdm)
+ {
+ }
+
+ virtual ~CDMPrivateClearKey() { }
+
+ static bool supportsKeySystem(const String&);
+ static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
+
+ bool supportsMIMEType(const String& mimeType) override;
+ std::unique_ptr<CDMSession> 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 "config.h"
+#include "LegacyCDMPrivateMediaPlayer.h"
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include "LegacyCDM.h"
+#include "LegacyCDMSession.h"
+#include "ContentType.h"
+#include "MediaPlayer.h"
+
+#if PLATFORM(IOS)
+#include "SoftLinking.h"
+#endif
+
+namespace WebCore {
+
+bool CDMPrivateMediaPlayer::supportsKeySystem(const String& keySystem)
+{
+ return MediaPlayer::supportsKeySystem(keySystem, emptyString());
+}
+
+bool CDMPrivateMediaPlayer::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
+{
+ return MediaPlayer::supportsKeySystem(keySystem, mimeType);
+}
+
+bool CDMPrivateMediaPlayer::supportsMIMEType(const String& mimeType)
+{
+ return MediaPlayer::supportsKeySystem(m_cdm->keySystem(), mimeType);
+}
+
+std::unique_ptr<CDMSession> CDMPrivateMediaPlayer::createSession(CDMSessionClient* client)
+{
+ MediaPlayer* mediaPlayer = m_cdm->mediaPlayer();
+ if (!mediaPlayer)
+ return nullptr;
+
+ return mediaPlayer->createSession(m_cdm->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 "LegacyCDMPrivate.h"
+
+#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&);
+ static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
+
+ virtual ~CDMPrivateMediaPlayer() { }
+
+ bool supportsMIMEType(const String& mimeType) override;
+ std::unique_ptr<CDMSession> 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 "config.h"
+#include "LegacyCDMSessionClearKey.h"
+
+#include "ArrayValue.h"
+#include "Dictionary.h"
+#include "JSMainThreadExecState.h"
+#include "Logging.h"
+#include "TextEncoding.h"
+#include "UUID.h"
+#include "WebKitMediaKeyError.h"
+#include <runtime/JSGlobalObject.h>
+#include <runtime/JSLock.h>
+#include <runtime/JSONObject.h>
+#include <runtime/VM.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/text/Base64.h>
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+using namespace JSC;
+
+namespace WebCore {
+
+static VM& clearKeyVM()
+{
+ static NeverDestroyed<RefPtr<VM>> vm;
+ if (!vm.get())
+ vm.get() = VM::create();
+
+ return *vm.get();
+}
+
+CDMSessionClearKey::CDMSessionClearKey(CDMSessionClient* client)
+ : m_client(client)
+ , m_sessionId(createCanonicalUUIDString())
+{
+}
+
+CDMSessionClearKey::~CDMSessionClearKey()
+{
+}
+
+RefPtr<Uint8Array> CDMSessionClearKey::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& 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<char*>(m_initData->baseAddress()), m_initData->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<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode)
+{
+ UNUSED_PARAM(nextMessage);
+ UNUSED_PARAM(systemCode);
+ ASSERT(rawKeysData);
+
+ do {
+ String rawKeysString = String::fromUTF8(rawKeysData->data(), rawKeysData->length());
+ if (rawKeysString.isEmpty()) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: empty message", this);
+ continue;
+ }
+
+ VM& vm = clearKeyVM();
+ JSLockHolder lock(vm);
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ JSGlobalObject* globalObject = JSGlobalObject::create(vm, JSGlobalObject::createStructure(vm, jsNull()));
+ ExecState* exec = globalObject->globalExec();
+
+ JSLockHolder locker(clearKeyVM());
+ JSValue keysDataObject = JSONParse(exec, rawKeysString);
+ if (scope.exception() || !keysDataObject) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: invalid JSON", this);
+ break;
+ }
+ Dictionary keysDataDictionary(exec, keysDataObject);
+ ArrayValue keysArray;
+ size_t length;
+ if (!keysDataDictionary.get("keys", keysArray) || keysArray.isUndefinedOrNull() || !keysArray.length(length) || !length) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: keys array missing or empty", this);
+ break;
+ }
+
+ bool foundValidKey = false;
+ for (size_t i = 0; i < length; ++i) {
+ Dictionary keyDictionary;
+ if (!keysArray.get(i, keyDictionary) || keyDictionary.isUndefinedOrNull()) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: null keyDictionary", this);
+ continue;
+ }
+
+ String algorithm;
+ if (!keyDictionary.get("alg", algorithm) || !equalLettersIgnoringASCIICase(algorithm, "a128kw")) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: algorithm unsupported", this);
+ continue;
+ }
+
+ String keyType;
+ if (!keyDictionary.get("kty", keyType) || !equalLettersIgnoringASCIICase(keyType, "oct")) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: keyType unsupported", this);
+ continue;
+ }
+
+ String keyId;
+ if (!keyDictionary.get("kid", keyId) || keyId.isEmpty()) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: keyId missing or empty", this);
+ continue;
+ }
+
+ String rawKeyData;
+ if (!keyDictionary.get("k", rawKeyData) || rawKeyData.isEmpty()) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: key missing or empty", this);
+ continue;
+ }
+
+ Vector<uint8_t> keyData;
+ if (!base64Decode(rawKeyData, keyData) || keyData.isEmpty()) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: unable to base64 decode key", this);
+ continue;
+ }
+
+ m_cachedKeys.set(keyId, WTFMove(keyData));
+ foundValidKey = true;
+ }
+
+ if (foundValidKey)
+ return true;
+
+ } while (false);
+
+ errorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
+ return false;
+}
+
+RefPtr<ArrayBuffer> CDMSessionClearKey::cachedKeyForKeyID(const String& keyId) const
+{
+ if (!m_cachedKeys.contains(keyId))
+ return nullptr;
+
+ auto keyData = m_cachedKeys.get(keyId);
+ RefPtr<Uint8Array> keyDataArray = Uint8Array::create(keyData.data(), keyData.size());
+ return keyDataArray->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 "LegacyCDMSession.h"
+#include <wtf/HashMap.h>
+
+#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& sessionId() const override { return m_sessionId; }
+ RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array*, String&, unsigned short&, uint32_t&) override;
+ void releaseKeys() override;
+ bool update(Uint8Array*, RefPtr<Uint8Array>&, unsigned short&, uint32_t&) override;
+ RefPtr<ArrayBuffer> cachedKeyForKeyID(const String&) const override;
+
+protected:
+ CDMSessionClient* m_client;
+ RefPtr<Uint8Array> m_initData;
+ HashMap<String, Vector<uint8_t>> 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 "ActiveDOMObject.h"
</span><del>-#include "CDMSession.h"
</del><ins>+#include "LegacyCDMSession.h"
</ins><span class="cx"> #include "EventTarget.h"
</span><span class="cx"> #include "ExceptionOr.h"
</span><span class="cx"> #include "GenericEventQueue.h"
</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 "CDM.h"
</del><ins>+#include "LegacyCDM.h"
</ins><span class="cx"> #include "ExceptionOr.h"
</span><span class="cx"> #include <runtime/Uint8Array.h>
</span><span class="cx"> #include <wtf/Vector.h>
</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 = "<group>"; };
</span><span class="cx">                 CDA98DDD16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMediaKeyNeededEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CDA98DDE16026A1900FEA3B1 /* JSWebKitMediaKeyNeededEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSWebKitMediaKeyNeededEvent.h; sourceTree = "<group>"; };
</span><del>-                CDA98E091603CD5900FEA3B1 /* CDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CDM.cpp; sourceTree = "<group>"; };
-                CDA98E0A1603CD5900FEA3B1 /* CDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDM.h; sourceTree = "<group>"; };
-                CDA98E0C1603CF3C00FEA3B1 /* CDMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivate.h; sourceTree = "<group>"; };
</del><ins>+                CDA98E091603CD5900FEA3B1 /* LegacyCDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDM.cpp; sourceTree = "<group>"; };
+                CDA98E0A1603CD5900FEA3B1 /* LegacyCDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyCDM.h; sourceTree = "<group>"; };
+                CDA98E0C1603CF3C00FEA3B1 /* LegacyCDMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMPrivate.h; sourceTree = "<group>"; };
</ins><span class="cx">                 CDAA8D0714D385600061EA60 /* PlatformClockCM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCM.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformClockCM.mm; sourceTree = "<group>"; };
</span><span class="cx">                 CDAAF45D1869094E003C1717 /* mediaControlsiOS.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = mediaControlsiOS.css; sourceTree = "<group>"; };
</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 = "<group>"; };
</span><span class="cx">                 CDBEAEAB19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSelectionGroupAVFObjC.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDC1DD4117CC2C48008CB55D /* mediaControlsApple.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = mediaControlsApple.css; sourceTree = "<group>"; };
</span><del>-                CDC26B3C160A62B00026757B /* MockCDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MockCDM.cpp; sourceTree = "<group>"; };
-                CDC26B3D160A62B00026757B /* MockCDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockCDM.h; sourceTree = "<group>"; };
</del><ins>+                CDC26B3C160A62B00026757B /* LegacyMockCDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyMockCDM.cpp; sourceTree = "<group>"; };
+                CDC26B3D160A62B00026757B /* LegacyMockCDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyMockCDM.h; sourceTree = "<group>"; };
</ins><span class="cx">                 CDC69DD41632026C007C38DF /* WebCoreFullScreenWarningView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenWarningView.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDC69DD51632026C007C38DF /* WebCoreFullScreenWarningView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFullScreenWarningView.mm; sourceTree = "<group>"; };
</span><span class="cx">                 CDC69DD816371FD3007C38DF /* WebCoreFullScreenPlaceholderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenPlaceholderView.h; sourceTree = "<group>"; };
</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 = "<group>"; };
</span><span class="cx">                 CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSErrorExtras.mm; sourceTree = "<group>"; };
</span><span class="cx">                 CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreNSErrorExtras.h; sourceTree = "<group>"; };
</span><del>-                CDCA98E918B2C8D000C12FF9 /* CDMPrivateMediaPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivateMediaPlayer.h; sourceTree = "<group>"; };
-                CDCA98EA18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMPrivateMediaPlayer.cpp; sourceTree = "<group>"; };
</del><ins>+                CDCA98E918B2C8D000C12FF9 /* LegacyCDMPrivateMediaPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMPrivateMediaPlayer.h; sourceTree = "<group>"; };
+                CDCA98EA18B2C8EB00C12FF9 /* LegacyCDMPrivateMediaPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDMPrivateMediaPlayer.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 CDCD41E51C3DDB0900965D99 /* ParsedContentRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentRange.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CDCD41E61C3DDB0900965D99 /* ParsedContentRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParsedContentRange.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDCE5CD014633BC900D47CCA /* EventTargetFactory.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventTargetFactory.in; sourceTree = "<group>"; };
</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 = "<group>"; };
</span><span class="cx">                 CDD7089518359F6F002B3DC6 /* SampleMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleMap.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDDC1E7918A952F30027A9D4 /* MediaSourcePrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourcePrivateClient.h; sourceTree = "<group>"; };
</span><del>-                CDDE02E918B3DFC700CF7FF1 /* CDMSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDMSession.h; sourceTree = "<group>"; };
</del><ins>+                CDDE02E918B3DFC700CF7FF1 /* LegacyCDMSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyCDMSession.h; sourceTree = "<group>"; };
</ins><span class="cx">                 CDDE02EA18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMSessionAVFoundationObjC.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDDE02EB18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDMSessionAVFoundationObjC.mm; sourceTree = "<group>"; };
</span><span class="cx">                 CDDE02EE18B564FA00CF7FF1 /* CDMSessionAVStreamSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDMSessionAVStreamSession.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -13854,10 +13854,10 @@
</span><span class="cx">                 CDE83DB3183C441E0031EAA3 /* VideoPlaybackQuality.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = VideoPlaybackQuality.idl; sourceTree = "<group>"; };
</span><span class="cx">                 CDE83DB4183D352A0031EAA3 /* JSVideoPlaybackQuality.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVideoPlaybackQuality.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CDE83DB5183D352A0031EAA3 /* JSVideoPlaybackQuality.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVideoPlaybackQuality.h; sourceTree = "<group>"; };
</span><del>-                CDE8B5EA1A69777300B4B66A /* CDMPrivateClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMPrivateClearKey.cpp; sourceTree = "<group>"; };
-                CDE8B5EB1A69777300B4B66A /* CDMPrivateClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivateClearKey.h; sourceTree = "<group>"; };
-                CDE8B5EE1A69778B00B4B66A /* CDMSessionClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMSessionClearKey.cpp; sourceTree = "<group>"; };
-                CDE8B5EF1A69778B00B4B66A /* CDMSessionClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMSessionClearKey.h; sourceTree = "<group>"; };
</del><ins>+                CDE8B5EA1A69777300B4B66A /* LegacyCDMPrivateClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDMPrivateClearKey.cpp; sourceTree = "<group>"; };
+                CDE8B5EB1A69777300B4B66A /* LegacyCDMPrivateClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMPrivateClearKey.h; sourceTree = "<group>"; };
+                CDE8B5EE1A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDMSessionClearKey.cpp; sourceTree = "<group>"; };
+                CDE8B5EF1A69778B00B4B66A /* LegacyCDMSessionClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMSessionClearKey.h; sourceTree = "<group>"; };
</ins><span class="cx">                 CDEA762C14608224008B31F1 /* Clock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clock.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformClockCA.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CDEA762F146084EE008B31F1 /* PlatformClockCA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCA.h; sourceTree = "<group>"; };
</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 <bindings/ScriptObject.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(ENCRYPTED_MEDIA)
+#include "NotImplemented.h"
+#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 <runtime/Uint8Array.h>
-#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
-
-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& sessionId() const = 0;
- virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) = 0;
- virtual void releaseKeys() = 0;
- virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) = 0;
- virtual RefPtr<ArrayBuffer> cachedKeyForKeyID(const String&) 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 <runtime/Uint8Array.h>
+#include <wtf/Forward.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/text/WTFString.h>
+
+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& sessionId() const = 0;
+ virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) = 0;
+ virtual void releaseKeys() = 0;
+ virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) = 0;
+ virtual RefPtr<ArrayBuffer> cachedKeyForKeyID(const String&) 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 "GraphicsTypes3D.h"
</span><span class="cx">
</span><span class="cx"> #include "AudioTrackPrivate.h"
</span><del>-#include "CDMSession.h"
</del><ins>+#include "LegacyCDMSession.h"
</ins><span class="cx"> #include "InbandTextTrackPrivate.h"
</span><span class="cx"> #include "IntRect.h"
</span><span class="cx"> #include "URL.h"
</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) && ENABLE(MEDIA_SOURCE)
</span><span class="cx">
</span><del>-#include "CDMPrivate.h"
</del><ins>+#include "LegacyCDMPrivate.h"
</ins><span class="cx"> #include <wtf/Vector.h>
</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) && ENABLE(MEDIA_SOURCE)
</span><span class="cx">
</span><del>-#import "CDM.h"
</del><span class="cx"> #import "CDMSessionAVContentKeySession.h"
</span><span class="cx"> #import "CDMSessionAVStreamSession.h"
</span><span class="cx"> #import "ContentType.h"
</span><ins>+#import "LegacyCDM.h"
</ins><span class="cx"> #import "MediaPlayerPrivateMediaSourceAVFObjC.h"
</span><span class="cx"> #import "WebCoreSystemInterface.h"
</span><span class="cx"> #import <wtf/NeverDestroyed.h>
</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) && ENABLE(MEDIA_SOURCE)
</span><span class="cx">
</span><del>-#import "CDM.h"
</del><ins>+#import "LegacyCDM.h"
</ins><span class="cx"> #import "CDMPrivateMediaSourceAVFObjC.h"
</span><span class="cx"> #import "FileSystem.h"
</span><span class="cx"> #import "Logging.h"
</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 "CDMSession.h"
</del><ins>+#include "LegacyCDMSession.h"
</ins><span class="cx"> #include <wtf/RetainPtr.h>
</span><span class="cx"> #include <wtf/WeakPtr.h>
</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 "CDM.h"
-#import "CDMSession.h"
</del><ins>+#import "LegacyCDM.h"
+#import "LegacyCDMSession.h"
</ins><span class="cx"> #import "MediaPlayer.h"
</span><span class="cx"> #import "MediaPlayerPrivateAVFoundationObjC.h"
</span><span class="cx"> #import "SoftLinking.h"
</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) && ENABLE(MEDIA_SOURCE)
</span><span class="cx">
</span><span class="cx"> #import "AVFoundationSPI.h"
</span><del>-#import "CDM.h"
</del><ins>+#import "LegacyCDM.h"
</ins><span class="cx"> #import "CDMPrivateMediaSourceAVFObjC.h"
</span><span class="cx"> #import "FileSystem.h"
</span><span class="cx"> #import "Logging.h"
</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 "CDMSession.h"
</del><ins>+#include "LegacyCDMSession.h"
</ins><span class="cx"> #include "SourceBufferPrivateAVFObjC.h"
</span><span class="cx"> #include <wtf/RetainPtr.h>
</span><span class="cx"> #include <wtf/WeakPtr.h>
</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<FloatSize> 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 && m_mediaSource->player()->hasStreamSession())
</span><span class="cx"> [m_mediaSource->player()->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 "CDM.h"
-#include "MockCDM.h"
</del><ins>+#include "LegacyCDM.h"
+#include "LegacyMockCDM.h"
</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 "config.h"
+#include "LegacyMockCDM.h"
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+
+#include "LegacyCDM.h"
+#include "LegacyCDMSession.h"
+#include "WebKitMediaKeyError.h"
+#include <runtime/JSCInlines.h>
+#include <runtime/TypedArrayInlines.h>
+#include <runtime/Uint8Array.h>
+
+namespace WebCore {
+
+class MockCDMSession : public CDMSession {
+public:
+ MockCDMSession(CDMSessionClient*);
+ virtual ~MockCDMSession() { }
+
+ void setClient(CDMSessionClient* client) override { m_client = client; }
+ const String& sessionId() const override { return m_sessionId; }
+ RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
+ void releaseKeys() override;
+ bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
+
+protected:
+ CDMSessionClient* m_client;
+ String m_sessionId;
+};
+
+bool MockCDM::supportsKeySystem(const String& keySystem)
+{
+ return equalLettersIgnoringASCIICase(keySystem, "com.webcore.mock");
+}
+
+bool MockCDM::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
+{
+ if (!supportsKeySystem(keySystem))
+ return false;
+
+ return equalLettersIgnoringASCIICase(mimeType, "video/mock");
+}
+
+bool MockCDM::supportsMIMEType(const String& mimeType)
+{
+ return equalLettersIgnoringASCIICase(mimeType, "video/mock");
+}
+
+std::unique_ptr<CDMSession> MockCDM::createSession(CDMSessionClient* client)
+{
+ return std::make_unique<MockCDMSession>(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<Uint8Array> MockCDMSession::generateKeyRequest(const String&, Uint8Array* initData, String&, unsigned short& errorCode, uint32_t&)
+{
+ for (unsigned i = 0; i < initDataPrefix()->length(); ++i) {
+ if (!initData || i >= initData->length() || initData->item(i) != initDataPrefix()->item(i)) {
+ errorCode = WebKitMediaKeyError::MEDIA_KEYERR_UNKNOWN;
+ return nullptr;
+ }
+ }
+ return keyRequest();
+}
+
+void MockCDMSession::releaseKeys()
+{
+ // no-op
+}
+
+bool MockCDMSession::update(Uint8Array* key, RefPtr<Uint8Array>&, unsigned short& errorCode, uint32_t&)
+{
+ for (unsigned i = 0; i < keyPrefix()->length(); ++i) {
+ if (i >= key->length() || key->item(i) != keyPrefix()->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 "LegacyCDMPrivate.h"
+
+namespace WebCore {
+
+class CDM;
+
+class MockCDM : public CDMPrivateInterface {
+public:
+ explicit MockCDM(CDM* cdm)
+ : m_cdm(cdm)
+ { }
+
+ // CDMFactory support:
+ static bool supportsKeySystem(const String&);
+ static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
+
+ virtual ~MockCDM() { }
+
+ bool supportsMIMEType(const String& mimeType) override;
+ std::unique_ptr<CDMSession> 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 "config.h"
-#include "MockCDM.h"
-
-#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-
-#include "CDM.h"
-#include "CDMSession.h"
-#include "WebKitMediaKeyError.h"
-#include <runtime/JSCInlines.h>
-#include <runtime/TypedArrayInlines.h>
-#include <runtime/Uint8Array.h>
-
-namespace WebCore {
-
-class MockCDMSession : public CDMSession {
-public:
- MockCDMSession(CDMSessionClient*);
- virtual ~MockCDMSession() { }
-
- void setClient(CDMSessionClient* client) override { m_client = client; }
- const String& sessionId() const override { return m_sessionId; }
- RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
- void releaseKeys() override;
- bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
-
-protected:
- CDMSessionClient* m_client;
- String m_sessionId;
-};
-
-bool MockCDM::supportsKeySystem(const String& keySystem)
-{
- return equalLettersIgnoringASCIICase(keySystem, "com.webcore.mock");
-}
-
-bool MockCDM::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
-{
- if (!supportsKeySystem(keySystem))
- return false;
-
- return equalLettersIgnoringASCIICase(mimeType, "video/mock");
-}
-
-bool MockCDM::supportsMIMEType(const String& mimeType)
-{
- return equalLettersIgnoringASCIICase(mimeType, "video/mock");
-}
-
-std::unique_ptr<CDMSession> MockCDM::createSession(CDMSessionClient* client)
-{
- return std::make_unique<MockCDMSession>(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<Uint8Array> MockCDMSession::generateKeyRequest(const String&, Uint8Array* initData, String&, unsigned short& errorCode, uint32_t&)
-{
- for (unsigned i = 0; i < initDataPrefix()->length(); ++i) {
- if (!initData || i >= initData->length() || initData->item(i) != initDataPrefix()->item(i)) {
- errorCode = WebKitMediaKeyError::MEDIA_KEYERR_UNKNOWN;
- return nullptr;
- }
- }
- return keyRequest();
-}
-
-void MockCDMSession::releaseKeys()
-{
- // no-op
-}
-
-bool MockCDMSession::update(Uint8Array* key, RefPtr<Uint8Array>&, unsigned short& errorCode, uint32_t&)
-{
- for (unsigned i = 0; i < keyPrefix()->length(); ++i) {
- if (i >= key->length() || key->item(i) != keyPrefix()->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 "CDMPrivate.h"
-
-namespace WebCore {
-
-class CDM;
-
-class MockCDM : public CDMPrivateInterface {
-public:
- explicit MockCDM(CDM* cdm)
- : m_cdm(cdm)
- { }
-
- // CDMFactory support:
- static bool supportsKeySystem(const String&);
- static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
-
- virtual ~MockCDM() { }
-
- bool supportsMIMEType(const String& mimeType) override;
- std::unique_ptr<CDMSession> createSession(CDMSessionClient*) override;
-
-protected:
- CDM* m_cdm;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</del></span></pre>
</div>
</div>
</body>
</html>