<!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
<rdar://problem/22750866>
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 -> 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 <eric.carlson@apple.com>
+
+ [MediaStream] Finish implementing MediaDevices.enumerateDevices
+ https://bugs.webkit.org/show_bug.cgi?id=149322
+ <rdar://problem/22750866>
+
+ 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 <jacob_nielsen@apple.com>
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+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>+<!DOCTYPE HTML>
+<html>
+ <head>
+ <script src="../../resources/js-test-pre.js"></script>
+ </head>
+ <body>
+ <p id="description"></p>
+ <div id="console"></div>
+ <script>
+ var captureDevices;
+ var captureDevice;
+
+ description("Tests MediaDevices.enumerateDevices()");
+ window.jsTestIsAsync = true;
+
+ shouldBeType("navigator.mediaDevices", "Object");
+ shouldBeType("navigator.mediaDevices.enumerateDevices", "Function");
+ debug("");
+
+ navigator.mediaDevices.enumerateDevices()
+ .then(function(devices) {
+ captureDevices = devices;
+ shouldBeNonZero("captureDevices.length");
+ debug("");
+ devices.forEach(function(device) {
+ captureDevice = device;
+ shouldBeNonNull("captureDevice.kind");
+ shouldBeNonNull("captureDevice.deviceId");
+ shouldBeNonNull("captureDevice.label");
+ shouldBeNonNull("captureDevice.groupId");
+ debug("");
+ });
+
+ finishJSTest();
+ })
+ .catch(function(err) {
+ testFailed(err.name + ": " + err.message);
+ });
+
+ window.successfullyParsed = true;
+ </script>
+ <script src="../../resources/js-test-post.js"></script>
+ </body>
+</html>
</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 <eric.carlson@apple.com>
+
+ [MediaStream] Finish implementing MediaDevices.enumerateDevices
+ https://bugs.webkit.org/show_bug.cgi?id=149322
+ <rdar://problem/22750866>
+
+ 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 -> 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 <cdumez@apple.com>
</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<MediaDeviceInfo>, public ScriptWrappable, public ContextDestructionObserver {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<MediaDeviceInfo> create(ScriptExecutionContext*, const String&, const String&, const String&, const String&);
</span><del>-
-
</del><ins>+
</ins><span class="cx"> virtual ~MediaDeviceInfo() { }
</span><span class="cx">
</span><span class="cx"> const String& 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<RefPtr<MediaDeviceInfo>> 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 "Dictionary.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "MediaDevicesRequest.h"
</ins><span class="cx"> #include "MediaStream.h"
</span><span class="cx"> #include "UserMediaController.h"
</span><span class="cx"> #include "UserMediaRequest.h"
</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&& promise, ExceptionCode& ec) const
</del><ins>+void MediaDevices::enumerateDevices(EnumerateDevicesPromise&& promise, ExceptionCode& ec) const
</ins><span class="cx"> {
</span><del>- UserMediaRequest::enumerateDevices(document(), WTF::move(promise), ec);
</del><ins>+ RefPtr<MediaDevicesRequest> request = MediaDevicesRequest::create(document(), WTF::move(promise), ec);
+ if (request)
+ request->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 "ContextDestructionObserver.h"
</span><span class="cx"> #include "JSDOMPromise.h"
</span><ins>+#include "MediaDeviceInfo.h"
</ins><span class="cx"> #include "ScriptWrappable.h"
</span><span class="cx"> #include <functional>
</span><span class="cx"> #include <wtf/RefCounted.h>
</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<RefPtr<MediaStream>, RefPtr<NavigatorUserMediaError>> Promise;
</span><del>- typedef DOMPromiseWithCallback<Vector<RefPtr<MediaDeviceInfo>>, RefPtr<NavigatorUserMediaError>> EnumerateDevicePromise;
</del><ins>+ typedef DOMPromiseWithCallback<MediaDeviceInfoVector, ExceptionCode> EnumerateDevicesPromise;
+
</ins><span class="cx"> void getUserMedia(const Dictionary&, Promise&&, ExceptionCode&) const;
</span><del>- void enumerateDevices(EnumerateDevicePromise&&, ExceptionCode&) const;
</del><ins>+ void enumerateDevices(EnumerateDevicesPromise&&, ExceptionCode&) 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 "config.h"
+#include "MediaDevicesRequest.h"
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "Document.h"
+#include "ExceptionCode.h"
+#include "Frame.h"
+#include "JSMediaDeviceInfo.h"
+#include "RealtimeMediaSourceCenter.h"
+#include "SecurityOrigin.h"
+#include <wtf/MainThread.h>
+
+namespace WebCore {
+
+RefPtr<MediaDevicesRequest> MediaDevicesRequest::create(Document* document, MediaDevices::EnumerateDevicesPromise&& promise, ExceptionCode&)
+{
+ return adoptRef(*new MediaDevicesRequest(document, WTF::move(promise)));
+}
+
+MediaDevicesRequest::MediaDevicesRequest(ScriptExecutionContext* context, MediaDevices::EnumerateDevicesPromise&& promise)
+ : ContextDestructionObserver(context)
+ , m_promise(WTF::move(promise))
+{
+}
+
+MediaDevicesRequest::~MediaDevicesRequest()
+{
+}
+
+SecurityOrigin* MediaDevicesRequest::securityOrigin() const
+{
+ if (scriptExecutionContext())
+ return scriptExecutionContext()->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& capturedDevices)
+{
+ if (!m_scriptExecutionContext)
+ return;
+
+ Vector<RefPtr<MediaDeviceInfo>> deviceInfo;
+ for (auto device : capturedDevices) {
+ TrackSourceInfo* trackInfo = device.get();
+ String deviceType = trackInfo->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->label(), trackInfo->id(), trackInfo->groupId(), deviceType));
+ }
+
+ RefPtr<MediaDevicesRequest> protectedThis(this);
+ callOnMainThread([protectedThis, deviceInfo] {
+ protectedThis->m_promise.resolve(deviceInfo);
+ });
+ m_protector = nullptr;
+
+}
+
+const String& MediaDevicesRequest::requestOrigin() const
+{
+ if (scriptExecutionContext()) {
+ Document* document = downcast<Document>(scriptExecutionContext());
+ if (document)
+ return document->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 "ActiveDOMObject.h"
+#include "MediaDevices.h"
+#include "MediaStreamCreationClient.h"
+#include "MediaStreamTrackSourcesRequestClient.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class Document;
+class Frame;
+class SecurityOrigin;
+
+typedef int ExceptionCode;
+
+class MediaDevicesRequest : public MediaStreamTrackSourcesRequestClient, public ContextDestructionObserver {
+public:
+ static RefPtr<MediaDevicesRequest> create(Document*, MediaDevices::EnumerateDevicesPromise&&, ExceptionCode&);
+
+ virtual ~MediaDevicesRequest();
+
+ void start();
+
+ SecurityOrigin* securityOrigin() const;
+
+private:
+ MediaDevicesRequest(ScriptExecutionContext*, MediaDevices::EnumerateDevicesPromise&&);
+
+ // MediaStreamTrackSourcesRequestClient
+ const String& requestOrigin() const final;
+ void didCompleteRequest(const TrackSourceInfoVector&) final;
+
+ // ContextDestructionObserver
+ virtual void contextDestroyed() override final;
+
+ MediaDevices::EnumerateDevicesPromise m_promise;
+ RefPtr<MediaDevicesRequest> 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->securityOrigin()->toString();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaStreamTrackSourcesRequest::didCompleteRequest(const Vector<RefPtr<TrackSourceInfo>>& requestSourceInfos)
</del><ins>+void MediaStreamTrackSourcesRequest::didCompleteRequest(const TrackSourceInfoVector& 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& requestOrigin() const override { return m_origin; }
</span><del>- virtual void didCompleteRequest(const Vector<RefPtr<TrackSourceInfo>>&) override;
</del><ins>+ virtual void didCompleteRequest(const TrackSourceInfoVector&) override;
</ins><span class="cx">
</span><span class="cx"> String m_origin;
</span><span class="cx"> RefPtr<MediaStreamTrackSourcesCallback> 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 "JSMediaStream.h"
</span><span class="cx"> #include "JSNavigatorUserMediaError.h"
</span><span class="cx"> #include "MediaConstraintsImpl.h"
</span><del>-#include "MediaDevicesPrivate.h"
</del><span class="cx"> #include "MediaStream.h"
</span><span class="cx"> #include "MediaStreamPrivate.h"
</span><span class="cx"> #include "NavigatorUserMediaErrorCallback.h"
</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&& promise, ExceptionCode&)
-{
- RefPtr<MediaDevicesPrivate> deviceClient = MediaDevicesPrivate::create();
- RealtimeMediaSourceCenter::singleton().getMediaStreamTrackSources(deviceClient);
- promise.resolve(deviceClient->availableMediaDevices(*document));
-}
-
</del><span class="cx"> void UserMediaRequest::start(Document* document, const Dictionary& options, MediaDevices::Promise&& promise, ExceptionCode& 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&, MediaDevices::Promise&&, ExceptionCode&);
</span><del>- static void enumerateDevices(Document*, MediaDevices::EnumerateDevicePromise&&, ExceptionCode&);
</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 = "<group>"; };
</span><span class="cx">                 073794F719F5864E00E5A045 /* RTCNotifiersMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCNotifiersMock.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 073794F819F5864E00E5A045 /* RTCNotifiersMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCNotifiersMock.h; sourceTree = "<group>"; };
</span><ins>+                07394EC71BAB2CCD00BE99CD /* MediaDevicesRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDevicesRequest.cpp; sourceTree = "<group>"; };
+                07394EC91BAB2CD700BE99CD /* MediaDevicesRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaDevicesRequest.h; sourceTree = "<group>"; };
</ins><span class="cx">                 073AB4B017F8BACA006E0D6F /* AllVideoCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllVideoCapabilities.h; sourceTree = "<group>"; };
</span><span class="cx">                 073AB4B517F92ECF006E0D6F /* JSCapabilityRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCapabilityRange.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 073AB4B617F92ECF006E0D6F /* JSCapabilityRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCapabilityRange.h; sourceTree = "<group>"; };
</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 = "<group>"; };
</span><span class="cx">                 15145B8F1B3A1B3E00662BF7 /* MediaDeviceInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaDeviceInfo.h; sourceTree = "<group>"; };
</span><span class="cx">                 15145B911B3A1D4C00662BF7 /* MediaDeviceInfo.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaDeviceInfo.idl; sourceTree = "<group>"; };
</span><del>-                152A29B21B4EF59600B52AE0 /* MediaDevicesPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDevicesPrivate.cpp; sourceTree = "<group>"; };
-                152A29B31B4EF59600B52AE0 /* MediaDevicesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaDevicesPrivate.h; sourceTree = "<group>"; };
</del><span class="cx">                 15739BB81B42012200D258C1 /* JSMediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaDevices.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 15739BB91B42012200D258C1 /* JSMediaDevices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaDevices.h; sourceTree = "<group>"; };
</span><span class="cx">                 157CC2611B7C1CA400D8D075 /* JSMediaDeviceInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaDeviceInfo.cpp; sourceTree = "<group>"; };
</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 "config.h"
-#include "MediaDevicesPrivate.h"
-
-#if ENABLE(MEDIA_STREAM)
-
-namespace WebCore {
-
-Ref<MediaDevicesPrivate> MediaDevicesPrivate::create()
-{
- return adoptRef(*new MediaDevicesPrivate);
-}
-
-MediaDevicesPrivate::MediaDevicesPrivate()
- : m_capturedDevices()
-{
-}
-
-void MediaDevicesPrivate::didCompleteRequest(const Vector<RefPtr<TrackSourceInfo>>& capturedDevices)
-{
- m_capturedDevices = capturedDevices;
-}
-
-Vector<RefPtr<MediaDeviceInfo>> MediaDevicesPrivate::availableMediaDevices(ScriptExecutionContext& context)
-{
- Vector<RefPtr<MediaDeviceInfo>> mediaDevicesInfo;
- for (auto device : m_capturedDevices) {
- TrackSourceInfo* trackInfo = device.get();
- String deviceType = trackInfo->kind() == TrackSourceInfo::SourceKind::Audio ? MediaDeviceInfo::audioInputType() : MediaDeviceInfo::videoInputType();
- mediaDevicesInfo.append(MediaDeviceInfo::create(&context, trackInfo->label(), trackInfo->deviceId(), trackInfo->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 "MediaDeviceInfo.h"
-#include "MediaStreamTrackSourcesRequestClient.h"
-
-#include <wtf/Forward.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class MediaDevicesPrivate : public MediaStreamTrackSourcesRequestClient {
-public:
- static Ref<MediaDevicesPrivate> create();
-
- MediaDevicesPrivate();
-
- ~MediaDevicesPrivate() { }
-
- Vector<RefPtr<MediaDeviceInfo>> availableMediaDevices(ScriptExecutionContext&);
-
- // FIXME(148041): requestOrigin inside of getMediaStreamTrackSources not used
- const String& requestOrigin() const override { return emptyString(); }
-
- void didCompleteRequest(const Vector<RefPtr<TrackSourceInfo>>&) override;
-
- Vector<RefPtr<TrackSourceInfo>> capturedDevices() const { return m_capturedDevices; }
-
-private:
- Vector<RefPtr<TrackSourceInfo>> 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 "MediaDevices.h"
</ins><span class="cx"> #include "RealtimeMediaSource.h"
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</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<RefPtr<TrackSourceInfo>> TrackSourceInfoVector;
+
</ins><span class="cx"> class MediaStreamTrackSourcesRequestClient : public RefCounted<MediaStreamTrackSourcesRequestClient> {
</span><span class="cx"> public:
</span><span class="cx"> virtual ~MediaStreamTrackSourcesRequestClient() { }
</span><span class="cx">
</span><span class="cx"> virtual const String& requestOrigin() const = 0;
</span><del>- virtual void didCompleteRequest(const Vector<RefPtr<TrackSourceInfo>>&) = 0;
</del><ins>+ virtual void didCompleteRequest(const TrackSourceInfoVector&) = 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& singleton();
</span><span class="cx"> static bool isAvailable();
</span><span class="cx">
</span><del>- Vector<RefPtr<TrackSourceInfo>> getSourcesInfo(const String&);
- bool verifyConstraintsForMediaType(RealtimeMediaSource::Type, MediaConstraints*, String&);
</del><ins>+ TrackSourceInfoVector getSourcesInfo(const String&);
+ bool verifyConstraintsForMediaType(AVCaptureSession *, RealtimeMediaSource::Type, MediaConstraints*, String&);
</ins><span class="cx"> Vector<RefPtr<RealtimeMediaSource>> bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type, PassRefPtr<MediaConstraints>);
</span><span class="cx"> RefPtr<RealtimeMediaSource> sourceWithUID(const String&, 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& invalidConstraint)
</del><ins>+bool AVCaptureDeviceManager::verifyConstraintsForMediaType(AVCaptureSessionType *session, RealtimeMediaSource::Type type, MediaConstraints* constraints, String& 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->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<AVCaptureSessionType> session = adoptNS([allocAVCaptureSessionInstance() init]);
</del><ins>+ RetainPtr<AVCaptureSessionType> captureSession = session ? session : adoptNS([allocAVCaptureSessionInstance() init]);
</ins><span class="cx"> for (size_t i = 0; i < mandatoryConstraints.size(); ++i) {
</span><span class="cx"> const MediaConstraint& 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 && captureDevice.m_videoAVMediaCaptureSource)
+ captureDevice.m_videoAVMediaCaptureSource->session();
+ else if (type == RealtimeMediaSource::Audio && captureDevice.m_audioAVMediaCaptureSource)
+ captureDevice.m_audioAVMediaCaptureSource->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 && !captureDevice.m_audioSourceId.isEmpty()) {
</del><ins>+ if (type == RealtimeMediaSource::Audio && !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 && !captureDevice.m_videoSourceId.isEmpty()) {
</del><ins>+ if (type == RealtimeMediaSource::Video && !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->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->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->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->failedToCreateStreamWithConstraintsError(invalidConstraint);
</span><span class="cx"> return;
</span><span class="lines">@@ -130,9 +130,12 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<MediaStreamTrackSourcesRequestClient> requestClient = prpClient;
</span><span class="cx">
</span><del>- Vector<RefPtr<TrackSourceInfo>> sources = AVCaptureDeviceManager::singleton().getSourcesInfo(requestClient->requestOrigin());
</del><ins>+ TrackSourceInfoVector sources = AVCaptureDeviceManager::singleton().getSourcesInfo(requestClient->requestOrigin());
</ins><span class="cx">
</span><del>- requestClient->didCompleteRequest(sources);
</del><ins>+ callOnMainThread([this, requestClient, sources] {
+ requestClient->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<MediaStreamTrackSourcesRequestClient> prpClient)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<MediaStreamTrackSourcesRequestClient> requestClient = prpClient;
</span><del>- Vector<RefPtr<TrackSourceInfo>> sources;
</del><ins>+ TrackSourceInfoVector sources;
</ins><span class="cx">
</span><span class="cx"> MockSourceMap& map = mockSourceMap();
</span><span class="cx"> MockSourceMap::iterator end = map.end();
</span></span></pre>
</div>
</div>
</body>
</html>