<!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>[189982] 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/189982">189982</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2015-09-18 14:05:37 -0700 (Fri, 18 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[MediaStream] Finish implementing MediaDevices.enumerateDevices
https://bugs.webkit.org/show_bug.cgi?id=149322
&lt;rdar://problem/22750866&gt;

Reviewed by Brent Fulgham.

Source/WebCore:

Test: fast/mediastream/MediaDevices-enumerateDevices.html

* CMakeLists.txt: Add MediaDevicesRequest.cpp

* Modules/mediastream/MediaDeviceInfo.h: Add MediaDeviceInfoVector typedef.

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::enumerateDevices): Use MediaDevicesRequest.
* Modules/mediastream/MediaDevices.h: EnumerateDevicePromise -&gt; EnumerateDevicesPromise.
* Modules/mediastream/MediaDevices.idl:

* Modules/mediastream/MediaDevicesRequest.cpp: Added.
(WebCore::MediaDevicesRequest::create):
(WebCore::MediaDevicesRequest::MediaDevicesRequest):
(WebCore::MediaDevicesRequest::~MediaDevicesRequest):
(WebCore::MediaDevicesRequest::securityOrigin):
(WebCore::MediaDevicesRequest::contextDestroyed):
(WebCore::MediaDevicesRequest::start):
(WebCore::MediaDevicesRequest::didCompleteRequest):
(WebCore::MediaDevicesRequest::requestOrigin):
* Modules/mediastream/MediaDevicesRequest.h: Added.

* Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
(WebCore::MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest):
(WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
* Modules/mediastream/MediaStreamTrackSourcesRequest.h:

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::enumerateDevices): Deleted.
* Modules/mediastream/UserMediaRequest.h:

* WebCore.xcodeproj/project.pbxproj: Add MediaDevicesRequest.cpp

* platform/mediastream/MediaDevicesPrivate.cpp: Removed.
* platform/mediastream/MediaDevicesPrivate.h: Removed.

* platform/mediastream/MediaStreamCreationClient.h:
* platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
(WebCore::MediaStreamTrackSourcesRequestClient::~MediaStreamTrackSourcesRequestClient):

* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optionally take an
  AVCaptureSession instead of always allocating one.
(WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Pass the AVCaptureSession
  to verifyConstraintsForMediaType.

* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources):

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):

LayoutTests:

