<!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>[173197] 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/173197">173197</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2014-09-02 18:28:33 -0700 (Tue, 02 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[EME][Mac] Refactor CDMPrivateMediaSourceAVFObjC to allow sessions to be created without being attached to an AVStreamDataParser.
https://bugs.webkit.org/show_bug.cgi?id=136016

Reviewed by Eric Carlson.

The CDMPrivateMediaPlayer class will delegate creation of CDMSession instances to the current MediaPlayer. This
of course requires the MediaKeys object owning the CDM to be attached to a HTMLMediaElement, and specifically to
one with a valid src attribute or source node which has sucessfully begun loading. For certain CDM operations,
it would be better if a given MediaKeys could create a session without actually being connected to a
HTMLMediaElement (yet).

To facilitate this for CDMSessionPrivateMediaSourceAVFObjC, add a new class, CDMPrivateMediaSourceAVFObjC, which
is the primary factory for CDMSessionPrivateMediaSOurceAVFObjC. Disclaim responsibility for creating these sessions
in MediaPlayerPrivateMediaSourceAVFObjC by not passing the &quot;supportsKeySystem&quot; method when registering itself.

Add methods to CDMSessionPrivateMediaSourceAVFObjC to allow SourceBuffers to be added and removed from the session,
to support adding the session to the HTMLMediaElement after the session has been created.

Since MediaPlayerPrivate instance and  CDMSession instances must be able to communicate with one another, add a type()
enum and virtual method to allow CDMSession instnaces to be distinguisted from (and casted to) one another.

