<!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>[159797] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/159797">159797</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-11-26 18:13:04 -0800 (Tue, 26 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[MediaStream API] HTMLMediaElement should be able to use MediaStream as source
https://bugs.webkit.org/show_bug.cgi?id=121943

Patch by Nick Diego Yamane &lt;nick.yamane@openbossa.org&gt; on 2013-11-26
Reviewed by Eric Carlson.

Source/WebCore:

Implement MediaStream direct assignment to Media Elements using the new 'srcObject'
attribute: http://www.w3.org/TR/mediacapture-streams/#direct-assignment-to-media-elements

Test: fast/mediastream/MediaStream-MediaElement-srcObject.html

* CMakeLists.txt: Added new HTMLMediaElementMediaStream.h and .cpp to cmake build.
* DerivedSources.make: Added HTMLMediaElementMediaStream.idl.
* GNUmakefile.list.am: Added new HTMLMediaElementMediaStream* to autotools build.
* WebCore.xcodeproj/project.pbxproj: Added new files.
* Modules/mediastream/HTMLMediaElementMediaStream.cpp: Added.
(WebCore::HTMLMediaElementMediaStream::srcObject): implements srcObject getter.
(WebCore::HTMLMediaElementMediaStream::setSrcObject): implements srcObject setter.
* Modules/mediastream/HTMLMediaElementMediaStream.h: Added.
* Modules/mediastream/HTMLMediaElementMediaStream.idl: Added.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSrcObject): This is an initial implementation, and
is still incomplete, that will be addressed in a separate bug: https://webkit.org/b/124896
* html/HTMLMediaElement.h: Added m_mediaStreamSrcObject class variable
and its corresponding getter.

Source/WebKit2:

Add mediastream module and platform to cmake include directories.

* CMakeLists.txt:

LayoutTests:

Add layout tests to MediaStream direct assignment to HTMLMediaElement
using brand new srcObject attribute.