* fast/mediastream/MediaDevices-enumerateDevices-expected.txt: Added.
* fast/mediastream/MediaDevices-enumerateDevices.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="#trunkSourceWebCoreModulesmediastreamMediaDeviceInfoh">trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicescpp">trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicesh">trunk/Source/WebCore/Modules/mediastream/MediaDevices.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicesidl">trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaStreamTrackSourcesRequestcpp">trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaStreamTrackSourcesRequesth">trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamUserMediaRequestcpp">trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamUserMediaRequesth">trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaStreamCreationClienth">trunk/Source/WebCore/platform/mediastream/MediaStreamCreationClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaStreamTrackSourcesRequestClienth">trunk/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacAVCaptureDeviceManagerh">trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacAVCaptureDeviceManagermm">trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacRealtimeMediaSourceCenterMaccpp">trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeMediaSourceCentercpp">trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastmediastreamMediaDevicesenumerateDevicesexpectedtxt">trunk/LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamMediaDevicesenumerateDeviceshtml">trunk/LayoutTests/fast/mediastream/MediaDevices-enumerateDevices.html</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicesRequestcpp">trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicesRequesth">trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaDevicesPrivatecpp">trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaDevicesPrivateh">trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/LayoutTests/ChangeLog        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-09-18  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        [MediaStream] Finish implementing MediaDevices.enumerateDevices
+        https://bugs.webkit.org/show_bug.cgi?id=149322
+        &lt;rdar://problem/22750866&gt;
+
+        Reviewed by Brent Fulgham.
+
+        * fast/mediastream/MediaDevices-enumerateDevices-expected.txt: Added.
+        * fast/mediastream/MediaDevices-enumerateDevices.html: Added.
+
</ins><span class="cx"> 2015-09-18  Jake Nielsen  &lt;jacob_nielsen@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Updates to include change to iOS test expectations after bug 149187
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamMediaDevicesenumerateDevicesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt (0 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+Tests MediaDevices.enumerateDevices()
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS navigator.mediaDevices is an instance of Object
+PASS navigator.mediaDevices.enumerateDevices is an instance of Function
+
+PASS captureDevices.length is non-zero.
+
+PASS captureDevice.kind is non-null.
+PASS captureDevice.deviceId is non-null.
+PASS captureDevice.label is non-null.
+PASS captureDevice.groupId is non-null.
+
+PASS captureDevice.kind is non-null.
+PASS captureDevice.deviceId is non-null.
+PASS captureDevice.label is non-null.
+PASS captureDevice.groupId is non-null.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamMediaDevicesenumerateDeviceshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/MediaDevices-enumerateDevices.html (0 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/MediaDevices-enumerateDevices.html                                (rev 0)
+++ trunk/LayoutTests/fast/mediastream/MediaDevices-enumerateDevices.html        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;!DOCTYPE HTML&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;
+            var captureDevices;
+            var captureDevice;
+
+            description(&quot;Tests MediaDevices.enumerateDevices()&quot;);
+            window.jsTestIsAsync = true;
+
+            shouldBeType(&quot;navigator.mediaDevices&quot;, &quot;Object&quot;);
+            shouldBeType(&quot;navigator.mediaDevices.enumerateDevices&quot;, &quot;Function&quot;);
+            debug(&quot;&quot;);
+
+            navigator.mediaDevices.enumerateDevices()
+                .then(function(devices) {
+                    captureDevices = devices;
+                    shouldBeNonZero(&quot;captureDevices.length&quot;);
+                    debug(&quot;&quot;);
+                    devices.forEach(function(device) {
+                        captureDevice = device;
+                        shouldBeNonNull(&quot;captureDevice.kind&quot;);
+                        shouldBeNonNull(&quot;captureDevice.deviceId&quot;);
+                        shouldBeNonNull(&quot;captureDevice.label&quot;);
+                        shouldBeNonNull(&quot;captureDevice.groupId&quot;);
+                        debug(&quot;&quot;);
+                    });
+
+                    finishJSTest();
+                })
+                .catch(function(err) {
+                    testFailed(err.name + &quot;: &quot; + err.message);
+                });
+
+            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 (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -912,6 +912,7 @@
</span><span class="cx">     Modules/mediastream/MediaConstraintsImpl.cpp
</span><span class="cx">     Modules/mediastream/MediaDeviceInfo.cpp
</span><span class="cx">     Modules/mediastream/MediaDevices.cpp
</span><ins>+    Modules/mediastream/MediaDevicesRequest.cpp
</ins><span class="cx">     Modules/mediastream/MediaSourceStates.cpp
</span><span class="cx">     Modules/mediastream/MediaStream.cpp
</span><span class="cx">     Modules/mediastream/MediaStreamCapabilities.cpp
</span><span class="lines">@@ -2256,7 +2257,6 @@
</span><span class="cx">     platform/graphics/transforms/TransformationMatrix.cpp
</span><span class="cx">     platform/graphics/transforms/TranslateTransformOperation.cpp
</span><span class="cx"> 
</span><del>-    platform/mediastream/MediaDevicesPrivate.cpp
</del><span class="cx">     platform/mediastream/MediaStreamPrivate.cpp
</span><span class="cx">     platform/mediastream/MediaStreamTrackPrivate.cpp
</span><span class="cx">     platform/mediastream/RTCIceCandidateDescriptor.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/ChangeLog        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -1,3 +1,64 @@
</span><ins>+2015-09-18  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        [MediaStream] Finish implementing MediaDevices.enumerateDevices
+        https://bugs.webkit.org/show_bug.cgi?id=149322
+        &lt;rdar://problem/22750866&gt;
+
+        Reviewed by Brent Fulgham.
+
+        Test: fast/mediastream/MediaDevices-enumerateDevices.html
+
+        * CMakeLists.txt: Add MediaDevicesRequest.cpp
+
+        * Modules/mediastream/MediaDeviceInfo.h: Add MediaDeviceInfoVector typedef.
+
+        * Modules/mediastream/MediaDevices.cpp:
+        (WebCore::MediaDevices::enumerateDevices): Use MediaDevicesRequest.
+        * Modules/mediastream/MediaDevices.h: EnumerateDevicePromise -&gt; EnumerateDevicesPromise.
+        * Modules/mediastream/MediaDevices.idl:
+
+        * Modules/mediastream/MediaDevicesRequest.cpp: Added.
+        (WebCore::MediaDevicesRequest::create):
+        (WebCore::MediaDevicesRequest::MediaDevicesRequest):
+        (WebCore::MediaDevicesRequest::~MediaDevicesRequest):
+        (WebCore::MediaDevicesRequest::securityOrigin):
+        (WebCore::MediaDevicesRequest::contextDestroyed):
+        (WebCore::MediaDevicesRequest::start):
+        (WebCore::MediaDevicesRequest::didCompleteRequest):
+        (WebCore::MediaDevicesRequest::requestOrigin):
+        * Modules/mediastream/MediaDevicesRequest.h: Added.
+
+        * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
+        (WebCore::MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest):
+        (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
+        * Modules/mediastream/MediaStreamTrackSourcesRequest.h:
+
+        * Modules/mediastream/UserMediaRequest.cpp:
+        (WebCore::UserMediaRequest::enumerateDevices): Deleted.
+        * Modules/mediastream/UserMediaRequest.h:
+
+        * WebCore.xcodeproj/project.pbxproj: Add MediaDevicesRequest.cpp
+
+        * platform/mediastream/MediaDevicesPrivate.cpp: Removed.
+        * platform/mediastream/MediaDevicesPrivate.h: Removed.
+
+        * platform/mediastream/MediaStreamCreationClient.h:
+        * platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
+        (WebCore::MediaStreamTrackSourcesRequestClient::~MediaStreamTrackSourcesRequestClient):
+
+        * platform/mediastream/mac/AVCaptureDeviceManager.h:
+        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
+        (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optionally take an
+          AVCaptureSession instead of always allocating one.
+        (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Pass the AVCaptureSession
+          to verifyConstraintsForMediaType.
+
+        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
+        (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources):
+
+        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
+        (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):
+
</ins><span class="cx"> 2015-09-18  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebContent crash in WebCore::MemoryPressureHandler::releaseCriticalMemory() with GuardMalloc when preparing to suspend
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDeviceInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -38,8 +38,7 @@
</span><span class="cx"> class MediaDeviceInfo : public RefCounted&lt;MediaDeviceInfo&gt;, public ScriptWrappable, public ContextDestructionObserver {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;MediaDeviceInfo&gt; create(ScriptExecutionContext*, const String&amp;, const String&amp;, const String&amp;, const String&amp;);
</span><del>-    
-    
</del><ins>+
</ins><span class="cx">     virtual ~MediaDeviceInfo() { }
</span><span class="cx">     
</span><span class="cx">     const String&amp; label() const { return m_label; }
</span><span class="lines">@@ -60,6 +59,8 @@
</span><span class="cx">     const String m_kind;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+typedef Vector&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; MediaDeviceInfoVector;
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Dictionary.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><ins>+#include &quot;MediaDevicesRequest.h&quot;
</ins><span class="cx"> #include &quot;MediaStream.h&quot;
</span><span class="cx"> #include &quot;UserMediaController.h&quot;
</span><span class="cx"> #include &quot;UserMediaRequest.h&quot;
</span><span class="lines">@@ -65,9 +66,11 @@
</span><span class="cx">     UserMediaRequest::start(document(), options, WTF::move(promise), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaDevices::enumerateDevices(EnumerateDevicePromise&amp;&amp; promise, ExceptionCode&amp; ec) const
</del><ins>+void MediaDevices::enumerateDevices(EnumerateDevicesPromise&amp;&amp; promise, ExceptionCode&amp; ec) const
</ins><span class="cx"> {
</span><del>-    UserMediaRequest::enumerateDevices(document(), WTF::move(promise), ec);
</del><ins>+    RefPtr&lt;MediaDevicesRequest&gt; request = MediaDevicesRequest::create(document(), WTF::move(promise), ec);
+    if (request)
+        request-&gt;start();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevices.h (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevices.h        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevices.h        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ContextDestructionObserver.h&quot;
</span><span class="cx"> #include &quot;JSDOMPromise.h&quot;
</span><ins>+#include &quot;MediaDeviceInfo.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &lt;functional&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="lines">@@ -44,7 +45,6 @@
</span><span class="cx"> 
</span><span class="cx"> class Dictionary;
</span><span class="cx"> class Document;
</span><del>-class MediaDeviceInfo;
</del><span class="cx"> class MediaStream;
</span><span class="cx"> class NavigatorUserMediaError;
</span><span class="cx"> 
</span><span class="lines">@@ -58,9 +58,10 @@
</span><span class="cx">     Document* document() const;
</span><span class="cx"> 
</span><span class="cx">     typedef DOMPromiseWithCallback&lt;RefPtr&lt;MediaStream&gt;, RefPtr&lt;NavigatorUserMediaError&gt;&gt; Promise;
</span><del>-    typedef DOMPromiseWithCallback&lt;Vector&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt;, RefPtr&lt;NavigatorUserMediaError&gt;&gt; EnumerateDevicePromise;
</del><ins>+    typedef DOMPromiseWithCallback&lt;MediaDeviceInfoVector, ExceptionCode&gt; EnumerateDevicesPromise;
+
</ins><span class="cx">     void getUserMedia(const Dictionary&amp;, Promise&amp;&amp;, ExceptionCode&amp;) const;
</span><del>-    void enumerateDevices(EnumerateDevicePromise&amp;&amp;, ExceptionCode&amp;) const;
</del><ins>+    void enumerateDevices(EnumerateDevicesPromise&amp;&amp;, ExceptionCode&amp;) const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit MediaDevices(ScriptExecutionContext*);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicesidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -33,4 +33,5 @@
</span><span class="cx">     Conditional=MEDIA_STREAM
</span><span class="cx"> ] interface MediaDevices {
</span><span class="cx">     [RaisesException] Promise getUserMedia(Dictionary options);
</span><ins>+    [RaisesException] Promise enumerateDevices();
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicesRequestcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp (0 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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
+ * 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;MediaDevicesRequest.h&quot;
+
+#if ENABLE(MEDIA_STREAM)
+
+#include &quot;Document.h&quot;
+#include &quot;ExceptionCode.h&quot;
+#include &quot;Frame.h&quot;
+#include &quot;JSMediaDeviceInfo.h&quot;
+#include &quot;RealtimeMediaSourceCenter.h&quot;
+#include &quot;SecurityOrigin.h&quot;
+#include &lt;wtf/MainThread.h&gt;
+
+namespace WebCore {
+
+RefPtr&lt;MediaDevicesRequest&gt; MediaDevicesRequest::create(Document* document, MediaDevices::EnumerateDevicesPromise&amp;&amp; promise, ExceptionCode&amp;)
+{
+    return adoptRef(*new MediaDevicesRequest(document, WTF::move(promise)));
+}
+
+MediaDevicesRequest::MediaDevicesRequest(ScriptExecutionContext* context, MediaDevices::EnumerateDevicesPromise&amp;&amp; promise)
+    : ContextDestructionObserver(context)
+    , m_promise(WTF::move(promise))
+{
+}
+
+MediaDevicesRequest::~MediaDevicesRequest()
+{
+}
+
+SecurityOrigin* MediaDevicesRequest::securityOrigin() const
+{
+    if (scriptExecutionContext())
+        return scriptExecutionContext()-&gt;securityOrigin();
+
+    return nullptr;
+}
+
+void MediaDevicesRequest::contextDestroyed()
+{
+    ContextDestructionObserver::contextDestroyed();
+    m_protector = nullptr;
+}
+
+void MediaDevicesRequest::start()
+{
+    m_protector = this;
+    RealtimeMediaSourceCenter::singleton().getMediaStreamTrackSources(this);
+}
+
+void MediaDevicesRequest::didCompleteRequest(const TrackSourceInfoVector&amp; capturedDevices)
+{
+    if (!m_scriptExecutionContext)
+        return;
+
+    Vector&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; deviceInfo;
+    for (auto device : capturedDevices) {
+        TrackSourceInfo* trackInfo = device.get();
+        String deviceType = trackInfo-&gt;kind() == TrackSourceInfo::SourceKind::Audio ? MediaDeviceInfo::audioInputType() : MediaDeviceInfo::videoInputType();
+
+        // FIXME: label is supposed to be empty unless a device is attached to an active MediaStreamTrack in the current browsing context, or
+        // persistent permission to access these local devices has been granted to the page's origin.
+        deviceInfo.append(MediaDeviceInfo::create(m_scriptExecutionContext, trackInfo-&gt;label(), trackInfo-&gt;id(), trackInfo-&gt;groupId(), deviceType));
+    }
+
+    RefPtr&lt;MediaDevicesRequest&gt; protectedThis(this);
+    callOnMainThread([protectedThis, deviceInfo] {
+        protectedThis-&gt;m_promise.resolve(deviceInfo);
+    });
+    m_protector = nullptr;
+
+}
+
+const String&amp; MediaDevicesRequest::requestOrigin() const
+{
+    if (scriptExecutionContext()) {
+        Document* document = downcast&lt;Document&gt;(scriptExecutionContext());
+        if (document)
+            return document-&gt;url();
+    }
+
+    return emptyString();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicesRequesth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.h (0 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.h        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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
+ * 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 MediaDevicesRequest_h
+#define MediaDevicesRequest_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include &quot;ActiveDOMObject.h&quot;
+#include &quot;MediaDevices.h&quot;
+#include &quot;MediaStreamCreationClient.h&quot;
+#include &quot;MediaStreamTrackSourcesRequestClient.h&quot;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class Document;
+class Frame;
+class SecurityOrigin;
+
+typedef int ExceptionCode;
+
+class MediaDevicesRequest : public MediaStreamTrackSourcesRequestClient, public ContextDestructionObserver {
+public:
+    static RefPtr&lt;MediaDevicesRequest&gt; create(Document*, MediaDevices::EnumerateDevicesPromise&amp;&amp;, ExceptionCode&amp;);
+
+    virtual ~MediaDevicesRequest();
+
+    void start();
+
+    SecurityOrigin* securityOrigin() const;
+
+private:
+    MediaDevicesRequest(ScriptExecutionContext*, MediaDevices::EnumerateDevicesPromise&amp;&amp;);
+
+    // MediaStreamTrackSourcesRequestClient
+    const String&amp; requestOrigin() const final;
+    void didCompleteRequest(const TrackSourceInfoVector&amp;) final;
+
+    // ContextDestructionObserver
+    virtual void contextDestroyed() override final;
+
+    MediaDevices::EnumerateDevicesPromise m_promise;
+    RefPtr&lt;MediaDevicesRequest&gt; m_protector;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // MediaDevicesRequest_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaStreamTrackSourcesRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.cpp (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.cpp        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.cpp        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     m_origin = context-&gt;securityOrigin()-&gt;toString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaStreamTrackSourcesRequest::didCompleteRequest(const Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt;&amp; requestSourceInfos)
</del><ins>+void MediaStreamTrackSourcesRequest::didCompleteRequest(const TrackSourceInfoVector&amp; requestSourceInfos)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_callback);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaStreamTrackSourcesRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.h (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.h        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.h        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> 
</span><span class="cx">     // MediaStreamTrackSourcesRequestClient
</span><span class="cx">     virtual const String&amp; requestOrigin() const override { return m_origin; }
</span><del>-    virtual void didCompleteRequest(const Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt;&amp;) override;
</del><ins>+    virtual void didCompleteRequest(const TrackSourceInfoVector&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     String m_origin;
</span><span class="cx">     RefPtr&lt;MediaStreamTrackSourcesCallback&gt; m_callback;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamUserMediaRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Ericsson AB. All rights reserved.
</span><span class="cx">  * Copyright (C) 2012 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> #include &quot;JSMediaStream.h&quot;
</span><span class="cx"> #include &quot;JSNavigatorUserMediaError.h&quot;
</span><span class="cx"> #include &quot;MediaConstraintsImpl.h&quot;
</span><del>-#include &quot;MediaDevicesPrivate.h&quot;
</del><span class="cx"> #include &quot;MediaStream.h&quot;
</span><span class="cx"> #include &quot;MediaStreamPrivate.h&quot;
</span><span class="cx"> #include &quot;NavigatorUserMediaErrorCallback.h&quot;
</span><span class="lines">@@ -70,13 +69,6 @@
</span><span class="cx">     return MediaConstraintsImpl::create();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UserMediaRequest::enumerateDevices(Document* document, MediaDevices::EnumerateDevicePromise&amp;&amp; promise, ExceptionCode&amp;)
-{
-    RefPtr&lt;MediaDevicesPrivate&gt; deviceClient = MediaDevicesPrivate::create();
-    RealtimeMediaSourceCenter::singleton().getMediaStreamTrackSources(deviceClient);
-    promise.resolve(deviceClient-&gt;availableMediaDevices(*document));
-}
-    
</del><span class="cx"> void UserMediaRequest::start(Document* document, const Dictionary&amp; options, MediaDevices::Promise&amp;&amp; promise, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!options.isObject()) {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamUserMediaRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.h (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.h        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.h        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -59,7 +59,6 @@
</span><span class="cx"> class UserMediaRequest : public MediaStreamCreationClient, public ContextDestructionObserver {
</span><span class="cx"> public:
</span><span class="cx">     static void start(Document*, const Dictionary&amp;, MediaDevices::Promise&amp;&amp;, ExceptionCode&amp;);
</span><del>-    static void enumerateDevices(Document*, MediaDevices::EnumerateDevicePromise&amp;&amp;, ExceptionCode&amp;);
</del><span class="cx"> 
</span><span class="cx">     ~UserMediaRequest();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -164,6 +164,8 @@
</span><span class="cx">                 073794FC19F5864E00E5A045 /* RTCDTMFSenderHandlerMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794F619F5864E00E5A045 /* RTCDTMFSenderHandlerMock.h */; };
</span><span class="cx">                 073794FD19F5864E00E5A045 /* RTCNotifiersMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794F719F5864E00E5A045 /* RTCNotifiersMock.cpp */; };
</span><span class="cx">                 073794FE19F5864E00E5A045 /* RTCNotifiersMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794F819F5864E00E5A045 /* RTCNotifiersMock.h */; };
</span><ins>+                07394EC81BAB2CCD00BE99CD /* MediaDevicesRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07394EC71BAB2CCD00BE99CD /* MediaDevicesRequest.cpp */; };
+                07394ECA1BAB2CD700BE99CD /* MediaDevicesRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 07394EC91BAB2CD700BE99CD /* MediaDevicesRequest.h */; };
</ins><span class="cx">                 073AB4B317F8BACA006E0D6F /* AllVideoCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 073AB4B017F8BACA006E0D6F /* AllVideoCapabilities.h */; };
</span><span class="cx">                 073AB4B717F92ECF006E0D6F /* JSCapabilityRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073AB4B517F92ECF006E0D6F /* JSCapabilityRange.cpp */; };
</span><span class="cx">                 073AB4B817F92ECF006E0D6F /* JSCapabilityRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 073AB4B617F92ECF006E0D6F /* JSCapabilityRange.h */; };
</span><span class="lines">@@ -643,9 +645,7 @@
</span><span class="cx">                 150524F51B712FF900696AA9 /* MediaPlayerPrivateMediaStreamAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 150524F11B712FF000696AA9 /* MediaPlayerPrivateMediaStreamAVFObjC.mm */; };
</span><span class="cx">                 150524F61B712FFC00696AA9 /* MediaStreamPrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 150524F21B712FF000696AA9 /* MediaStreamPrivateAVFObjC.h */; };
</span><span class="cx">                 150524F71B712FFF00696AA9 /* MediaStreamPrivateAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 150524F31B712FF000696AA9 /* MediaStreamPrivateAVFObjC.mm */; };
</span><del>-                15145B901B3A1CE000662BF7 /* MediaDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15145B8F1B3A1B3E00662BF7 /* MediaDeviceInfo.h */; };
-                152A29B41B4EF5B700B52AE0 /* MediaDevicesPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 152A29B21B4EF59600B52AE0 /* MediaDevicesPrivate.cpp */; };
-                152A29B51B4EF5BA00B52AE0 /* MediaDevicesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 152A29B31B4EF59600B52AE0 /* MediaDevicesPrivate.h */; };
</del><ins>+                15145B901B3A1CE000662BF7 /* MediaDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15145B8F1B3A1B3E00662BF7 /* MediaDeviceInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 15739BBA1B42012A00D258C1 /* JSMediaDevices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15739BB81B42012200D258C1 /* JSMediaDevices.cpp */; };
</span><span class="cx">                 15739BBB1B42012D00D258C1 /* JSMediaDevices.h in Headers */ = {isa = PBXBuildFile; fileRef = 15739BB91B42012200D258C1 /* JSMediaDevices.h */; };
</span><span class="cx">                 159741DA1B7D13F900201C92 /* JSMediaDeviceInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 157CC2611B7C1CA400D8D075 /* JSMediaDeviceInfo.cpp */; };
</span><span class="lines">@@ -7367,6 +7367,8 @@
</span><span class="cx">                 073794F619F5864E00E5A045 /* RTCDTMFSenderHandlerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDTMFSenderHandlerMock.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 073794F719F5864E00E5A045 /* RTCNotifiersMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCNotifiersMock.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 073794F819F5864E00E5A045 /* RTCNotifiersMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCNotifiersMock.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                07394EC71BAB2CCD00BE99CD /* MediaDevicesRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDevicesRequest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                07394EC91BAB2CD700BE99CD /* MediaDevicesRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaDevicesRequest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 073AB4B017F8BACA006E0D6F /* AllVideoCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllVideoCapabilities.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 073AB4B517F92ECF006E0D6F /* JSCapabilityRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCapabilityRange.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 073AB4B617F92ECF006E0D6F /* JSCapabilityRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCapabilityRange.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7824,8 +7826,6 @@
</span><span class="cx">                 150524F31B712FF000696AA9 /* MediaStreamPrivateAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaStreamPrivateAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 15145B8F1B3A1B3E00662BF7 /* MediaDeviceInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaDeviceInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 15145B911B3A1D4C00662BF7 /* MediaDeviceInfo.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaDeviceInfo.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                152A29B21B4EF59600B52AE0 /* MediaDevicesPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDevicesPrivate.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                152A29B31B4EF59600B52AE0 /* MediaDevicesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaDevicesPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 15739BB81B42012200D258C1 /* JSMediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaDevices.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 15739BB91B42012200D258C1 /* JSMediaDevices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaDevices.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 157CC2611B7C1CA400D8D075 /* JSMediaDeviceInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaDeviceInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14830,6 +14830,8 @@
</span><span class="cx">                                 0779BF0C18453168000B6AE7 /* HTMLMediaElementMediaStream.idl */,
</span><span class="cx">                                 07221B4A17CEC32700848E51 /* MediaConstraintsImpl.cpp */,
</span><span class="cx">                                 07221B4B17CEC32700848E51 /* MediaConstraintsImpl.h */,
</span><ins>+                                07394EC71BAB2CCD00BE99CD /* MediaDevicesRequest.cpp */,
+                                07394EC91BAB2CD700BE99CD /* MediaDevicesRequest.h */,
</ins><span class="cx">                                 159AE82A1B3A402F0037478B /* MediaDeviceInfo.cpp */,
</span><span class="cx">                                 15145B8F1B3A1B3E00662BF7 /* MediaDeviceInfo.h */,
</span><span class="cx">                                 15145B911B3A1D4C00662BF7 /* MediaDeviceInfo.idl */,
</span><span class="lines">@@ -14945,8 +14947,6 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 0729B14D17CFCCA0004F1D60 /* mac */,
</span><span class="cx">                                 07221B9917CF0AD400848E51 /* MediaConstraints.h */,
</span><del>-                                152A29B21B4EF59600B52AE0 /* MediaDevicesPrivate.cpp */,
-                                152A29B31B4EF59600B52AE0 /* MediaDevicesPrivate.h */,
</del><span class="cx">                                 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */,
</span><span class="cx">                                 07221BA017CF0AD400848E51 /* MediaStreamCreationClient.h */,
</span><span class="cx">                                 0711588F17DF633700EDFE2B /* MediaStreamPrivate.cpp */,
</span><span class="lines">@@ -24356,6 +24356,7 @@
</span><span class="cx">                                 26F0C89C1A2EC110002794F8 /* ContentExtensionRule.h in Headers */,
</span><span class="cx">                                 26F0C8A01A2EC3BE002794F8 /* ContentExtensionsBackend.h in Headers */,
</span><span class="cx">                                 262391361A648CEE007251A3 /* ContentExtensionsDebugging.h in Headers */,
</span><ins>+                                07394ECA1BAB2CD700BE99CD /* MediaDevicesRequest.h in Headers */,
</ins><span class="cx">                                 51FB67DC1AE6B82F00D06C5A /* ContentExtensionStyleSheet.h in Headers */,
</span><span class="cx">                                 A149786F1ABAF33800CEF7E4 /* ContentFilter.h in Headers */,
</span><span class="cx">                                 A14090FD1AA51E480091191A /* ContentFilterUnblockHandler.h in Headers */,
</span><span class="lines">@@ -24454,7 +24455,6 @@
</span><span class="cx">                                 409EBDB116B7EE7100CBA3FC /* CSSFontFaceLoadEvent.h in Headers */,
</span><span class="cx">                                 A80E6CFD0A1989CA007FB8C5 /* CSSFontFaceRule.h in Headers */,
</span><span class="cx">                                 BC64B4D80CB4298A005F2B62 /* CSSFontFaceSource.h in Headers */,
</span><del>-                                152A29B51B4EF5BA00B52AE0 /* MediaDevicesPrivate.h in Headers */,
</del><span class="cx">                                 BC64B4DA0CB4298A005F2B62 /* CSSFontFaceSrcValue.h in Headers */,
</span><span class="cx">                                 83520C7E1A71BFCC006BD2AA /* CSSFontFamily.h in Headers */,
</span><span class="cx">                                 4A6E9FC413C17D1D0046A7F8 /* CSSFontFeatureValue.h in Headers */,
</span><span class="lines">@@ -28250,6 +28250,7 @@
</span><span class="cx">                                 9393E5FF151A99F200066F06 /* CSSImageSetValue.cpp in Sources */,
</span><span class="cx">                                 A80E6CFE0A1989CA007FB8C5 /* CSSImageValue.cpp in Sources */,
</span><span class="cx">                                 A80E6CEB0A1989CA007FB8C5 /* CSSImportRule.cpp in Sources */,
</span><ins>+                                07394EC81BAB2CCD00BE99CD /* MediaDevicesRequest.cpp in Sources */,
</ins><span class="cx">                                 A80E6CF00A1989CA007FB8C5 /* CSSInheritedValue.cpp in Sources */,
</span><span class="cx">                                 A80E6D020A1989CA007FB8C5 /* CSSInitialValue.cpp in Sources */,
</span><span class="cx">                                 31288E720E3005D6003619AE /* CSSKeyframeRule.cpp in Sources */,
</span><span class="lines">@@ -29444,7 +29445,6 @@
</span><span class="cx">                                 BCE0139A0C0BEF180043860A /* JSStyleSheet.cpp in Sources */,
</span><span class="cx">                                 BC98A27D0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp in Sources */,
</span><span class="cx">                                 A84EBD840CB8C97700079609 /* JSStyleSheetList.cpp in Sources */,
</span><del>-                                152A29B41B4EF5B700B52AE0 /* MediaDevicesPrivate.cpp in Sources */,
</del><span class="cx">                                 A84EBD780CB8C89200079609 /* JSStyleSheetListCustom.cpp in Sources */,
</span><span class="cx">                                 E1FF8F64180745D800132674 /* JSSubtleCrypto.cpp in Sources */,
</span><span class="cx">                                 E1FF8F681807460800132674 /* JSSubtleCryptoCustom.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaDevicesPrivatecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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
- * 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;MediaDevicesPrivate.h&quot;
-
-#if ENABLE(MEDIA_STREAM)
-
-namespace WebCore {
-
-Ref&lt;MediaDevicesPrivate&gt; MediaDevicesPrivate::create()
-{
-    return adoptRef(*new MediaDevicesPrivate);
-}
-
-MediaDevicesPrivate::MediaDevicesPrivate()
-    : m_capturedDevices()
-{
-}
-    
-void MediaDevicesPrivate::didCompleteRequest(const Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt;&amp; capturedDevices)
-{
-    m_capturedDevices = capturedDevices;
-}
-
-Vector&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; MediaDevicesPrivate::availableMediaDevices(ScriptExecutionContext&amp; context)
-{
-    Vector&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; mediaDevicesInfo;
-    for (auto device : m_capturedDevices) {
-        TrackSourceInfo* trackInfo = device.get();
-        String deviceType = trackInfo-&gt;kind() == TrackSourceInfo::SourceKind::Audio ? MediaDeviceInfo::audioInputType() : MediaDeviceInfo::videoInputType();
-        mediaDevicesInfo.append(MediaDeviceInfo::create(&amp;context, trackInfo-&gt;label(), trackInfo-&gt;deviceId(), trackInfo-&gt;groupId(), deviceType));
-    }
-    
-    return mediaDevicesInfo;
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaDevicesPrivateh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.h (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.h        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.h        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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
- * 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 MediaDevicesPrivate_h
-#define MediaDevicesPrivate_h
-
-#if ENABLE(MEDIA_STREAM)
-
-#include &quot;MediaDeviceInfo.h&quot;
-#include &quot;MediaStreamTrackSourcesRequestClient.h&quot;
-
-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/Vector.h&gt;
-
-namespace WebCore {
-
-class MediaDevicesPrivate : public MediaStreamTrackSourcesRequestClient {
-public:
-    static Ref&lt;MediaDevicesPrivate&gt; create();
-    
-    MediaDevicesPrivate();
-
-    ~MediaDevicesPrivate() { }
-
-    Vector&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; availableMediaDevices(ScriptExecutionContext&amp;);
-    
-    // FIXME(148041): requestOrigin inside of getMediaStreamTrackSources not used
-    const String&amp; requestOrigin() const override { return emptyString(); }
-    
-    void didCompleteRequest(const Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt;&amp;) override;
-    
-    Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt; capturedDevices() const { return m_capturedDevices; }
-    
-private:
-    Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt; m_capturedDevices;
-};
-
-}
-
-#endif // ENABLE(MEDIA_STREAM)
-
-#endif // MediaDevicesPrivate_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaStreamCreationClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamCreationClient.h (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaStreamCreationClient.h        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamCreationClient.h        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx"> 
</span><ins>+#include &quot;MediaDevices.h&quot;
</ins><span class="cx"> #include &quot;RealtimeMediaSource.h&quot;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaStreamTrackSourcesRequestClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -79,15 +79,18 @@
</span><span class="cx">     AtomicString m_deviceId;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+typedef Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt; TrackSourceInfoVector;
+
</ins><span class="cx"> class MediaStreamTrackSourcesRequestClient : public RefCounted&lt;MediaStreamTrackSourcesRequestClient&gt; {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~MediaStreamTrackSourcesRequestClient() { }
</span><span class="cx"> 
</span><span class="cx">     virtual const String&amp; requestOrigin() const = 0;
</span><del>-    virtual void didCompleteRequest(const Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt;&amp;) = 0;
</del><ins>+    virtual void didCompleteRequest(const TrackSourceInfoVector&amp;) = 0;
</ins><span class="cx"> 
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MEDIA_STREAM)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacAVCaptureDeviceManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -47,8 +47,8 @@
</span><span class="cx">     static AVCaptureDeviceManager&amp; singleton();
</span><span class="cx">     static bool isAvailable();
</span><span class="cx"> 
</span><del>-    Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt; getSourcesInfo(const String&amp;);
-    bool verifyConstraintsForMediaType(RealtimeMediaSource::Type, MediaConstraints*, String&amp;);
</del><ins>+    TrackSourceInfoVector getSourcesInfo(const String&amp;);
+    bool verifyConstraintsForMediaType(AVCaptureSession *, RealtimeMediaSource::Type, MediaConstraints*, String&amp;);
</ins><span class="cx">     Vector&lt;RefPtr&lt;RealtimeMediaSource&gt;&gt; bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type, PassRefPtr&lt;MediaConstraints&gt;);
</span><span class="cx">     RefPtr&lt;RealtimeMediaSource&gt; sourceWithUID(const String&amp;, RealtimeMediaSource::Type, MediaConstraints*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacAVCaptureDeviceManagermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">     return sourcesInfo;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool AVCaptureDeviceManager::verifyConstraintsForMediaType(RealtimeMediaSource::Type type, MediaConstraints* constraints, String&amp; invalidConstraint)
</del><ins>+bool AVCaptureDeviceManager::verifyConstraintsForMediaType(AVCaptureSessionType *session, RealtimeMediaSource::Type type, MediaConstraints* constraints, String&amp; invalidConstraint)
</ins><span class="cx"> {
</span><span class="cx">     if (!isAvailable())
</span><span class="cx">         return false;
</span><span class="lines">@@ -355,11 +355,10 @@
</span><span class="cx">     constraints-&gt;getMandatoryConstraints(mandatoryConstraints);
</span><span class="cx">     if (mandatoryConstraints.size()) {
</span><span class="cx"> 
</span><del>-        // FIXME: this method should take an AVCaptureDevice and use its AVCaptureSession instead of creating a new one.
-        RetainPtr&lt;AVCaptureSessionType&gt; session = adoptNS([allocAVCaptureSessionInstance() init]);
</del><ins>+        RetainPtr&lt;AVCaptureSessionType&gt; captureSession = session ? session : adoptNS([allocAVCaptureSessionInstance() init]);
</ins><span class="cx">         for (size_t i = 0; i &lt; mandatoryConstraints.size(); ++i) {
</span><span class="cx">             const MediaConstraint&amp; constraint = mandatoryConstraints[i];
</span><del>-            if (!sessionSupportsConstraint(session.get(), type, constraint.m_name, constraint.m_value)) {
</del><ins>+            if (!sessionSupportsConstraint(captureSession.get(), type, constraint.m_name, constraint.m_value)) {
</ins><span class="cx">                 invalidConstraint = constraint.m_name;
</span><span class="cx">                 return false;
</span><span class="cx">             }
</span><span class="lines">@@ -425,21 +424,29 @@
</span><span class="cx"> 
</span><span class="cx">         if (captureDevice.m_captureDeviceID != deviceUID)
</span><span class="cx">             continue;
</span><ins>+
</ins><span class="cx">         if (constraints) {
</span><span class="cx">             String invalidConstraints;
</span><del>-            AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(type, constraints, invalidConstraints);
</del><ins>+            AVCaptureSessionType *session = nil;
+
+            if (type == RealtimeMediaSource::Video &amp;&amp; captureDevice.m_videoAVMediaCaptureSource)
+                captureDevice.m_videoAVMediaCaptureSource-&gt;session();
+            else if (type == RealtimeMediaSource::Audio &amp;&amp; captureDevice.m_audioAVMediaCaptureSource)
+                captureDevice.m_audioAVMediaCaptureSource-&gt;session();
+            AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(session, type, constraints, invalidConstraints);
+
</ins><span class="cx">             if (!invalidConstraints.isEmpty())
</span><span class="cx">                 continue;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         AVCaptureDeviceType *device = [AVCaptureDevice deviceWithUniqueID:captureDevice.m_captureDeviceID];
</span><span class="cx">         ASSERT(device);
</span><del>-        if (type == RealtimeMediaSource::Type::Audio &amp;&amp; !captureDevice.m_audioSourceId.isEmpty()) {
</del><ins>+        if (type == RealtimeMediaSource::Audio &amp;&amp; !captureDevice.m_audioSourceId.isEmpty()) {
</ins><span class="cx">             if (!captureDevice.m_audioAVMediaCaptureSource)
</span><span class="cx">                 captureDevice.m_audioAVMediaCaptureSource = AVAudioCaptureSource::create(device, captureDevice.m_audioSourceId, constraints);
</span><span class="cx">             return captureDevice.m_audioAVMediaCaptureSource;
</span><span class="cx">         }
</span><del>-        if (type == RealtimeMediaSource::Type::Video &amp;&amp; !captureDevice.m_videoSourceId.isEmpty()) {
</del><ins>+        if (type == RealtimeMediaSource::Video &amp;&amp; !captureDevice.m_videoSourceId.isEmpty()) {
</ins><span class="cx">             if (!captureDevice.m_videoAVMediaCaptureSource)
</span><span class="cx">                 captureDevice.m_videoAVMediaCaptureSource = AVVideoCaptureSource::create(device, captureDevice.m_videoSourceId, constraints);
</span><span class="cx">             return captureDevice.m_videoAVMediaCaptureSource;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacRealtimeMediaSourceCenterMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (audioConstraints) {
</span><span class="cx">         String invalidConstraint;
</span><del>-        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Audio, audioConstraints.get(), invalidConstraint);
</del><ins>+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(nil, RealtimeMediaSource::Audio, audioConstraints.get(), invalidConstraint);
</ins><span class="cx">         if (!invalidConstraint.isEmpty()) {
</span><span class="cx">             client-&gt;constraintsInvalid(invalidConstraint);
</span><span class="cx">             return;
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (videoConstraints) {
</span><span class="cx">         String invalidConstraint;
</span><del>-        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Video, videoConstraints.get(), invalidConstraint);
</del><ins>+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(nil, RealtimeMediaSource::Video, videoConstraints.get(), invalidConstraint);
</ins><span class="cx">         if (!invalidConstraint.isEmpty()) {
</span><span class="cx">             client-&gt;constraintsInvalid(invalidConstraint);
</span><span class="cx">             return;
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">     
</span><span class="cx">     if (audioConstraints) {
</span><span class="cx">         String invalidConstraint;
</span><del>-        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Audio, audioConstraints.get(), invalidConstraint);
</del><ins>+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(nil, RealtimeMediaSource::Audio, audioConstraints.get(), invalidConstraint);
</ins><span class="cx">         if (!invalidConstraint.isEmpty()) {
</span><span class="cx">             client-&gt;failedToCreateStreamWithConstraintsError(invalidConstraint);
</span><span class="cx">             return;
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx">     
</span><span class="cx">     if (videoConstraints) {
</span><span class="cx">         String invalidConstraint;
</span><del>-        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Video, videoConstraints.get(), invalidConstraint);
</del><ins>+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(nil, RealtimeMediaSource::Video, videoConstraints.get(), invalidConstraint);
</ins><span class="cx">         if (!invalidConstraint.isEmpty()) {
</span><span class="cx">             client-&gt;failedToCreateStreamWithConstraintsError(invalidConstraint);
</span><span class="cx">             return;
</span><span class="lines">@@ -130,9 +130,12 @@
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;MediaStreamTrackSourcesRequestClient&gt; requestClient = prpClient;
</span><span class="cx"> 
</span><del>-    Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt; sources = AVCaptureDeviceManager::singleton().getSourcesInfo(requestClient-&gt;requestOrigin());
</del><ins>+    TrackSourceInfoVector sources = AVCaptureDeviceManager::singleton().getSourcesInfo(requestClient-&gt;requestOrigin());
</ins><span class="cx"> 
</span><del>-    requestClient-&gt;didCompleteRequest(sources);
</del><ins>+    callOnMainThread([this, requestClient, sources] {
+        requestClient-&gt;didCompleteRequest(sources);
+    });
+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeMediaSourceCentercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp (189981 => 189982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp        2015-09-18 20:57:31 UTC (rev 189981)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp        2015-09-18 21:05:37 UTC (rev 189982)
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx"> bool MockRealtimeMediaSourceCenter::getMediaStreamTrackSources(PassRefPtr&lt;MediaStreamTrackSourcesRequestClient&gt; prpClient)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;MediaStreamTrackSourcesRequestClient&gt; requestClient = prpClient;
</span><del>-    Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt; sources;
</del><ins>+    TrackSourceInfoVector sources;
</ins><span class="cx"> 
</span><span class="cx">     MockSourceMap&amp; map = mockSourceMap();
</span><span class="cx">     MockSourceMap::iterator end = map.end();
</span></span></pre>
</div>
</div>

</body>
</html>