* Modules/encryptedmedia/CDM.cpp:
(WebCore::installedCDMFactories): Register CDMPrivateMediaSourceAVFObjC.
(WebCore::CDM::createSession): Notify the MediaPlayer of the new CDMSession.
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::setMediaElement): Notify the HTMLMediaElement of any existing sessions.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/CDMSession.h:
(WebCore::CDMSession::type): Added.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setCDMSession): Pass through to the MediaPlayerPrivate.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setCDMSession): Added. Default no-op.
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h: Added.
(WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC): Simple constructor.
(WebCore::CDMPrivateMediaSourceAVFObjC::~CDMPrivateMediaSourceAVFObjC): Simple destructor.
(WebCore::CDMPrivateMediaSourceAVFObjC::create): Simple factory.
(WebCore::CDMPrivateMediaSourceAVFObjC::cdm): Simple accessor.
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem): Moved from MediaPlayerPrivateMediaSourceAVFObjC.
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType): Ditto.
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): Ditto.
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Returns new CDMSessionMediaSourceAVFObjC.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
(WebCore::CDMSessionAVFoundationObjC::type): Added.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
(WebCore::CDMSessionMediaSourceAVFObjC::type): Added.
(WebCore::toCDMSessionMediaSourceAVFObjC): Throw assertion if type() is not correct.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC): Removed m_parent ivar.
(WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): Ditto.
(WebCore::CDMSessionMediaSourceAVFObjC::update): Determing which SourceBuffer is protected.
(WebCore::CDMSessionMediaSourceAVFObjC::addSourceBuffer): Added.
(WebCore::CDMSessionMediaSourceAVFObjC::removeSourceBuffer): Added.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): Remove supportsKeyType parameter.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Remove keyType check.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): Tell the CDMSession about outstanding SourceBuffers.
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:</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="#trunkSourceWebCoreModulesencryptedmediaMediaKeySessionh">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaMediaKeyscpp">trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsCDMSessionh">trunk/Source/WebCore/platform/graphics/CDMSession.h</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="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/ChangeLog        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -1,3 +1,70 @@
</span><ins>+2014-09-02  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        [EME][Mac] Refactor CDMPrivateMediaSourceAVFObjC to allow sessions to be created without being attached to an AVStreamDataParser.
+        https://bugs.webkit.org/show_bug.cgi?id=136016
+
+        Reviewed by Eric Carlson.
+
+        The CDMPrivateMediaPlayer class will delegate creation of CDMSession instances to the current MediaPlayer. This
+        of course requires the MediaKeys object owning the CDM to be attached to a HTMLMediaElement, and specifically to
+        one with a valid src attribute or source node which has sucessfully begun loading. For certain CDM operations,
+        it would be better if a given MediaKeys could create a session without actually being connected to a
+        HTMLMediaElement (yet).
+
+        To facilitate this for CDMSessionPrivateMediaSourceAVFObjC, add a new class, CDMPrivateMediaSourceAVFObjC, which
+        is the primary factory for CDMSessionPrivateMediaSOurceAVFObjC. Disclaim responsibility for creating these sessions
+        in MediaPlayerPrivateMediaSourceAVFObjC by not passing the &quot;supportsKeySystem&quot; method when registering itself.
+
+        Add methods to CDMSessionPrivateMediaSourceAVFObjC to allow SourceBuffers to be added and removed from the session,
+        to support adding the session to the HTMLMediaElement after the session has been created.
+
+        Since MediaPlayerPrivate instance and  CDMSession instances must be able to communicate with one another, add a type()
+        enum and virtual method to allow CDMSession instnaces to be distinguisted from (and casted to) one another.
+
+        * Modules/encryptedmedia/CDM.cpp:
+        (WebCore::installedCDMFactories): Register CDMPrivateMediaSourceAVFObjC.
+        (WebCore::CDM::createSession): Notify the MediaPlayer of the new CDMSession.
+        * Modules/encryptedmedia/MediaKeySession.h:
+        * Modules/encryptedmedia/MediaKeys.cpp:
+        (WebCore::MediaKeys::setMediaElement): Notify the HTMLMediaElement of any existing sessions.
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/CDMSession.h:
+        (WebCore::CDMSession::type): Added.
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::setCDMSession): Pass through to the MediaPlayerPrivate.
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::setCDMSession): Added. Default no-op.
+        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h: Added.
+        (WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC): Simple constructor.
+        (WebCore::CDMPrivateMediaSourceAVFObjC::~CDMPrivateMediaSourceAVFObjC): Simple destructor.
+        (WebCore::CDMPrivateMediaSourceAVFObjC::create): Simple factory.
+        (WebCore::CDMPrivateMediaSourceAVFObjC::cdm): Simple accessor.
+        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm: 
+        (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem): Moved from MediaPlayerPrivateMediaSourceAVFObjC.
+        (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType): Ditto.
+        (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): Ditto.
+        (WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Returns new CDMSessionMediaSourceAVFObjC.
+        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
+        (WebCore::CDMSessionAVFoundationObjC::type): Added.
+        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
+        (WebCore::CDMSessionMediaSourceAVFObjC::type): Added.
+        (WebCore::toCDMSessionMediaSourceAVFObjC): Throw assertion if type() is not correct.
+        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
+        (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC): Removed m_parent ivar.
+        (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): Ditto.
+        (WebCore::CDMSessionMediaSourceAVFObjC::update): Determing which SourceBuffer is protected.
+        (WebCore::CDMSessionMediaSourceAVFObjC::addSourceBuffer): Added.
+        (WebCore::CDMSessionMediaSourceAVFObjC::removeSourceBuffer): Added.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): Remove supportsKeyType parameter.
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Remove keyType check.
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): Tell the CDMSession about outstanding SourceBuffers.
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
+
</ins><span class="cx"> 2014-09-02  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Attempt to fix the Windows build after &lt;http://trac.webkit.org/changeset/173192&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -33,9 +33,14 @@
</span><span class="cx"> #include &quot;CDMSession.h&quot;
</span><span class="cx"> #include &quot;MediaKeyError.h&quot;
</span><span class="cx"> #include &quot;MediaKeys.h&quot;
</span><ins>+#include &quot;MediaPlayer.h&quot;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) &amp;&amp; ENABLE(MEDIA_SOURCE)
+#include &quot;CDMPrivateMediaSourceAVFObjC.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> struct CDMFactory {
</span><span class="lines">@@ -62,6 +67,10 @@
</span><span class="cx"> 
</span><span class="cx">         // FIXME: initialize specific UA CDMs. http://webkit.org/b/109318, http://webkit.org/b/109320
</span><span class="cx">         cdms.get().append(new CDMFactory(CDMPrivateMediaPlayer::create, CDMPrivateMediaPlayer::supportsKeySystem, CDMPrivateMediaPlayer::supportsKeySystemAndMimeType));
</span><ins>+
+#if PLATFORM(MAC) &amp;&amp; ENABLE(MEDIA_SOURCE)
+        cdms.get().append(new CDMFactory(CDMPrivateMediaSourceAVFObjC::create, CDMPrivateMediaSourceAVFObjC::supportsKeySystem, CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType));
+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return cdms;
</span><span class="lines">@@ -120,7 +129,10 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;CDMSession&gt; CDM::createSession()
</span><span class="cx"> {
</span><del>-    return m_private-&gt;createSession();
</del><ins>+    std::unique_ptr&lt;CDMSession&gt; session = m_private-&gt;createSession();
+    if (mediaPlayer())
+        mediaPlayer()-&gt;setCDMSession(session.get());
+    return session;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaPlayer* CDM::mediaPlayer() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeySessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx">     ~MediaKeySession();
</span><span class="cx"> 
</span><span class="cx">     const String&amp; keySystem() const { return m_keySystem; }
</span><ins>+    CDMSession* session() { return m_session.get(); }
</ins><span class="cx">     const String&amp; sessionId() const;
</span><span class="cx"> 
</span><span class="cx">     void setError(MediaKeyError*);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaMediaKeyscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -144,7 +144,13 @@
</span><span class="cx"> 
</span><span class="cx"> void MediaKeys::setMediaElement(HTMLMediaElement* element)
</span><span class="cx"> {
</span><ins>+    if (m_mediaElement)
+        m_mediaElement-&gt;player()-&gt;setCDMSession(nullptr);
+
</ins><span class="cx">     m_mediaElement = element;
</span><ins>+
+    if (m_mediaElement &amp;&amp; !m_sessions.isEmpty())
+        m_mediaElement-&gt;player()-&gt;setCDMSession(m_sessions.last()-&gt;session());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaPlayer* MediaKeys::cdmMediaPlayer(const CDM*) const
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -5591,6 +5591,8 @@
</span><span class="cx">                 CD2F4A2418D89F700063746D /* AudioHardwareListener.h in Headers */ = {isa = PBXBuildFile; fileRef = CD2F4A2218D89F700063746D /* AudioHardwareListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CD2F4A2718D8A3490063746D /* AudioHardwareListenerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD2F4A2518D8A3490063746D /* AudioHardwareListenerMac.cpp */; };
</span><span class="cx">                 CD2F4A2818D8A3490063746D /* AudioHardwareListenerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = CD2F4A2618D8A3490063746D /* AudioHardwareListenerMac.h */; };
</span><ins>+                CD318622199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD318620199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm */; };
+                CD318623199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD318621199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h */; };
</ins><span class="cx">                 CD336F6117F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD336F5F17F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.mm */; };
</span><span class="cx">                 CD336F6217F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = CD336F6017F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h */; };
</span><span class="cx">                 CD336F6417FA0A4D00DDDCD0 /* VideoTrackPrivateAVF.h in Headers */ = {isa = PBXBuildFile; fileRef = CD336F6317FA0A4D00DDDCD0 /* VideoTrackPrivateAVF.h */; };
</span><span class="lines">@@ -13003,6 +13005,8 @@
</span><span class="cx">                 CD2F4A2218D89F700063746D /* AudioHardwareListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioHardwareListener.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD2F4A2518D8A3490063746D /* AudioHardwareListenerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioHardwareListenerMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD2F4A2618D8A3490063746D /* AudioHardwareListenerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioHardwareListenerMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CD318620199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDMPrivateMediaSourceAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD318621199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivateMediaSourceAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CD32A189184EB46A0029B1BB /* mediaControlsiOS.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = mediaControlsiOS.js; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD336F5F17F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVTrackPrivateAVFObjCImpl.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD336F6017F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVTrackPrivateAVFObjCImpl.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -21578,6 +21582,8 @@
</span><span class="cx">                                 CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */,
</span><span class="cx">                                 CD336F6017F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h */,
</span><span class="cx">                                 CD336F5F17F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.mm */,
</span><ins>+                                CD318621199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h */,
+                                CD318620199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm */,
</ins><span class="cx">                                 CDDE02EA18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.h */,
</span><span class="cx">                                 CDDE02EB18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm */,
</span><span class="cx">                                 CDDE02EE18B564FA00CF7FF1 /* CDMSessionMediaSourceAVFObjC.h */,
</span><span class="lines">@@ -24516,6 +24522,7 @@
</span><span class="cx">                                 B27535710B053814002CE64F /* ImageSource.h in Headers */,
</span><span class="cx">                                 4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */,
</span><span class="cx">                                 316FE1180E6E1DA700BF6088 /* ImplicitAnimation.h in Headers */,
</span><ins>+                                CD318623199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h in Headers */,
</ins><span class="cx">                                 BE16C59317CFE17200852C04 /* InbandGenericTextTrack.h in Headers */,
</span><span class="cx">                                 07941792166E855F009416C2 /* InbandTextTrack.h in Headers */,
</span><span class="cx">                                 07941794166EA04E009416C2 /* InbandTextTrackPrivate.h in Headers */,
</span><span class="lines">@@ -27445,6 +27452,7 @@
</span><span class="cx">                                 85BA4CDE0AA6861B0088052D /* DOMHTMLButtonElement.mm in Sources */,
</span><span class="cx">                                 93F9B6570BA0F35E00854064 /* DOMHTMLCanvasElement.mm in Sources */,
</span><span class="cx">                                 85DF2F8F0AA3C88100AD64C5 /* DOMHTMLCollection.mm in Sources */,
</span><ins>+                                CD318622199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm in Sources */,
</ins><span class="cx">                                 F5C041E40FFCA96D00839D4A /* DOMHTMLDataListElement.mm in Sources */,
</span><span class="cx">                                 D359D792129CA3C00006E5D2 /* DOMHTMLDetailsElement.mm in Sources */,
</span><span class="cx">                                 85BA4D0C0AA688680088052D /* DOMHTMLDirectoryElement.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsCDMSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/CDMSession.h (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/CDMSession.h        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/CDMSession.h        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -52,11 +52,18 @@
</span><span class="cx">     virtual void sendError(MediaKeyErrorCode, unsigned long systemCode) = 0;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum CDMSessionType {
+    CDMSessionTypeUnknown,
+    CDMSessionTypeAVFoundationObjC,
+    CDMSessionTypeMediaSourceAVFObjC,
+};
+
</ins><span class="cx"> class CDMSession {
</span><span class="cx"> public:
</span><span class="cx">     CDMSession() { }
</span><span class="cx">     virtual ~CDMSession() { }
</span><span class="cx"> 
</span><ins>+    virtual CDMSessionType type() { return CDMSessionTypeUnknown; }
</ins><span class="cx">     virtual void setClient(CDMSessionClient*) = 0;
</span><span class="cx">     virtual const String&amp; sessionId() const = 0;
</span><span class="cx">     virtual PassRefPtr&lt;Uint8Array&gt; generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, unsigned long&amp; systemCode) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -510,6 +510,11 @@
</span><span class="cx"> {
</span><span class="cx">     return m_private-&gt;createSession(keySystem);
</span><span class="cx"> }
</span><ins>+
+void MediaPlayer::setCDMSession(CDMSession* session)
+{
+    m_private-&gt;setCDMSession(session);
+}
</ins><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 (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -359,6 +359,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><span class="cx">     std::unique_ptr&lt;CDMSession&gt; createSession(const String&amp; keySystem);
</span><ins>+    void setCDMSession(CDMSession*);
</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 (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -221,6 +221,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><span class="cx">     virtual std::unique_ptr&lt;CDMSession&gt; createSession(const String&amp;) { return nullptr; }
</span><ins>+    virtual void setCDMSession(CDMSession*) { }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationCDMPrivateMediaSourceAVFObjChfromrev173196trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h (from rev 173196, trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h) (0 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h        2014-09-03 01:28:33 UTC (rev 173197)
</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 CDMPrivateMediaSourceAVFObjC_h
+#define CDMPrivateMediaSourceAVFObjC_h
+
+#if ENABLE(ENCRYPTED_MEDIA_V2) &amp;&amp; ENABLE(MEDIA_SOURCE)
+
+#include &quot;CDMPrivate.h&quot;
+
+namespace WebCore {
+
+class CDM;
+
+class CDMPrivateMediaSourceAVFObjC : public CDMPrivateInterface {
+public:
+    explicit CDMPrivateMediaSourceAVFObjC(CDM* cdm)
+        : m_cdm(cdm)
+    { }
+    virtual ~CDMPrivateMediaSourceAVFObjC() { }
+
+    static std::unique_ptr&lt;CDMPrivateInterface&gt; create(CDM* cdm) { return std::make_unique&lt;CDMPrivateMediaSourceAVFObjC&gt;(cdm); }
+    static bool supportsKeySystem(const String&amp;);
+    static bool supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType);
+
+    virtual bool supportsMIMEType(const String&amp; mimeType) override;
+    virtual std::unique_ptr&lt;CDMSession&gt; createSession() override;
+
+    CDM* cdm() const { return m_cdm; }
+
+protected:
+    CDM* m_cdm;
+};
+
+}
+
+#endif // ENABLE(ENCRYPTED_MEDIA_V2) &amp;&amp; ENABLE(MEDIA_SOURCE)
+
+#endif // CDMPrivateMediaSourceAVFObjC_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationCDMPrivateMediaSourceAVFObjCmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm (0 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm        2014-09-03 01:28:33 UTC (rev 173197)
</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.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;CDMPrivateMediaSourceAVFObjC.h&quot;
+
+#if ENABLE(ENCRYPTED_MEDIA_V2) &amp;&amp; ENABLE(MEDIA_SOURCE)
+
+#import &quot;CDM.h&quot;
+#import &quot;CDMSessionMediaSourceAVFObjC.h&quot;
+#import &quot;ContentType.h&quot;
+#import &quot;ExceptionCode.h&quot;
+#import &quot;MediaPlayerPrivateMediaSourceAVFObjC.h&quot;
+#import &quot;WebCoreSystemInterface.h&quot;
+
+namespace WebCore {
+
+bool CDMPrivateMediaSourceAVFObjC::supportsKeySystem(const String&amp; keySystem)
+{
+    if (!wkQueryDecoderAvailability())
+        return false;
+
+    if (!keySystem.isEmpty() &amp;&amp; !equalIgnoringCase(keySystem, &quot;com.apple.fps.2_0&quot;))
+        return false;
+
+    return true;
+}
+
+bool CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType(const String&amp; keySystem, const String&amp; mimeType)
+{
+    if (!supportsKeySystem(keySystem))
+        return false;
+
+    if (!mimeType.isEmpty()) {
+        MediaEngineSupportParameters parameters;
+        parameters.isMediaSource = true;
+        parameters.type = mimeType;
+
+        return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::IsNotSupported;
+    }
+
+    return true;
+}
+
+bool CDMPrivateMediaSourceAVFObjC::supportsMIMEType(const String&amp; mimeType)
+{
+    MediaEngineSupportParameters parameters;
+    parameters.isMediaSource = true;
+    parameters.type = mimeType;
+
+    return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::IsNotSupported;
+}
+
+std::unique_ptr&lt;CDMSession&gt; CDMPrivateMediaSourceAVFObjC::createSession()
+{
+    return std::make_unique&lt;CDMSessionMediaSourceAVFObjC&gt;();
+}
+
+}
+
+#endif // ENABLE(ENCRYPTED_MEDIA_V2) &amp;&amp; ENABLE(MEDIA_SOURCE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">     CDMSessionAVFoundationObjC(MediaPlayerPrivateAVFoundationObjC* parent);
</span><span class="cx">     virtual ~CDMSessionAVFoundationObjC() { }
</span><span class="cx"> 
</span><ins>+    virtual CDMSessionType type() { return CDMSessionTypeAVFoundationObjC; }
</ins><span class="cx">     virtual void setClient(CDMSessionClient* client) override { m_client = client; }
</span><span class="cx">     virtual const String&amp; sessionId() const override { return m_sessionId; }
</span><span class="cx">     virtual PassRefPtr&lt;Uint8Array&gt; generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, unsigned long&amp; systemCode) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -39,9 +39,10 @@
</span><span class="cx"> 
</span><span class="cx"> class CDMSessionMediaSourceAVFObjC : public CDMSession, public SourceBufferPrivateAVFObjCErrorClient {
</span><span class="cx"> public:
</span><del>-    CDMSessionMediaSourceAVFObjC(SourceBufferPrivateAVFObjC* parent);
</del><ins>+    CDMSessionMediaSourceAVFObjC();
</ins><span class="cx">     virtual ~CDMSessionMediaSourceAVFObjC();
</span><span class="cx"> 
</span><ins>+    virtual CDMSessionType type() { return CDMSessionTypeMediaSourceAVFObjC; }
</ins><span class="cx">     virtual void setClient(CDMSessionClient* client) override { m_client = client; }
</span><span class="cx">     virtual const String&amp; sessionId() const override { return m_sessionId; }
</span><span class="cx">     virtual PassRefPtr&lt;Uint8Array&gt; generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, unsigned long&amp; systemCode) override;
</span><span class="lines">@@ -51,8 +52,11 @@
</span><span class="cx">     virtual void layerDidReceiveError(AVSampleBufferDisplayLayer *, NSError *);
</span><span class="cx">     virtual void rendererDidReceiveError(AVSampleBufferAudioRenderer *, NSError *);
</span><span class="cx"> 
</span><ins>+    void addSourceBuffer(SourceBufferPrivateAVFObjC*);
+    void removeSourceBuffer(SourceBufferPrivateAVFObjC*);
+
</ins><span class="cx"> protected:
</span><del>-    RefPtr&lt;SourceBufferPrivateAVFObjC&gt; m_parent;
</del><ins>+    Vector&lt;RefPtr&lt;SourceBufferPrivateAVFObjC&gt;&gt; m_sourceBuffers;
</ins><span class="cx">     CDMSessionClient* m_client;
</span><span class="cx">     RetainPtr&lt;AVStreamSession&gt; m_streamSession;
</span><span class="cx">     RefPtr&lt;Uint8Array&gt; m_initData;
</span><span class="lines">@@ -60,8 +64,15 @@
</span><span class="cx">     String m_sessionId;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline CDMSessionMediaSourceAVFObjC* toCDMSessionMediaSourceAVFObjC(CDMSession* session)
+{
+    if (!session || session-&gt;type() != CDMSessionTypeMediaSourceAVFObjC)
+        return nullptr;
+    return static_cast&lt;CDMSessionMediaSourceAVFObjC*&gt;(session);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #endif // CDMSessionMediaSourceAVFObjC_h
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionMediaSourceAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -62,23 +62,19 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC(SourceBufferPrivateAVFObjC* parent)
-    : m_parent(parent)
-    , m_client(nullptr)
</del><ins>+CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC()
+    : m_client(nullptr)
</ins><span class="cx">     , m_sessionId(createCanonicalUUIDString())
</span><span class="cx"> {
</span><del>-    ASSERT(parent);
-    parent-&gt;registerForErrorNotifications(this);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC()
</span><span class="cx"> {
</span><span class="cx">     if (m_streamSession) {
</span><del>-        [m_streamSession removeStreamDataParser:m_parent-&gt;parser()];
</del><ins>+        for (auto&amp; sourceBuffer : m_sourceBuffers)
+            [m_streamSession removeStreamDataParser:sourceBuffer-&gt;parser()];
</ins><span class="cx">         m_streamSession = nil;
</span><span class="cx">     }
</span><del>-    m_parent-&gt;unregisterForErrorNotifications(this);
-    m_client = nullptr;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Uint8Array&gt; CDMSessionMediaSourceAVFObjC::generateKeyRequest(const String&amp; mimeType, Uint8Array* initData, String&amp; destinationURL, unsigned short&amp; errorCode, unsigned long&amp; systemCode)
</span><span class="lines">@@ -134,18 +130,33 @@
</span><span class="cx">         m_certificate = key;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    RefPtr&lt;SourceBufferPrivateAVFObjC&gt; protectedSourceBuffer;
+    for (auto&amp; sourceBuffer : m_sourceBuffers) {
+        if (sourceBuffer-&gt;protectedTrackID() != -1) {
+            protectedSourceBuffer = sourceBuffer;
+            break;
+        }
+    }
+
</ins><span class="cx">     if (shouldGenerateKeyRequest) {
</span><span class="cx">         RetainPtr&lt;NSData&gt; certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate-&gt;data() length:m_certificate-&gt;length()]);
</span><span class="cx">         if (getAVStreamSessionClass()) {
</span><span class="cx">             m_streamSession = adoptNS([[getAVStreamSessionClass() alloc] initWithAppIdentifier:certificateData.get()]);
</span><del>-            [m_streamSession addStreamDataParser:m_parent-&gt;parser()];
</del><ins>+            for (auto&amp; sourceBuffer : m_sourceBuffers)
+                [m_streamSession addStreamDataParser:sourceBuffer-&gt;parser()];
</ins><span class="cx">             LOG(Media, &quot;CDMSessionMediaSourceAVFObjC::update(%p) - created stream session %p&quot;, this, m_streamSession.get());
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (m_sourceBuffers.isEmpty())
+            return true;
+
+        if (!protectedSourceBuffer)
+            return true;
+
</ins><span class="cx">         RetainPtr&lt;NSData&gt; initData = adoptNS([[NSData alloc] initWithBytes:m_initData-&gt;data() length:m_initData-&gt;length()]);
</span><span class="cx"> 
</span><span class="cx">         NSError* error = nil;
</span><del>-        RetainPtr&lt;NSData&gt; request = [m_parent-&gt;parser() streamingContentKeyRequestDataForApp:certificateData.get() contentIdentifier:initData.get() trackID:m_parent-&gt;protectedTrackID() options:nil error:&amp;error];
</del><ins>+        RetainPtr&lt;NSData&gt; request = [protectedSourceBuffer-&gt;parser() streamingContentKeyRequestDataForApp:certificateData.get() contentIdentifier:initData.get() trackID:protectedSourceBuffer-&gt;protectedTrackID() options:nil error:&amp;error];
</ins><span class="cx"> 
</span><span class="cx">         if (error) {
</span><span class="cx">             LOG(Media, &quot;CDMSessionMediaSourceAVFObjC::update(%p) - error:%@&quot;, this, [error description]);
</span><span class="lines">@@ -159,11 +170,12 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    ASSERT(!m_sourceBuffers.isEmpty());
</ins><span class="cx">     LOG(Media, &quot;CDMSessionMediaSourceAVFObjC::update(%p) - key data&quot;, this);
</span><span class="cx">     errorCode = MediaPlayer::NoError;
</span><span class="cx">     systemCode = 0;
</span><span class="cx">     RetainPtr&lt;NSData&gt; keyData = adoptNS([[NSData alloc] initWithBytes:key-&gt;data() length:key-&gt;length()]);
</span><del>-    [m_parent-&gt;parser() processContentKeyResponseData:keyData.get() forTrackID:m_parent-&gt;protectedTrackID()];
</del><ins>+    [protectedSourceBuffer-&gt;parser() processContentKeyResponseData:keyData.get() forTrackID:protectedSourceBuffer-&gt;protectedTrackID()];
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -183,6 +195,30 @@
</span><span class="cx">     m_client-&gt;sendError(CDMSessionClient::MediaKeyErrorDomain, abs([error code]));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CDMSessionMediaSourceAVFObjC::addSourceBuffer(SourceBufferPrivateAVFObjC* sourceBuffer)
+{
+    ASSERT(!m_sourceBuffers.contains(sourceBuffer));
+    ASSERT(sourceBuffer);
+
+    m_sourceBuffers.append(sourceBuffer);
+    sourceBuffer-&gt;registerForErrorNotifications(this);
+
+    if (m_streamSession)
+        [m_streamSession addStreamDataParser:sourceBuffer-&gt;parser()];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CDMSessionMediaSourceAVFObjC::removeSourceBuffer(SourceBufferPrivateAVFObjC* sourceBuffer)
+{
+    ASSERT(m_sourceBuffers.contains(sourceBuffer));
+    ASSERT(sourceBuffer);
+
+    if (m_streamSession)
+        [m_streamSession removeStreamDataParser:sourceBuffer-&gt;parser()];
+
+    sourceBuffer-&gt;unregisterForErrorNotifications(this);
+    m_sourceBuffers.remove(m_sourceBuffers.find(sourceBuffer));
+}
+
+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class CDMSessionMediaSourceAVFObjC;
</ins><span class="cx"> class PlatformClockCM;
</span><span class="cx"> class MediaSourcePrivateAVFObjC;
</span><span class="cx"> 
</span><span class="lines">@@ -53,6 +54,12 @@
</span><span class="cx"> 
</span><span class="cx">     static void registerMediaEngine(MediaEngineRegistrar);
</span><span class="cx"> 
</span><ins>+    // MediaPlayer Factory Methods
+    static PassOwnPtr&lt;MediaPlayerPrivateInterface&gt; create(MediaPlayer*);
+    static bool isAvailable();
+    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
+    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
+
</ins><span class="cx">     void addDisplayLayer(AVSampleBufferDisplayLayer*);
</span><span class="cx">     void removeDisplayLayer(AVSampleBufferDisplayLayer*);
</span><span class="cx"> 
</span><span class="lines">@@ -75,7 +82,7 @@
</span><span class="cx">     void sizeChanged();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>-    virtual std::unique_ptr&lt;CDMSession&gt; createSession(const String&amp;);
</del><ins>+    virtual void setCDMSession(CDMSession*) override;
</ins><span class="cx">     void keyNeeded(Uint8Array*);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -161,13 +168,6 @@
</span><span class="cx">     bool shouldBePlaying() const;
</span><span class="cx">     void seekTimerFired(Timer&lt;MediaPlayerPrivateMediaSourceAVFObjC&gt;&amp;);
</span><span class="cx"> 
</span><del>-    // MediaPlayer Factory Methods
-    static PassOwnPtr&lt;MediaPlayerPrivateInterface&gt; create(MediaPlayer*);
-    static bool isAvailable();
-    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
-    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
-    static bool supportsKeySystem(const String&amp; keySystem, const String&amp; mimeType);
-
</del><span class="cx">     friend class MediaSourcePrivateAVFObjC;
</span><span class="cx"> 
</span><span class="cx">     struct PendingSeek {
</span><span class="lines">@@ -193,6 +193,7 @@
</span><span class="cx">     RetainPtr&lt;id&gt; m_timeJumpedObserver;
</span><span class="cx">     RetainPtr&lt;id&gt; m_durationObserver;
</span><span class="cx">     Timer&lt;MediaPlayerPrivateMediaSourceAVFObjC&gt; m_seekTimer;
</span><ins>+    CDMSessionMediaSourceAVFObjC* m_session;
</ins><span class="cx">     MediaPlayer::NetworkState m_networkState;
</span><span class="cx">     MediaPlayer::ReadyState m_readyState;
</span><span class="cx">     MediaTime m_lastSeekTime;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
</span><span class="cx"> 
</span><del>-#import &quot;CDMSession.h&quot;
</del><ins>+#import &quot;CDMSessionMediaSourceAVFObjC.h&quot;
</ins><span class="cx"> #import &quot;Logging.h&quot;
</span><span class="cx"> #import &quot;MediaSourcePrivateAVFObjC.h&quot;
</span><span class="cx"> #import &quot;MediaSourcePrivateClient.h&quot;
</span><span class="lines">@@ -136,6 +136,7 @@
</span><span class="cx">     , m_weakPtrFactory(this)
</span><span class="cx">     , m_synchronizer(adoptNS([[getAVSampleBufferRenderSynchronizerClass() alloc] init]))
</span><span class="cx">     , m_seekTimer(this, &amp;MediaPlayerPrivateMediaSourceAVFObjC::seekTimerFired)
</span><ins>+    , m_session(nullptr)
</ins><span class="cx">     , m_networkState(MediaPlayer::Empty)
</span><span class="cx">     , m_readyState(MediaPlayer::HaveNothing)
</span><span class="cx">     , m_rate(1)
</span><span class="lines">@@ -194,7 +195,7 @@
</span><span class="cx"> void MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(MediaEngineRegistrar registrar)
</span><span class="cx"> {
</span><span class="cx">     if (isAvailable())
</span><del>-        registrar(create, getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem);
</del><ins>+        registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassOwnPtr&lt;MediaPlayerPrivateInterface&gt; MediaPlayerPrivateMediaSourceAVFObjC::create(MediaPlayer* player)
</span><span class="lines">@@ -233,20 +234,8 @@
</span><span class="cx">     types = mimeTypeCache();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(ENCRYPTED_MEDIA_V2)
-static bool keySystemIsSupported(const String&amp; keySystem)
-{
-    return equalIgnoringCase(keySystem, &quot;com.apple.fps.2_0&quot;);
-}
-#endif
-
</del><span class="cx"> MediaPlayer::SupportsType MediaPlayerPrivateMediaSourceAVFObjC::supportsType(const MediaEngineSupportParameters&amp; parameters)
</span><span class="cx"> {
</span><del>-#if ENABLE(ENCRYPTED_MEDIA_V2)
-    if (!parameters.keySystem.isEmpty() &amp;&amp; !keySystemIsSupported(parameters.keySystem))
-            return MediaPlayer::IsNotSupported;
-#endif
-
</del><span class="cx">     // This engine does not support non-media-source sources.
</span><span class="cx">     if (!parameters.isMediaSource)
</span><span class="cx">         return MediaPlayer::IsNotSupported;
</span><span class="lines">@@ -263,28 +252,6 @@
</span><span class="cx">     return [getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool MediaPlayerPrivateMediaSourceAVFObjC::supportsKeySystem(const String&amp; keySystem, const String&amp; mimeType)
-{
-#if ENABLE(ENCRYPTED_MEDIA_V2)
-    if (!wkQueryDecoderAvailability())
-        return false;
-
-    if (!keySystem.isEmpty()) {
-        if (!keySystemIsSupported(keySystem))
-            return false;
-
-        if (!mimeType.isEmpty() &amp;&amp; !mimeTypeCache().contains(mimeType))
-            return false;
-
-        return true;
-    }
-#else
-    UNUSED_PARAM(keySystem);
-    UNUSED_PARAM(mimeType);
-#endif
-    return false;
-}
-
</del><span class="cx"> #pragma mark -
</span><span class="cx"> #pragma mark MediaPlayerPrivateInterface Overrides
</span><span class="cx"> 
</span><span class="lines">@@ -692,12 +659,20 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>-std::unique_ptr&lt;CDMSession&gt; MediaPlayerPrivateMediaSourceAVFObjC::createSession(const String&amp; keySystem)
</del><ins>+void MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession(CDMSession* session)
</ins><span class="cx"> {
</span><del>-    if (!m_mediaSourcePrivate)
-        return nullptr;
</del><ins>+    if (m_session) {
+        for (auto&amp; sourceBuffer : m_mediaSourcePrivate-&gt;sourceBuffers())
+            m_session-&gt;removeSourceBuffer(sourceBuffer.get());
+        m_session = nullptr;
+    }
</ins><span class="cx"> 
</span><del>-    return m_mediaSourcePrivate-&gt;createSession(keySystem);
</del><ins>+    m_session = toCDMSessionMediaSourceAVFObjC(session);
+
+    if (m_session) {
+        for (auto&amp; sourceBuffer : m_mediaSourcePrivate-&gt;sourceBuffers())
+            m_session-&gt;addSourceBuffer(sourceBuffer.get());
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayerPrivateMediaSourceAVFObjC::keyNeeded(Uint8Array* initData)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx">     virtual ~MediaSourcePrivateAVFObjC();
</span><span class="cx"> 
</span><span class="cx">     MediaPlayerPrivateMediaSourceAVFObjC* player() const { return m_player; }
</span><ins>+    const Vector&lt;RefPtr&lt;SourceBufferPrivateAVFObjC&gt;&gt;&amp; sourceBuffers() const { return m_sourceBuffers; }
</ins><span class="cx">     const Vector&lt;SourceBufferPrivateAVFObjC*&gt;&amp; activeSourceBuffers() const { return m_activeSourceBuffers; }
</span><span class="cx"> 
</span><span class="cx">     virtual AddStatus addSourceBuffer(const ContentType&amp;, RefPtr&lt;SourceBufferPrivate&gt;&amp;) override;
</span><span class="lines">@@ -76,10 +77,6 @@
</span><span class="cx">     MediaTime fastSeekTimeForMediaTime(const MediaTime&amp;, const MediaTime&amp; negativeThreshold, const MediaTime&amp; positiveThreshold);
</span><span class="cx">     IntSize naturalSize() const;
</span><span class="cx"> 
</span><del>-#if ENABLE(ENCRYPTED_MEDIA_V2)
-    std::unique_ptr&lt;CDMSession&gt; createSession(const String&amp;);
-#endif
-
</del><span class="cx"> private:
</span><span class="cx">     MediaSourcePrivateAVFObjC(MediaPlayerPrivateMediaSourceAVFObjC*, MediaSourcePrivateClient*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm (173196 => 173197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm        2014-09-03 00:51:44 UTC (rev 173196)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm        2014-09-03 01:28:33 UTC (rev 173197)
</span><span class="lines">@@ -153,18 +153,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>-std::unique_ptr&lt;CDMSession&gt; MediaSourcePrivateAVFObjC::createSession(const String&amp;)
-{
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
-    if (m_sourceBuffersNeedingSessions.isEmpty())
-        return nullptr;
-    return std::make_unique&lt;CDMSessionMediaSourceAVFObjC&gt;(m_sourceBuffersNeedingSessions.takeFirst());
-#endif
-    return nullptr;
-}
-#endif
-
-#if ENABLE(ENCRYPTED_MEDIA_V2)
</del><span class="cx"> void MediaSourcePrivateAVFObjC::sourceBufferKeyNeeded(SourceBufferPrivateAVFObjC* buffer, Uint8Array* initData)
</span><span class="cx"> {
</span><span class="cx">     m_sourceBuffersNeedingSessions.append(buffer);
</span></span></pre>
</div>
</div>

</body>
</html>