* fast/mediastream/MediaStream-MediaElement-srcObject-expected.txt: Added.
* fast/mediastream/MediaStream-MediaElement-srcObject.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastmediastreamMediaStreamMediaElementsrcObjectexpectedtxt">trunk/LayoutTests/fast/mediastream/MediaStream-MediaElement-srcObject-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamMediaStreamMediaElementsrcObjecthtml">trunk/LayoutTests/fast/mediastream/MediaStream-MediaElement-srcObject.html</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamHTMLMediaElementMediaStreamcpp">trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamHTMLMediaElementMediaStreamh">trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamHTMLMediaElementMediaStreamidl">trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/LayoutTests/ChangeLog        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2013-11-26  Nick Diego Yamane  &lt;nick.yamane@openbossa.org&gt;
+
+        [MediaStream API] HTMLMediaElement should be able to use MediaStream as source
+        https://bugs.webkit.org/show_bug.cgi?id=121943
+
+        Reviewed by Eric Carlson.
+
+        Add layout tests to MediaStream direct assignment to HTMLMediaElement
+        using brand new srcObject attribute.
+
+        * fast/mediastream/MediaStream-MediaElement-srcObject-expected.txt: Added.
+        * fast/mediastream/MediaStream-MediaElement-srcObject.html: Added.
+
</ins><span class="cx"> 2013-11-26  Bear Travis  &lt;betravis@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Shapes] Layout using [&lt;box&gt; || &lt;shape&gt;] value
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamMediaStreamMediaElementsrcObjectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/MediaStream-MediaElement-srcObject-expected.txt (0 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/MediaStream-MediaElement-srcObject-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-MediaElement-srcObject-expected.txt        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+Tests MediaStream assignment to MediaElement using 'srcObject' MediaElement attribute.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS navigator.webkitGetUserMedia({audio:true, video:false}, gotStream1, error); did not throw exception.
+PASS stream.getAudioTracks().length is 1
+PASS stream.getVideoTracks().length is 0
+PASS audio.srcObject = stream; did not throw exception.
+PASS streamObj = audio.srcObject; did not throw exception.
+PASS streamObj is stream
+PASS streamObj.getAudioTracks().length is 1
+PASS streamObj.getVideoTracks().length is 0
+PASS streamObj.id is stream.id
+PASS stream assigned to media element.
+PASS audio.srcObject = null; did not throw exception.
+PASS streamObj = audio.srcObject; did not throw exception.
+PASS streamObj is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamMediaStreamMediaElementsrcObjecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/MediaStream-MediaElement-srcObject.html (0 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/MediaStream-MediaElement-srcObject.html                                (rev 0)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-MediaElement-srcObject.html        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+        &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+        &lt;script&gt;
+            description(&quot;Tests MediaStream assignment to MediaElement using 'srcObject' MediaElement attribute.&quot;);
+
+            var stream;
+            var errorArg;
+
+            function error()
+            {
+                testFailed('Error callback called.');
+                finishJSTest();
+            }
+
+            function testNullStreamObject(stream, audio)
+            {
+                shouldNotThrow(&quot;audio.srcObject = null;&quot;);
+                shouldNotThrow(&quot;streamObj = audio.srcObject;&quot;);
+                shouldBe('streamObj', 'null');
+                finishJSTest();
+            }
+
+            function gotStream(s)
+            {
+                stream = s;
+                shouldBe('stream.getAudioTracks().length', '1');
+                shouldBe('stream.getVideoTracks().length', '0');
+
+                audio = new Audio();
+                shouldNotThrow(&quot;audio.srcObject = stream;&quot;);
+                shouldNotThrow(&quot;streamObj = audio.srcObject;&quot;);
+                shouldBe('streamObj', 'stream');
+                shouldBe('streamObj.getAudioTracks().length', '1');
+                shouldBe('streamObj.getVideoTracks().length', '0');
+                shouldBe('streamObj.id', 'stream.id');
+                testPassed('stream assigned to media element.');
+
+                testNullStreamObject(stream, audio);
+            }
+
+            shouldNotThrow(&quot;navigator.webkitGetUserMedia({audio:true, video:false}, gotStream, error);&quot;);
+
+            window.jsTestIsAsync = true;
+            window.successfullyParsed = true;
+        &lt;/script&gt;
+        &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/Source/WebCore/CMakeLists.txt        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -189,6 +189,7 @@
</span><span class="cx">     Modules/mediastream/AllVideoCapabilities.idl
</span><span class="cx">     Modules/mediastream/AudioStreamTrack.idl
</span><span class="cx">     Modules/mediastream/CapabilityRange.idl
</span><ins>+    Modules/mediastream/HTMLMediaElementMediaStream.idl
</ins><span class="cx">     Modules/mediastream/MediaSourceStates.idl
</span><span class="cx">     Modules/mediastream/MediaStream.idl
</span><span class="cx">     Modules/mediastream/MediaStreamCapabilities.idl
</span><span class="lines">@@ -829,6 +830,7 @@
</span><span class="cx"> 
</span><span class="cx">     Modules/mediastream/AudioStreamTrack.cpp
</span><span class="cx">     Modules/mediastream/CapabilityRange.cpp
</span><ins>+    Modules/mediastream/HTMLMediaElementMediaStream.cpp
</ins><span class="cx">     Modules/mediastream/MediaConstraintsImpl.cpp
</span><span class="cx">     Modules/mediastream/MediaSourceStates.cpp
</span><span class="cx">     Modules/mediastream/MediaStream.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/Source/WebCore/ChangeLog        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2013-11-26  Nick Diego Yamane  &lt;nick.yamane@openbossa.org&gt;
+
+        [MediaStream API] HTMLMediaElement should be able to use MediaStream as source
+        https://bugs.webkit.org/show_bug.cgi?id=121943
+
+        Reviewed by Eric Carlson.
+
+        Implement MediaStream direct assignment to Media Elements using the new 'srcObject'
+        attribute: http://www.w3.org/TR/mediacapture-streams/#direct-assignment-to-media-elements
+
+        Test: fast/mediastream/MediaStream-MediaElement-srcObject.html
+
+        * CMakeLists.txt: Added new HTMLMediaElementMediaStream.h and .cpp to cmake build.
+        * DerivedSources.make: Added HTMLMediaElementMediaStream.idl.
+        * GNUmakefile.list.am: Added new HTMLMediaElementMediaStream* to autotools build.
+        * WebCore.xcodeproj/project.pbxproj: Added new files.
+        * Modules/mediastream/HTMLMediaElementMediaStream.cpp: Added.
+        (WebCore::HTMLMediaElementMediaStream::srcObject): implements srcObject getter.
+        (WebCore::HTMLMediaElementMediaStream::setSrcObject): implements srcObject setter.
+        * Modules/mediastream/HTMLMediaElementMediaStream.h: Added.
+        * Modules/mediastream/HTMLMediaElementMediaStream.idl: Added.
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::setSrcObject): This is an initial implementation, and
+        is still incomplete, that will be addressed in a separate bug: https://webkit.org/b/124896
+        * html/HTMLMediaElement.h: Added m_mediaStreamSrcObject class variable
+        and its corresponding getter.
+
</ins><span class="cx"> 2013-11-26  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use child iterator to find operators in RenderMathMLRow::layout().
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/Source/WebCore/DerivedSources.make        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -106,6 +106,7 @@
</span><span class="cx">         $(WebCore)/Modules/mediastream/AllAudioCapabilities.idl \
</span><span class="cx">         $(WebCore)/Modules/mediastream/AudioStreamTrack.idl \
</span><span class="cx">     $(WebCore)/Modules/mediastream/CapabilityRange.idl \
</span><ins>+    $(WebCore)/Modules/mediastream/HTMLMediaElementMediaStream.idl \
</ins><span class="cx">     $(WebCore)/Modules/mediastream/MediaSourceStates.idl \
</span><span class="cx">         $(WebCore)/Modules/mediastream/MediaStream.idl \
</span><span class="cx">         $(WebCore)/Modules/mediastream/MediaStreamCapabilities.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -355,6 +355,8 @@
</span><span class="cx">         DerivedSources/WebCore/JSHTMLMarqueeElement.h \
</span><span class="cx">         DerivedSources/WebCore/JSHTMLMediaElement.cpp \
</span><span class="cx">         DerivedSources/WebCore/JSHTMLMediaElement.h \
</span><ins>+        DerivedSources/WebCore/JSHTMLMediaElementMediaStream.cpp \
+        DerivedSources/WebCore/JSHTMLMediaElementMediaStream.h \
</ins><span class="cx">         DerivedSources/WebCore/JSHTMLMenuElement.cpp \
</span><span class="cx">         DerivedSources/WebCore/JSHTMLMenuElement.h \
</span><span class="cx">         DerivedSources/WebCore/JSHTMLMetaElement.cpp \
</span><span class="lines">@@ -1887,6 +1889,8 @@
</span><span class="cx">         Source/WebCore/Modules/mediastream/AudioStreamTrack.h \
</span><span class="cx">         Source/WebCore/Modules/mediastream/CapabilityRange.cpp \
</span><span class="cx">         Source/WebCore/Modules/mediastream/CapabilityRange.h \
</span><ins>+        Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.cpp \
+        Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.h \
</ins><span class="cx">         Source/WebCore/Modules/mediastream/MediaConstraintsImpl.cpp \
</span><span class="cx">         Source/WebCore/Modules/mediastream/MediaConstraintsImpl.h \
</span><span class="cx">         Source/WebCore/Modules/mediastream/MediaSourceStates.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamHTMLMediaElementMediaStreamcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.cpp (0 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.cpp        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;HTMLMediaElementMediaStream.h&quot;
+
+#if ENABLE(MEDIA_STREAM) &amp;&amp; ENABLE(VIDEO)
+
+#include &quot;HTMLMediaElement.h&quot;
+#include &quot;MediaStream.h&quot;
+
+namespace WebCore {
+
+MediaStream* HTMLMediaElementMediaStream::srcObject(HTMLMediaElement* mediaElement, bool&amp; isNull)
+{
+    ASSERT(mediaElement);
+    return mediaElement-&gt;srcObject();
+}
+
+void HTMLMediaElementMediaStream::setSrcObject(HTMLMediaElement* mediaElement, MediaStream* mediaStream)
+{
+    ASSERT(mediaElement);
+    mediaElement-&gt;setSrcObject(mediaStream);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) &amp;&amp; ENABLE(VIDEO)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamHTMLMediaElementMediaStreamh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.h (0 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.h        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HTMLMediaElementMediaStream_h
+#define HTMLMediaElementMediaStream_h
+
+#if ENABLE(MEDIA_STREAM) &amp;&amp; ENABLE(VIDEO)
+
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace WebCore {
+
+class HTMLMediaElement;
+class MediaStream;
+
+class HTMLMediaElementMediaStream {
+public:
+    static MediaStream* srcObject(HTMLMediaElement*, bool&amp; isNull);
+    static void setSrcObject(HTMLMediaElement*, MediaStream*);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) &amp;&amp; ENABLE(VIDEO)
+
+#endif // HTMLMediaElementMediaStream_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamHTMLMediaElementMediaStreamidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.idl (0 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.idl        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=VIDEO&amp;MEDIA_STREAM,
+] partial interface HTMLMediaElement
+{
+    attribute MediaStream? srcObject;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -180,6 +180,8 @@
</span><span class="cx">                 076970861463AD8700F502CF /* TextTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076970841463AD8700F502CF /* TextTrackList.cpp */; };
</span><span class="cx">                 076970871463AD8700F502CF /* TextTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = 076970851463AD8700F502CF /* TextTrackList.h */; };
</span><span class="cx">                 076F0D0E12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */; };
</span><ins>+                0779BF0D18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0779BF0A18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp */; };
+                0779BF0E18453168000B6AE7 /* HTMLMediaElementMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */; };
</ins><span class="cx">                 0783228418013ED800999E0C /* MediaStreamAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */; };
</span><span class="cx">                 0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0783228318013ED800999E0C /* MediaStreamAudioSource.h */; };
</span><span class="cx">                 07846342145B151A00A58DF1 /* JSTrackEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */; };
</span><span class="lines">@@ -6796,6 +6798,9 @@
</span><span class="cx">                 076970851463AD8700F502CF /* TextTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlayerPrivateAVFoundation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateAVFoundation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0779BF0A18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLMediaElementMediaStream.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLMediaElementMediaStream.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0779BF0C18453168000B6AE7 /* HTMLMediaElementMediaStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMediaElementMediaStream.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamAudioSource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0783228318013ED800999E0C /* MediaStreamAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamAudioSource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTrackEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13579,6 +13584,9 @@
</span><span class="cx">                 07221B4617CEC32700848E51 /* mediastream */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                0779BF0A18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp */,
+                                0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */,
+                                0779BF0C18453168000B6AE7 /* HTMLMediaElementMediaStream.idl */,
</ins><span class="cx">                                 0705853917FE0770005F2BCB /* MediaTrackConstraint.cpp */,
</span><span class="cx">                                 0705853717FE044F005F2BCB /* MediaTrackConstraintSet.cpp */,
</span><span class="cx">                                 0705852617FDE02B005F2BCB /* MediaTrackConstraintSet.h */,
</span><span class="lines">@@ -22811,6 +22819,7 @@
</span><span class="cx">                                 51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */,
</span><span class="cx">                                 97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */,
</span><span class="cx">                                 97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */,
</span><ins>+                                0779BF0E18453168000B6AE7 /* HTMLMediaElementMediaStream.h in Headers */,
</ins><span class="cx">                                 89F60B11157F686E0075E157 /* DOMWindowQuota.h in Headers */,
</span><span class="cx">                                 AA2A5AD616A4861600975A25 /* DOMWindowSpeechSynthesis.h in Headers */,
</span><span class="cx">                                 A8CCBB49151F831600AB7CE9 /* DOMWindowWebDatabase.h in Headers */,
</span><span class="lines">@@ -26215,6 +26224,7 @@
</span><span class="cx">                                 2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */,
</span><span class="cx">                                 C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */,
</span><span class="cx">                                 5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */,
</span><ins>+                                0779BF0D18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp in Sources */,
</ins><span class="cx">                                 26C17A3F1491D2D400D12BA2 /* FileSystemIOS.mm in Sources */,
</span><span class="cx">                                 CD3A495417A9CC9000274E42 /* MediaSourceBase.cpp in Sources */,
</span><span class="cx">                                 514B3F760C722055000530DF /* FileSystemMac.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -112,6 +112,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><ins>+#include &quot;MediaStream.h&quot;
</ins><span class="cx"> #include &quot;MediaStreamRegistry.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -320,6 +321,9 @@
</span><span class="cx">     , m_audioSessionManagerToken(AudioSessionManagerToken::create(tagName == videoTag ? AudioSessionManager::Video : AudioSessionManager::Audio))
</span><span class="cx"> #endif
</span><span class="cx">     , m_reportedExtraMemoryCost(0)
</span><ins>+#if ENABLE(MEDIA_STREAM)
+    , m_mediaStreamSrcObject(nullptr)
+#endif
</ins><span class="cx"> {
</span><span class="cx">     LOG(Media, &quot;HTMLMediaElement::HTMLMediaElement&quot;);
</span><span class="cx">     setHasCustomStyleResolveCallbacks();
</span><span class="lines">@@ -746,6 +750,20 @@
</span><span class="cx">     setAttribute(srcAttr, url);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(MEDIA_STREAM)
+void HTMLMediaElement::setSrcObject(MediaStream* mediaStream)
+{
+    // FIXME: Setting the srcObject attribute may cause other changes to the media element's internal state:
+    // Specifically, if srcObject is specified, the UA must use it as the source of media, even if the src
+    // attribute is also set or children are present. If the value of srcObject is replaced or set to null
+    // the UA must re-run the media element load algorithm.
+    //
+    // https://bugs.webkit.org/show_bug.cgi?id=124896
+
+    m_mediaStreamSrcObject = mediaStream;
+}
+#endif
+
</ins><span class="cx"> HTMLMediaElement::NetworkState HTMLMediaElement::networkState() const
</span><span class="cx"> {
</span><span class="cx">     return m_networkState;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -48,8 +48,10 @@
</span><span class="cx"> #include &quot;VideoTrack.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(MEDIA_STREAM)
+#include &quot;MediaStream.h&quot;
+#endif
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> #if USE(AUDIO_SESSION)
</span><span class="lines">@@ -139,10 +141,15 @@
</span><span class="cx"> // error state
</span><span class="cx">     PassRefPtr&lt;MediaError&gt; error() const;
</span><span class="cx"> 
</span><del>-// network state
</del><span class="cx">     void setSrc(const String&amp;);
</span><span class="cx">     const URL&amp; currentSrc() const { return m_currentSrc; }
</span><span class="cx"> 
</span><ins>+#if ENABLE(MEDIA_STREAM)
+    MediaStream* srcObject() const { return m_mediaStreamSrcObject.get(); }
+    void setSrcObject(MediaStream*);
+#endif
+
+// network state
</ins><span class="cx">     enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO_SOURCE };
</span><span class="cx">     NetworkState networkState() const;
</span><span class="cx"> 
</span><span class="lines">@@ -797,6 +804,10 @@
</span><span class="cx">     RefPtr&lt;MediaControlsHost&gt; m_mediaControlsHost;
</span><span class="cx">     RefPtr&lt;DOMWrapperWorld&gt; m_isolatedWorld;
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(MEDIA_STREAM)
+    RefPtr&lt;MediaStream&gt; m_mediaStreamSrcObject;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/Source/WebKit2/CMakeLists.txt        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx">     &quot;${WEBKIT2_DIR}/WebProcess/WebPage/CoordinatedGraphics&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/battery&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/Modules/mediastream&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/Modules/networkinfo&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/notifications&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/Modules/vibration&quot;
</span><span class="lines">@@ -100,6 +101,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/surfaces&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/texmap&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/transforms&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/platform/mediastream&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/platform/network&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/sql&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/text&quot;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (159796 => 159797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-11-27 01:27:28 UTC (rev 159796)
+++ trunk/Source/WebKit2/ChangeLog        2013-11-27 02:13:04 UTC (rev 159797)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2013-11-26  Nick Diego Yamane  &lt;nick.yamane@openbossa.org&gt;
+
+        [MediaStream API] HTMLMediaElement should be able to use MediaStream as source
+        https://bugs.webkit.org/show_bug.cgi?id=121943
+
+        Reviewed by Eric Carlson.
+
+        Add mediastream module and platform to cmake include directories.
+
+        * CMakeLists.txt:
+
</ins><span class="cx"> 2013-11-26  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Some WebKit2 headers are not self-contained
</span></span></pre>
</div>
</div>

</body>
</html>