<!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>[164514] 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/164514">164514</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2014-02-21 16:13:01 -0800 (Fri, 21 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Make a generic CDMPrivateMediaPlayer and move its CDMSession into platform/.
https://bugs.webkit.org/show_bug.cgi?id=129164
Reviewed by Eric Carlson.
Move the session created by CDMPrivateAVFoundation into platform, and rename
CDMPrivateAVFoundation to CDMPrivateMediaPlayer. Future media engines who want
to support a keysystem from within the media engine can create their own
CDMSession as part of the MediaPlayerPrivate interface.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::installedCDMFactories):
(WebCore::CDM::createSession):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/CDMPrivateAVFoundation.mm: Removed.
* Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.cpp.
(WebCore::CDMPrivateMediaPlayer::supportsKeySystem):
(WebCore::CDMPrivateMediaPlayer::supportsKeySystemAndMimeType):
(WebCore::CDMPrivateMediaPlayer::supportsMIMEType):
(WebCore::CDMPrivateMediaPlayer::createSession):
* Modules/encryptedmedia/CDMPrivateMediaPlayer.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h.
(WebCore::CDMPrivateMediaPlayer::create):
(WebCore::CDMPrivateMediaPlayer::~CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::cdm):
(WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/CDMSession.h: Extracted from CDMPrivateAVFoundation.h.
(WebCore::CDMSessionClient::~CDMSessionClient):
(WebCore::CDMSession::CDMSession):
(WebCore::CDMSession::~CDMSession):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::createSession):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::createSession):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h.
(WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.mm.
(WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
(WebCore::CDMSessionAVFoundationObjC::releaseKeys):
(WebCore::CDMSessionAVFoundationObjC::update):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
* testing/MockCDM.cpp:
(WebCore::MockCDMSession::setClient):
(WebCore::MockCDM::createSession):
* testing/MockCDM.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<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="#trunkSourceWebCoreModulesencryptedmediaMediaKeySessioncpp">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeySessionh">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</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>
<h3>Added Paths</h3>
<ul>
<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="#trunkSourceWebCoreplatformgraphicsCDMSessionh">trunk/Source/WebCore/platform/graphics/CDMSession.h</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>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMPrivateAVFoundationh">trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMPrivateAVFoundationmm">trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/ChangeLog        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -1,5 +1,60 @@
</span><span class="cx"> 2014-02-21 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><ins>+ Make a generic CDMPrivateMediaPlayer and move its CDMSession into platform/.
+ https://bugs.webkit.org/show_bug.cgi?id=129164
+
+ Reviewed by Eric Carlson.
+
+ Move the session created by CDMPrivateAVFoundation into platform, and rename
+ CDMPrivateAVFoundation to CDMPrivateMediaPlayer. Future media engines who want
+ to support a keysystem from within the media engine can create their own
+ CDMSession as part of the MediaPlayerPrivate interface.
+
+ * Modules/encryptedmedia/CDM.cpp:
+ (WebCore::installedCDMFactories):
+ (WebCore::CDM::createSession):
+ * Modules/encryptedmedia/CDM.h:
+ * Modules/encryptedmedia/CDMPrivate.h:
+ * Modules/encryptedmedia/MediaKeySession.cpp:
+ * Modules/encryptedmedia/MediaKeySession.h:
+ * Modules/encryptedmedia/CDMPrivateAVFoundation.mm: Removed.
+ * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.cpp.
+ (WebCore::CDMPrivateMediaPlayer::supportsKeySystem):
+ (WebCore::CDMPrivateMediaPlayer::supportsKeySystemAndMimeType):
+ (WebCore::CDMPrivateMediaPlayer::supportsMIMEType):
+ (WebCore::CDMPrivateMediaPlayer::createSession):
+ * Modules/encryptedmedia/CDMPrivateMediaPlayer.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h.
+ (WebCore::CDMPrivateMediaPlayer::create):
+ (WebCore::CDMPrivateMediaPlayer::~CDMPrivateMediaPlayer):
+ (WebCore::CDMPrivateMediaPlayer::cdm):
+ (WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/CDMSession.h: Extracted from CDMPrivateAVFoundation.h.
+ (WebCore::CDMSessionClient::~CDMSessionClient):
+ (WebCore::CDMSession::CDMSession):
+ (WebCore::CDMSession::~CDMSession):
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::createSession):
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::createSession):
+ * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h.
+ (WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC):
+ * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.mm.
+ (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
+ (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
+ (WebCore::CDMSessionAVFoundationObjC::releaseKeys):
+ (WebCore::CDMSessionAVFoundationObjC::update):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
+ * testing/MockCDM.cpp:
+ (WebCore::MockCDMSession::setClient):
+ (WebCore::MockCDM::createSession):
+ * testing/MockCDM.h:
+
+2014-02-21 Jer Noble <jer.noble@apple.com>
+
</ins><span class="cx"> Add a supportsKeySystem media engine factory parameter.
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=129161
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -29,15 +29,12 @@
</span><span class="cx">
</span><span class="cx"> #include "CDM.h"
</span><span class="cx">
</span><del>-#include "CDMPrivate.h"
</del><ins>+#include "CDMPrivateMediaPlayer.h"
+#include "CDMSession.h"
</ins><span class="cx"> #include "MediaKeyError.h"
</span><span class="cx"> #include "MediaKeys.h"
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
-#include "CDMPrivateAVFoundation.h"
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> struct CDMFactory {
</span><span class="lines">@@ -63,10 +60,7 @@
</span><span class="cx"> queriedCDMs = true;
</span><span class="cx">
</span><span class="cx"> // FIXME: initialize specific UA CDMs. http://webkit.org/b/109318, http://webkit.org/b/109320
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
- cdms.append(new CDMFactory(CDMPrivateAVFoundation::create, CDMPrivateAVFoundation::supportsKeySystem, CDMPrivateAVFoundation::supportsKeySystemAndMimeType));
-#endif
-
</del><ins>+ cdms.append(new CDMFactory(CDMPrivateMediaPlayer::create, CDMPrivateMediaPlayer::supportsKeySystem, CDMPrivateMediaPlayer::supportsKeySystemAndMimeType));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return cdms;
</span><span class="lines">@@ -123,7 +117,7 @@
</span><span class="cx"> return m_private->supportsMIMEType(mimeType);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassOwnPtr<CDMSession> CDM::createSession()
</del><ins>+std::unique_ptr<CDMSession> CDM::createSession()
</ins><span class="cx"> {
</span><span class="cx"> return m_private->createSession();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.h (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.h        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><span class="cx">
</span><ins>+#include "CDMSession.h"
</ins><span class="cx"> #include <runtime/Uint8Array.h>
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="lines">@@ -37,7 +38,6 @@
</span><span class="cx">
</span><span class="cx"> class CDM;
</span><span class="cx"> class CDMPrivateInterface;
</span><del>-class CDMSession;
</del><span class="cx"> class MediaPlayer;
</span><span class="cx">
</span><span class="cx"> typedef PassOwnPtr<CDMPrivateInterface> (*CreateCDM)(CDM*);
</span><span class="lines">@@ -51,17 +51,6 @@
</span><span class="cx"> virtual MediaPlayer* cdmMediaPlayer(const CDM*) const = 0;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-class CDMSession {
-public:
- CDMSession() { }
- virtual ~CDMSession() { }
-
- virtual const String& sessionId() const = 0;
- virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) = 0;
- virtual void releaseKeys() = 0;
- virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) = 0;
-};
-
</del><span class="cx"> class CDM {
</span><span class="cx"> public:
</span><span class="cx">
</span><span class="lines">@@ -73,7 +62,7 @@
</span><span class="cx"> ~CDM();
</span><span class="cx">
</span><span class="cx"> bool supportsMIMEType(const String&) const;
</span><del>- PassOwnPtr<CDMSession> createSession();
</del><ins>+ std::unique_ptr<CDMSession> createSession();
</ins><span class="cx">
</span><span class="cx"> const String& keySystem() const { return m_keySystem; }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">
</span><span class="cx"> virtual bool supportsMIMEType(const String&) = 0;
</span><span class="cx">
</span><del>- virtual PassOwnPtr<CDMSession> createSession() = 0;
</del><ins>+ virtual std::unique_ptr<CDMSession> createSession() = 0;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateAVFoundationh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -1,62 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 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 CDMPrivateAVFoundation_h
-#define CDMPrivateAVFoundation_h
-
-#include "CDMPrivate.h"
-#include <wtf/PassOwnPtr.h>
-#include <wtf/RetainPtr.h>
-
-#if ENABLE(ENCRYPTED_MEDIA_V2) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
-
-namespace WebCore {
-
-class CDM;
-
-class CDMPrivateAVFoundation : public CDMPrivateInterface {
-public:
- // CDMFactory support:
- static PassOwnPtr<CDMPrivateInterface> create(CDM* cdm) { return adoptPtr(new CDMPrivateAVFoundation(cdm)); }
- static bool supportsKeySystem(const String&);
- static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
-
- virtual ~CDMPrivateAVFoundation() { }
-
- virtual bool supportsMIMEType(const String& mimeType) override;
- virtual PassOwnPtr<CDMSession> createSession() override;
-
- CDM* cdm() const { return m_cdm; }
-
-protected:
- CDMPrivateAVFoundation(CDM* cdm) : m_cdm(cdm) { }
- CDM* m_cdm;
-};
-
-}
-
-#endif
-
-#endif // CDMPrivateAVFoundation_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateAVFoundationmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.mm (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.mm        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.mm        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -1,154 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 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.
- */
-
-#import "config.h"
-#import "CDMPrivateAVFoundation.h"
-
-#if ENABLE(ENCRYPTED_MEDIA_V2) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
-
-#import "CDM.h"
-#import "ExceptionCode.h"
-#import "MediaPlayer.h"
-#import "MediaPlayerPrivateAVFoundationObjC.h"
-#import "SoftLinking.h"
-#import "UUID.h"
-#import <AVFoundation/AVFoundation.h>
-#import <objc/objc-runtime.h>
-
-namespace WebCore {
-
-class CDMSessionAVFoundation : public CDMSession {
-public:
- CDMSessionAVFoundation(CDMPrivateAVFoundation* parent);
- virtual ~CDMSessionAVFoundation() { }
-
- virtual const String& sessionId() const override { return m_sessionId; }
- virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) override;
- virtual void releaseKeys() override;
- virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) override;
-
-protected:
- CDMPrivateAVFoundation* m_parent;
- String m_sessionId;
- RetainPtr<AVAssetResourceLoadingRequest> m_request;
-};
-
-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVURLAsset)
-SOFT_LINK_CLASS(AVFoundation, AVAssetResourceLoadingRequest)
-#define AVURLAsset getAVURLAssetClass()
-#define AVAssetResourceLoadingRequest getAVAssetResourceLoadingRequest()
-
-
-bool CDMPrivateAVFoundation::supportsKeySystem(const String& keySystem)
-{
- return equalIgnoringCase(keySystem, "com.apple.fps") || equalIgnoringCase(keySystem, "com.apple.fps.1_0");
-}
-
-bool CDMPrivateAVFoundation::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
-{
- if (!supportsKeySystem(keySystem))
- return false;
- return [AVURLAsset isPlayableExtendedMIMEType:mimeType];
-}
-
-bool CDMPrivateAVFoundation::supportsMIMEType(const String& mimeType)
-{
- return [AVURLAsset isPlayableExtendedMIMEType:mimeType];
-}
-
-PassOwnPtr<CDMSession> CDMPrivateAVFoundation::createSession()
-{
- return adoptPtr(new CDMSessionAVFoundation(this));
-}
-
-CDMSessionAVFoundation::CDMSessionAVFoundation(CDMPrivateAVFoundation* parent)
- : m_parent(parent)
- , m_sessionId(createCanonicalUUIDString())
-{
-}
-
-static unsigned short MediaKeyExceptionToErrorCode(MediaPlayer::MediaKeyException error)
-{
- switch (error) {
- case MediaPlayer::NoError:
- return 0;
- case MediaPlayer::InvalidPlayerState:
- return INVALID_STATE_ERR;
- case MediaPlayer::KeySystemNotSupported:
- return NOT_SUPPORTED_ERR;
- default:
- ASSERT_NOT_REACHED();
- return 0;
- }
-}
-
-PassRefPtr<Uint8Array> CDMSessionAVFoundation::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode)
-{
- UNUSED_PARAM(mimeType);
-
- MediaPlayer* mediaPlayer = m_parent->cdm()->mediaPlayer();
- if (!mediaPlayer) {
- errorCode = NOT_SUPPORTED_ERR;
- return nullptr;
- }
-
- m_sessionId = createCanonicalUUIDString();
-
- MediaPlayer::MediaKeyException error;
- RefPtr<Uint8Array> request = mediaPlayer->generateKeyRequest(m_sessionId, mimeType, initData, destinationURL, error, systemCode);
- errorCode = MediaKeyExceptionToErrorCode(error);
- return request;
-}
-
-void CDMSessionAVFoundation::releaseKeys()
-{
- MediaPlayer* mediaPlayer = m_parent->cdm()->mediaPlayer();
- if (!mediaPlayer)
- return;
-
- mediaPlayer->releaseKeys(m_sessionId);
-}
-
-bool CDMSessionAVFoundation::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode)
-{
- if (!key)
- return false;
-
- MediaPlayer* mediaPlayer = m_parent->cdm()->mediaPlayer();
- if (!mediaPlayer) {
- errorCode = NOT_SUPPORTED_ERR;
- return nullptr;
- }
-
- MediaPlayer::MediaKeyException error;
- bool succeeded = mediaPlayer->update(m_sessionId, key, nextMessage, error, systemCode);
- errorCode = MediaKeyExceptionToErrorCode(error);
- return succeeded;
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateMediaPlayercppfromrev164513trunkSourceWebCoreModulesencryptedmediaCDMPrivateh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp (from rev 164513, trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h) (0 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp         (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -0,0 +1,66 @@
</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.
+ */
+
+#import "config.h"
+#import "CDMPrivateMediaPlayer.h"
+
+#if ENABLE(ENCRYPTED_MEDIA_V2)
+
+#import "CDM.h"
+#import "CDMSession.h"
+#import "ContentType.h"
+#import "ExceptionCode.h"
+#import "MediaPlayer.h"
+#import "SoftLinking.h"
+
+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()
+{
+ MediaPlayer* mediaPlayer = m_cdm->mediaPlayer();
+ if (!mediaPlayer)
+ return nullptr;
+
+ return mediaPlayer->createSession(m_cdm->keySystem());
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMPrivateMediaPlayerhfromrev164513trunkSourceWebCoreModulesencryptedmediaCDMPrivateAVFoundationh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h (from rev 164513, trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h) (0 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h         (rev 0)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -0,0 +1,61 @@
</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 CDMPrivateMediaPlayer_h
+#define CDMPrivateMediaPlayer_h
+
+#include "CDMPrivate.h"
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RetainPtr.h>
+
+#if ENABLE(ENCRYPTED_MEDIA_V2)
+
+namespace WebCore {
+
+class CDM;
+
+class CDMPrivateMediaPlayer : public CDMPrivateInterface {
+public:
+ static PassOwnPtr<CDMPrivateInterface> create(CDM* cdm) { return adoptPtr(new CDMPrivateMediaPlayer(cdm)); }
+ static bool supportsKeySystem(const String&);
+ static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
+
+ virtual ~CDMPrivateMediaPlayer() { }
+
+ virtual bool supportsMIMEType(const String& mimeType) override;
+ virtual std::unique_ptr<CDMSession> createSession() override;
+
+ CDM* cdm() const { return m_cdm; }
+
+protected:
+ CDMPrivateMediaPlayer(CDM* cdm) : m_cdm(cdm) { }
+ CDM* m_cdm;
+};
+
+}
+
+#endif
+
+#endif // CDMPriavateMediaPlayer_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeySessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><span class="cx">
</span><span class="cx"> #include "CDM.h"
</span><ins>+#include "CDMSession.h"
</ins><span class="cx"> #include "Event.h"
</span><span class="cx"> #include "GenericEventQueue.h"
</span><span class="cx"> #include "MediaKeyError.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeySessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> String m_sessionId;
</span><span class="cx"> RefPtr<MediaKeyError> m_error;
</span><span class="cx"> GenericEventQueue m_asyncEventQueue;
</span><del>- OwnPtr<CDMSession> m_session;
</del><ins>+ std::unique_ptr<CDMSession> m_session;
</ins><span class="cx">
</span><span class="cx"> struct PendingKeyRequest {
</span><span class="cx"> PendingKeyRequest(const String& mimeType, Uint8Array* initData) : mimeType(mimeType), initData(initData) { }
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -5462,7 +5462,6 @@
</span><span class="cx">                 CD3E251C18046B0600E27F56 /* GridCoordinate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3E251B18046B0600E27F56 /* GridCoordinate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CD3E252318046BCD00E27F56 /* CSSGridTemplateAreasValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3E252118046BCD00E27F56 /* CSSGridTemplateAreasValue.cpp */; };
</span><span class="cx">                 CD3E252418046BCD00E27F56 /* CSSGridTemplateAreasValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3E252218046BCD00E27F56 /* CSSGridTemplateAreasValue.h */; };
</span><del>-                CD47B3FC16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD47B3FA16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm */; };
</del><span class="cx">                 CD4AC52A1496AE9A0087C4EF /* Composite.wav in Copy Audio Resources */ = {isa = PBXBuildFile; fileRef = CD4AC5281496AE2F0087C4EF /* Composite.wav */; };
</span><span class="cx">                 CD5393D3175E018600C07123 /* JSMemoryInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5393D1175E018600C07123 /* JSMemoryInfo.cpp */; };
</span><span class="cx">                 CD5393D4175E018600C07123 /* JSMemoryInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5393D2175E018600C07123 /* JSMemoryInfo.h */; };
</span><span class="lines">@@ -5535,10 +5534,13 @@
</span><span class="cx">                 CDC8B5AB18047FF10016E685 /* SourceBufferPrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */; };
</span><span class="cx">                 CDC8B5AD1804AE5D0016E685 /* SourceBufferPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */; };
</span><span class="cx">                 CDCA82961679100F00875714 /* TextTrackRepresentationIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */; };
</span><ins>+                CDCA98EB18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCA98EA18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp */; };
</ins><span class="cx">                 CDD525D7145B6DD0008D204D /* JSHTMLMediaElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDF65CCC145B6AFE00C4C7AA /* JSHTMLMediaElementCustom.cpp */; };
</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><ins>+                CDDD571518B57A8200A94FCB /* CDMSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CDDE02E918B3DFC700CF7FF1 /* CDMSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                CDDE02ED18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDDE02EB18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm */; };
</ins><span class="cx">                 CDE3A85417F5FCE600C5BE20 /* AudioTrackPrivateAVF.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE3A85217F5FCE600C5BE20 /* AudioTrackPrivateAVF.h */; };
</span><span class="cx">                 CDE3A85717F6020400C5BE20 /* AudioTrackPrivateAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDE3A85517F6020400C5BE20 /* AudioTrackPrivateAVFObjC.mm */; };
</span><span class="cx">                 CDE3A85817F6020400C5BE20 /* AudioTrackPrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE3A85617F6020400C5BE20 /* AudioTrackPrivateAVFObjC.h */; };
</span><span class="lines">@@ -12690,8 +12692,6 @@
</span><span class="cx">                 CD3E251B18046B0600E27F56 /* GridCoordinate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GridCoordinate.h; path = style/GridCoordinate.h; sourceTree = "<group>"; };
</span><span class="cx">                 CD3E252118046BCD00E27F56 /* CSSGridTemplateAreasValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSGridTemplateAreasValue.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CD3E252218046BCD00E27F56 /* CSSGridTemplateAreasValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGridTemplateAreasValue.h; sourceTree = "<group>"; };
</span><del>-                CD47B3F916CC34F800A21EC8 /* CDMPrivateAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivateAVFoundation.h; sourceTree = "<group>"; };
-                CD47B3FA16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDMPrivateAVFoundation.mm; sourceTree = "<group>"; };
</del><span class="cx">                 CD4AC5281496AE2F0087C4EF /* Composite.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = Composite.wav; path = platform/audio/resources/Composite.wav; sourceTree = SOURCE_ROOT; };
</span><span class="cx">                 CD4E0AFA11F7BC27009D3811 /* fullscreen.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = fullscreen.css; sourceTree = "<group>"; };
</span><span class="cx">                 CD5393CB175DCCE600C07123 /* MemoryInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInfo.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -12799,11 +12799,16 @@
</span><span class="cx">                 CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SourceBufferPrivateAVFObjC.h; path = objc/SourceBufferPrivateAVFObjC.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivateClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextTrackRepresentationIOS.mm; sourceTree = "<group>"; };
</span><ins>+                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>"; };
</ins><span class="cx">                 CDCE5CD014633BC900D47CCA /* EventTargetFactory.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventTargetFactory.in; sourceTree = "<group>"; };
</span><span class="cx">                 CDD1E525167BA56400CE820B /* TextTrackRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRepresentation.h; sourceTree = "<group>"; };
</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><ins>+                CDDE02E918B3DFC700CF7FF1 /* CDMSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDMSession.h; sourceTree = "<group>"; };
+                CDDE02EA18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDMSessionAVFoundationObjC.h; path = objc/CDMSessionAVFoundationObjC.h; sourceTree = "<group>"; };
+                CDDE02EB18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CDMSessionAVFoundationObjC.mm; path = objc/CDMSessionAVFoundationObjC.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 CDE3A85217F5FCE600C5BE20 /* AudioTrackPrivateAVF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioTrackPrivateAVF.h; sourceTree = "<group>"; };
</span><span class="cx">                 CDE3A85517F6020400C5BE20 /* AudioTrackPrivateAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AudioTrackPrivateAVFObjC.mm; path = objc/AudioTrackPrivateAVFObjC.mm; sourceTree = "<group>"; };
</span><span class="cx">                 CDE3A85617F6020400C5BE20 /* AudioTrackPrivateAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioTrackPrivateAVFObjC.h; path = objc/AudioTrackPrivateAVFObjC.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -19783,6 +19788,7 @@
</span><span class="cx">                                 BEF29EE91715DD0900C4B4C9 /* AudioTrackPrivate.h */,
</span><span class="cx">                                 A89943270B42338700D7C802 /* BitmapImage.cpp */,
</span><span class="cx">                                 A89943260B42338700D7C802 /* BitmapImage.h */,
</span><ins>+                                CDDE02E918B3DFC700CF7FF1 /* CDMSession.h */,
</ins><span class="cx">                                 B27535380B053814002CE64F /* Color.cpp */,
</span><span class="cx">                                 B27535390B053814002CE64F /* Color.h */,
</span><span class="cx">                                 9382DF5710A8D5C900925652 /* ColorSpace.h */,
</span><span class="lines">@@ -20898,8 +20904,8 @@
</span><span class="cx">                                 CDA98E091603CD5900FEA3B1 /* CDM.cpp */,
</span><span class="cx">                                 CDA98E0A1603CD5900FEA3B1 /* CDM.h */,
</span><span class="cx">                                 CDA98E0C1603CF3C00FEA3B1 /* CDMPrivate.h */,
</span><del>-                                CD47B3F916CC34F800A21EC8 /* CDMPrivateAVFoundation.h */,
-                                CD47B3FA16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm */,
</del><ins>+                                CDCA98E918B2C8D000C12FF9 /* CDMPrivateMediaPlayer.h */,
+                                CDCA98EA18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp */,
</ins><span class="cx">                                 CDA98DD516025BED00FEA3B1 /* MediaKeyMessageEvent.cpp */,
</span><span class="cx">                                 CDA98DD616025BED00FEA3B1 /* MediaKeyMessageEvent.h */,
</span><span class="cx">                                 CDA98DD716025BEE00FEA3B1 /* MediaKeyMessageEvent.idl */,
</span><span class="lines">@@ -21004,6 +21010,8 @@
</span><span class="cx">                                 CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */,
</span><span class="cx">                                 CD336F6017F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h */,
</span><span class="cx">                                 CD336F5F17F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.mm */,
</span><ins>+                                CDDE02EA18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.h */,
+                                CDDE02EB18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm */,
</ins><span class="cx">                                 07AA6B69166D019500D45671 /* InbandTextTrackPrivateAVFObjC.h */,
</span><span class="cx">                                 07AA6B6A166D019500D45671 /* InbandTextTrackPrivateAVFObjC.mm */,
</span><span class="cx">                                 07367DDD172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h */,
</span><span class="lines">@@ -24066,6 +24074,7 @@
</span><span class="cx">                                 1ABA80001897341200DCE9D6 /* VisitedLinkProvider.h in Headers */,
</span><span class="cx">                                 2E0888D51148848A00AF4265 /* JSDOMFormData.h in Headers */,
</span><span class="cx">                                 E1C36C030EB076D6007410BC /* JSDOMGlobalObject.h in Headers */,
</span><ins>+                                CDDD571518B57A8200A94FCB /* CDMSession.h in Headers */,
</ins><span class="cx">                                 65DF31F809D1CC60000BE325 /* JSDOMImplementation.h in Headers */,
</span><span class="cx">                                 A9D248070D757E7D00FDF959 /* JSDOMMimeType.h in Headers */,
</span><span class="cx">                                 A9D248090D757E7D00FDF959 /* JSDOMMimeTypeArray.h in Headers */,
</span><span class="lines">@@ -26447,7 +26456,6 @@
</span><span class="cx">                                 6550B69D099DF0270090D781 /* CDATASection.cpp in Sources */,
</span><span class="cx">                                 078E090917D14CEE00420AA1 /* RTCIceCandidate.cpp in Sources */,
</span><span class="cx">                                 CDA98E0B1603CD6000FEA3B1 /* CDM.cpp in Sources */,
</span><del>-                                CD47B3FC16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm in Sources */,
</del><span class="cx">                                 990A1A0418ADA48400183FD1 /* ReplayInputTypes.cpp in Sources */,
</span><span class="cx">                                 E1A8E56617552B2A007488E7 /* CFURLExtras.cpp in Sources */,
</span><span class="cx">                                 97BC69DC1505F076001B74AC /* ChangeVersionWrapper.cpp in Sources */,
</span><span class="lines">@@ -27111,6 +27119,7 @@
</span><span class="cx">                                 977B3866122883E900B81FF8 /* HTMLDocumentParser.cpp in Sources */,
</span><span class="cx">                                 93309DE7099E64920056E581 /* htmlediting.cpp in Sources */,
</span><span class="cx">                                 A516E8B8136E04DB0076C3C0 /* LocalizedDateCache.mm in Sources */,
</span><ins>+                                CDDE02ED18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm in Sources */,
</ins><span class="cx">                                 93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */,
</span><span class="cx">                                 E157A8F018185425009F821D /* JSCryptoAlgorithmBuilder.cpp in Sources */,
</span><span class="cx">                                 A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */,
</span><span class="lines">@@ -27805,6 +27814,7 @@
</span><span class="cx">                                 B27B28270CEF0C0700D39D54 /* JSSVGGlyphElement.cpp in Sources */,
</span><span class="cx">                                 070363E1181A1CDC00C074A5 /* AVAudioCaptureSource.mm in Sources */,
</span><span class="cx">                                 24D9129813CA96DE00D21915 /* JSSVGGlyphRefElement.cpp in Sources */,
</span><ins>+                                CDCA98EB18B2C8EB00C12FF9 /* CDMPrivateMediaPlayer.cpp in Sources */,
</ins><span class="cx">                                 B2FA3D9C0AB75A6F000E5AC4 /* JSSVGGradientElement.cpp in Sources */,
</span><span class="cx">                                 85174EC2BCCAF17EAE3F46F8 /* JSSVGGraphicsElement.cpp in Sources */,
</span><span class="cx">                                 8485227B1190162C006EDC7F /* JSSVGHKernElement.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsCDMSessionhfromrev164513trunkSourceWebCoreModulesencryptedmediaCDMPrivateh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/CDMSession.h (from rev 164513, trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h) (0 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/CDMSession.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/CDMSession.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -0,0 +1,60 @@
</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(ENCRYPTED_MEDIA_V2)
+
+#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;
+};
+
+class CDMSession {
+public:
+ CDMSession() { }
+ virtual ~CDMSession() { }
+
+ virtual void setClient(CDMSessionClient*) = 0;
+ virtual const String& sessionId() const = 0;
+ virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) = 0;
+ virtual void releaseKeys() = 0;
+ virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) = 0;
+};
+
+}
+
+#endif // ENABLE(ENCRYPTED_MEDIA_V2)
+
+#endif // CDMSession_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -526,20 +526,10 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>-PassRefPtr<Uint8Array> MediaPlayer::generateKeyRequest(const String& sessionID, const String& mimeType, Uint8Array* initData, String& destinationURL, MediaKeyException& error, unsigned long& systemCode)
</del><ins>+std::unique_ptr<CDMSession> MediaPlayer::createSession(const String& keySystem)
</ins><span class="cx"> {
</span><del>- return m_private->generateKeyRequest(sessionID, mimeType, initData, destinationURL, error, systemCode);
</del><ins>+ return m_private->createSession(keySystem);
</ins><span class="cx"> }
</span><del>-
-void MediaPlayer::releaseKeys(const String& sessionID)
-{
- m_private->releaseKeys(sessionID);
-}
-
-bool MediaPlayer::update(const String& sessionID, Uint8Array* key, RefPtr<Uint8Array>& nextMessage, MediaKeyException& error, unsigned long& systemCode)
-{
- return m_private->update(sessionID, key, nextMessage, error, systemCode);
-}
</del><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> double MediaPlayer::duration() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #include "AudioTrackPrivate.h"
</span><ins>+#include "CDMSession.h"
</ins><span class="cx"> #include "InbandTextTrackPrivate.h"
</span><span class="cx"> #include "IntRect.h"
</span><span class="cx"> #include "URL.h"
</span><span class="lines">@@ -329,9 +330,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>- PassRefPtr<Uint8Array> generateKeyRequest(const String& sessionID, const String& mimeType, Uint8Array* initData, String& destinationURL, MediaKeyException& error, unsigned long& systemCode);
- void releaseKeys(const String& sessionID);
- bool update(const String& sessionID, Uint8Array* key, RefPtr<Uint8Array>& nextMessage, MediaKeyException& error, unsigned long& systemCode);
</del><ins>+ std::unique_ptr<CDMSession> createSession(const String& keySystem);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> bool paused() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -209,9 +209,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>- virtual PassRefPtr<Uint8Array> generateKeyRequest(const String&, const String&, Uint8Array*, String&, MediaPlayer::MediaKeyException&, unsigned long&) { return nullptr; }
- virtual void releaseKeys(const String&) { }
- virtual bool update(const String&, Uint8Array*, RefPtr<Uint8Array>&, MediaPlayer::MediaKeyException&, unsigned long&) { return false; }
</del><ins>+ virtual std::unique_ptr<CDMSession> createSession(const String&) { return nullptr; }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjChfromrev164513trunkSourceWebCoreModulesencryptedmediaCDMPrivateAVFoundationh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h (from rev 164513, trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateAVFoundation.h) (0 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -0,0 +1,63 @@
</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 CDMSessionAVFoundationObjC_h
+#define CDMSessionAVFoundationObjC_h
+
+#include "CDMSession.h"
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RetainPtr.h>
+
+#if ENABLE(ENCRYPTED_MEDIA_V2) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+
+OBJC_CLASS AVAssetResourceLoadingRequest;
+
+namespace WebCore {
+
+class MediaPlayerPrivateAVFoundationObjC;
+
+class CDMSessionAVFoundationObjC : public CDMSession {
+public:
+ CDMSessionAVFoundationObjC(MediaPlayerPrivateAVFoundationObjC* parent);
+ virtual ~CDMSessionAVFoundationObjC() { }
+
+ virtual void setClient(CDMSessionClient* client) override { m_client = client; }
+ virtual const String& sessionId() const override { return m_sessionId; }
+ virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) override;
+ virtual void releaseKeys() override;
+ virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) override;
+
+protected:
+ MediaPlayerPrivateAVFoundationObjC* m_parent;
+ CDMSessionClient* m_client;
+ String m_sessionId;
+ RetainPtr<AVAssetResourceLoadingRequest> m_request;
+};
+
+}
+
+#endif
+
+#endif // CDMSessionAVFoundationObjC_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm (0 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -0,0 +1,112 @@
</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.
+ */
+
+#import "config.h"
+#import "CDMSessionAVFoundationObjC.h"
+
+#if ENABLE(ENCRYPTED_MEDIA_V2) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+
+#import "CDM.h"
+#import "CDMSession.h"
+#import "ExceptionCode.h"
+#import "MediaPlayer.h"
+#import "MediaPlayerPrivateAVFoundationObjC.h"
+#import "SoftLinking.h"
+#import "UUID.h"
+#import <AVFoundation/AVFoundation.h>
+#import <objc/objc-runtime.h>
+
+namespace WebCore {
+
+SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
+SOFT_LINK_CLASS(AVFoundation, AVURLAsset)
+SOFT_LINK_CLASS(AVFoundation, AVAssetResourceLoadingRequest)
+#define AVURLAsset getAVURLAssetClass()
+#define AVAssetResourceLoadingRequest getAVAssetResourceLoadingRequest()
+
+CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC(MediaPlayerPrivateAVFoundationObjC* parent)
+ : m_parent(parent)
+ , m_client(nullptr)
+ , m_sessionId(createCanonicalUUIDString())
+{
+}
+
+PassRefPtr<Uint8Array> CDMSessionAVFoundationObjC::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode)
+{
+ UNUSED_PARAM(mimeType);
+
+ String keyURI;
+ String keyID;
+ RefPtr<Uint8Array> certificate;
+ if (!MediaPlayerPrivateAVFoundationObjC::extractKeyURIKeyIDAndCertificateFromInitData(initData, keyURI, keyID, certificate)) {
+ errorCode = MediaPlayer::InvalidPlayerState;
+ return nullptr;
+ }
+
+ m_request = m_parent->takeRequestForKeyURI(keyURI);
+ if (!m_request) {
+ errorCode = MediaPlayer::InvalidPlayerState;
+ return nullptr;
+ }
+
+ RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:certificate->baseAddress() length:certificate->byteLength()]);
+ NSString* assetStr = keyID;
+ RetainPtr<NSData> assetID = [NSData dataWithBytes: [assetStr cStringUsingEncoding:NSUTF8StringEncoding] length:[assetStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
+ NSError* nsError = 0;
+ RetainPtr<NSData> keyRequest = [m_request streamingContentKeyRequestDataForApp:certificateData.get() contentIdentifier:assetID.get() options:nil error:&nsError];
+
+ if (!keyRequest) {
+ NSError* underlyingError = [[nsError userInfo] objectForKey:NSUnderlyingErrorKey];
+ systemCode = [underlyingError code];
+ return nullptr;
+ }
+
+ errorCode = MediaPlayer::NoError;
+ systemCode = 0;
+ destinationURL = String();
+
+ RefPtr<ArrayBuffer> keyRequestBuffer = ArrayBuffer::create([keyRequest.get() bytes], [keyRequest.get() length]);
+ return Uint8Array::create(keyRequestBuffer, 0, keyRequestBuffer->byteLength());
+}
+
+void CDMSessionAVFoundationObjC::releaseKeys()
+{
+}
+
+bool CDMSessionAVFoundationObjC::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode)
+{
+ RetainPtr<NSData> keyData = adoptNS([[NSData alloc] initWithBytes:key->baseAddress() length:key->byteLength()]);
+ [[m_request dataRequest] respondWithData:keyData.get()];
+ [m_request finishLoading];
+ errorCode = MediaPlayer::NoError;
+ systemCode = 0;
+ nextMessage = nullptr;
+
+ return true;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>- static RetainPtr<AVAssetResourceLoadingRequest> takeRequestForPlayerAndKeyURI(MediaPlayer*, const String&);
</del><ins>+ RetainPtr<AVAssetResourceLoadingRequest> takeRequestForKeyURI(const String&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void playerItemStatusDidChange(int);
</span><span class="lines">@@ -200,9 +200,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>- PassRefPtr<Uint8Array> generateKeyRequest(const String& sessionId, const String& mimeType, Uint8Array* initData, String& destinationURL, MediaPlayer::MediaKeyException& error, unsigned long& systemCode);
- void releaseKeys(const String& sessionId);
- bool update(const String& sessionId, Uint8Array* key, RefPtr<Uint8Array>& nextMessage, MediaPlayer::MediaKeyException& error, unsigned long& systemCode);
</del><ins>+ std::unique_ptr<CDMSession> createSession(const String& keySystem);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> virtual String languageOfPrimaryAudioTrack() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import "AudioTrackPrivateAVFObjC.h"
</span><span class="cx"> #import "AuthenticationChallenge.h"
</span><span class="cx"> #import "BlockExceptions.h"
</span><ins>+#import "CDMSessionAVFoundationObjC.h"
</ins><span class="cx"> #import "ExceptionCodePlaceholder.h"
</span><span class="cx"> #import "FloatConversion.h"
</span><span class="cx"> #import "FloatConversion.h"
</span><span class="lines">@@ -1621,69 +1622,17 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>-PassRefPtr<Uint8Array> MediaPlayerPrivateAVFoundationObjC::generateKeyRequest(const String& sessionId, const String& mimeType, Uint8Array* initData, String& destinationURL, MediaPlayer::MediaKeyException& error, unsigned long& systemCode)
</del><ins>+RetainPtr<AVAssetResourceLoadingRequest> MediaPlayerPrivateAVFoundationObjC::takeRequestForKeyURI(const String& keyURI)
</ins><span class="cx"> {
</span><del>- UNUSED_PARAM(mimeType);
-
- String keyURI;
- String keyID;
- RefPtr<Uint8Array> certificate;
- if (!MediaPlayerPrivateAVFoundationObjC::extractKeyURIKeyIDAndCertificateFromInitData(initData, keyURI, keyID, certificate)) {
- error = MediaPlayer::InvalidPlayerState;
- return 0;
- }
-
- RetainPtr<AVAssetResourceLoadingRequest> request = m_keyURIToRequestMap.take(keyURI);
- if (!request) {
- error = MediaPlayer::InvalidPlayerState;
- return 0;
- }
-
- m_sessionIDToRequestMap.add(sessionId, request);
-
- RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:certificate->baseAddress() length:certificate->byteLength()]);
- NSString* assetStr = keyID;
- RetainPtr<NSData> assetID = [NSData dataWithBytes: [assetStr cStringUsingEncoding:NSUTF8StringEncoding] length:[assetStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
- NSError* nsError = 0;
- RetainPtr<NSData> keyRequest = [request streamingContentKeyRequestDataForApp:certificateData.get() contentIdentifier:assetID.get() options:nil error:&nsError];
-
- if (!keyRequest) {
- NSError* underlyingError = [[nsError userInfo] objectForKey:NSUnderlyingErrorKey];
- systemCode = [underlyingError code];
- return 0;
- }
-
- error = MediaPlayer::NoError;
- systemCode = 0;
- destinationURL = String();
-
- RefPtr<ArrayBuffer> keyRequestBuffer = ArrayBuffer::create([keyRequest.get() bytes], [keyRequest.get() length]);
- return Uint8Array::create(keyRequestBuffer, 0, keyRequestBuffer->byteLength());
</del><ins>+ return m_keyURIToRequestMap.take(keyURI);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateAVFoundationObjC::releaseKeys(const String& sessionId)
</del><ins>+std::unique_ptr<CDMSession> MediaPlayerPrivateAVFoundationObjC::createSession(const String& keySystem)
</ins><span class="cx"> {
</span><del>- UNUSED_PARAM(sessionId);
-}
</del><ins>+ if (!keySystemIsSupported(keySystem))
+ return nullptr;
</ins><span class="cx">
</span><del>-bool MediaPlayerPrivateAVFoundationObjC::update(const String& sessionId, Uint8Array* key, RefPtr<Uint8Array>& nextMessage, MediaPlayer::MediaKeyException& error, unsigned long& systemCode)
-{
- ASSERT(key);
-
- RetainPtr<AVAssetResourceLoadingRequest> request = m_sessionIDToRequestMap.get(sessionId);
- if (!request) {
- error = MediaPlayer::InvalidPlayerState;
- return false;
- }
-
- RetainPtr<NSData> keyData = adoptNS([[NSData alloc] initWithBytes:key->baseAddress() length:key->byteLength()]);
- [[request dataRequest] respondWithData:keyData.get()];
- [request finishLoading];
- error = MediaPlayer::NoError;
- systemCode = 0;
- nextMessage = nullptr;
-
- return true;
</del><ins>+ return std::make_unique<CDMSessionAVFoundationObjC>(this);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoretestingMockCDMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/MockCDM.cpp (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/MockCDM.cpp        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/testing/MockCDM.cpp        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><span class="cx">
</span><span class="cx"> #include "CDM.h"
</span><ins>+#include "CDMSession.h"
</ins><span class="cx"> #include "MediaKeyError.h"
</span><span class="cx"> #include <runtime/JSCInlines.h>
</span><span class="cx"> #include <runtime/TypedArrayInlines.h>
</span><span class="lines">@@ -38,17 +39,17 @@
</span><span class="cx">
</span><span class="cx"> class MockCDMSession : public CDMSession {
</span><span class="cx"> public:
</span><del>- static PassOwnPtr<MockCDMSession> create() { return adoptPtr(new MockCDMSession()); }
</del><ins>+ MockCDMSession();
</ins><span class="cx"> virtual ~MockCDMSession() { }
</span><span class="cx">
</span><ins>+ virtual void setClient(CDMSessionClient* client) { m_client = client; }
</ins><span class="cx"> virtual const String& sessionId() const override { return m_sessionId; }
</span><span class="cx"> virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) override;
</span><span class="cx"> virtual void releaseKeys() override;
</span><span class="cx"> virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) override;
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- MockCDMSession();
-
</del><ins>+ CDMSessionClient* m_client;
</ins><span class="cx"> String m_sessionId;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -70,9 +71,9 @@
</span><span class="cx"> return equalIgnoringCase(mimeType, "video/mock");
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassOwnPtr<CDMSession> MockCDM::createSession()
</del><ins>+std::unique_ptr<CDMSession> MockCDM::createSession()
</ins><span class="cx"> {
</span><del>- return MockCDMSession::create();
</del><ins>+ return std::make_unique<MockCDMSession>();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Uint8Array* initDataPrefix()
</span></span></pre></div>
<a id="trunkSourceWebCoretestingMockCDMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/MockCDM.h (164513 => 164514)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/MockCDM.h        2014-02-22 00:12:51 UTC (rev 164513)
+++ trunk/Source/WebCore/testing/MockCDM.h        2014-02-22 00:13:01 UTC (rev 164514)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> virtual ~MockCDM() { }
</span><span class="cx">
</span><span class="cx"> virtual bool supportsMIMEType(const String& mimeType) override;
</span><del>- virtual PassOwnPtr<CDMSession> createSession() override;
</del><ins>+ virtual std::unique_ptr<CDMSession> createSession() override;
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> MockCDM(CDM* cdm) : m_cdm(cdm) { }
</span></span></pre>
</div>
</div>
</body>
</html>