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

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

<h3>Log Message</h3>
<pre>Implementing platform-specific section of enumerateDevices
https://bugs.webkit.org/show_bug.cgi?id=146461
&lt;rdar://problem/21614466&gt;

Patch by Matthew Daiter &lt;mdaiter@apple.com&gt; on 2015-07-09
Reviewed by Darin Adler.

* Modules/mediastream/MediaDeviceInfo.cpp: Changed access methods
(WebCore::MediaDeviceInfo::audioInputType): Added AtomicString
permanent refs
(WebCore::MediaDeviceInfo::audioOutputType): Ditto
(WebCore::MediaDeviceInfo::videoInputType): Ditto
* Modules/mediastream/MediaDeviceInfo.h: Changed String refs to values
(WebCore::MediaDeviceInfo::label): Ditto
(WebCore::MediaDeviceInfo::deviceId): Ditto
(WebCore::MediaDeviceInfo::groupId): Ditto
(WebCore::MediaDeviceInfo::kind): Ditto
* platform/mediastream/MediaDevicesPrivate.cpp: Implemented query for
available devices
(WebCore::MediaDevicesPrivate::MediaDevicesPrivate):
(WebCore::MediaDevicesPrivate::create):
(WebCore::MediaDevicesPrivate::availableMediaDevices):
* platform/mediastream/MediaDevicesPrivate.h:
(WebCore::MediaDevicesPrivate::~MediaDevicesPrivate):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/MediaStreamTrackSourcesRequestClient.h: Needed
to tack on extra fields to hold data
(WebCore::TrackSourceInfo::create):
(WebCore::TrackSourceInfo::groupId):
(WebCore::TrackSourceInfo::deviceId):
(WebCore::TrackSourceInfo::TrackSourceInfo):
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::getSourcesInfo):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDeviceInfocpp">trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDeviceInfoh">trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaStreamTrackSourcesRequestClienth">trunk/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacAVCaptureDeviceManagermm">trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm</a></li>
</ul>

<h3>Added 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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (186607 => 186608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-09 20:37:49 UTC (rev 186607)
+++ trunk/Source/WebCore/ChangeLog        2015-07-09 20:47:15 UTC (rev 186608)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2015-07-09  Matthew Daiter  &lt;mdaiter@apple.com&gt;
+
+        Implementing platform-specific section of enumerateDevices
+        https://bugs.webkit.org/show_bug.cgi?id=146461
+        &lt;rdar://problem/21614466&gt;
+
+        Reviewed by Darin Adler.
+
+        * Modules/mediastream/MediaDeviceInfo.cpp: Changed access methods
+        (WebCore::MediaDeviceInfo::audioInputType): Added AtomicString
+        permanent refs
+        (WebCore::MediaDeviceInfo::audioOutputType): Ditto
+        (WebCore::MediaDeviceInfo::videoInputType): Ditto
+        * Modules/mediastream/MediaDeviceInfo.h: Changed String refs to values
+        (WebCore::MediaDeviceInfo::label): Ditto
+        (WebCore::MediaDeviceInfo::deviceId): Ditto
+        (WebCore::MediaDeviceInfo::groupId): Ditto
+        (WebCore::MediaDeviceInfo::kind): Ditto
+        * platform/mediastream/MediaDevicesPrivate.cpp: Implemented query for
+        available devices
+        (WebCore::MediaDevicesPrivate::MediaDevicesPrivate):
+        (WebCore::MediaDevicesPrivate::create):
+        (WebCore::MediaDevicesPrivate::availableMediaDevices):
+        * platform/mediastream/MediaDevicesPrivate.h:
+        (WebCore::MediaDevicesPrivate::~MediaDevicesPrivate):
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/mediastream/MediaStreamTrackSourcesRequestClient.h: Needed
+        to tack on extra fields to hold data
+        (WebCore::TrackSourceInfo::create):
+        (WebCore::TrackSourceInfo::groupId):
+        (WebCore::TrackSourceInfo::deviceId):
+        (WebCore::TrackSourceInfo::TrackSourceInfo):
+        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
+        (WebCore::AVCaptureDeviceManager::getSourcesInfo):
+
</ins><span class="cx"> 2015-07-09  Per Arne Vollan  &lt;peavo@outlook.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Add memory pressure handler.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDeviceInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp (186607 => 186608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp        2015-07-09 20:37:49 UTC (rev 186607)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp        2015-07-09 20:47:15 UTC (rev 186608)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ContextDestructionObserver.h&quot;
</span><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -47,6 +48,24 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const AtomicString&amp; MediaDeviceInfo::audioInputType()
+{
+    static NeverDestroyed&lt;AtomicString&gt; audioinput(&quot;audioinput&quot;);
+    return audioinput;
+}
+
+const AtomicString&amp; MediaDeviceInfo::audioOutputType()
+{
+    static NeverDestroyed&lt;AtomicString&gt; audiooutput(&quot;audiooutput&quot;);
+    return audiooutput;
+}
+
+const AtomicString&amp; MediaDeviceInfo::videoInputType()
+{
+    static NeverDestroyed&lt;AtomicString&gt; videoinput(&quot;videoinput&quot;);
+    return videoinput;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDeviceInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h (186607 => 186608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h        2015-07-09 20:37:49 UTC (rev 186607)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h        2015-07-09 20:47:15 UTC (rev 186608)
</span><span class="lines">@@ -42,18 +42,22 @@
</span><span class="cx">     
</span><span class="cx">     virtual ~MediaDeviceInfo() { }
</span><span class="cx">     
</span><del>-    const String&amp; label() const {return m_label; }
-    const String&amp; deviceId() const {return m_deviceId; }
-    const String&amp; groupId() const {return m_groupId; }
-    const String&amp; kind() const {return m_kind; }
-    
</del><ins>+    const String&amp; label() const { return m_label; }
+    const String&amp; deviceId() const { return m_deviceId; }
+    const String&amp; groupId() const { return m_groupId; }
+    const String&amp; kind() const { return m_kind; }
+
+    static const AtomicString&amp; audioInputType();
+    static const AtomicString&amp; audioOutputType();
+    static const AtomicString&amp; videoInputType();
+
</ins><span class="cx"> private:
</span><span class="cx">     MediaDeviceInfo(ScriptExecutionContext*, const String&amp;, const String&amp;, const String&amp;, const String&amp;);
</span><span class="cx"> 
</span><del>-    const String&amp; m_label;
-    const String&amp; m_deviceId;
-    const String&amp; m_groupId;
-    const String&amp; m_kind;
</del><ins>+    const String m_label;
+    const String m_deviceId;
+    const String m_groupId;
+    const String m_kind;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (186607 => 186608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-07-09 20:37:49 UTC (rev 186607)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-07-09 20:47:15 UTC (rev 186608)
</span><span class="lines">@@ -636,6 +636,8 @@
</span><span class="cx">                 14FFE31D0AE1963300136BF5 /* HTMLFrameElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 14FFE31B0AE1963300136BF5 /* HTMLFrameElementBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 14FFE31E0AE1963300136BF5 /* HTMLFrameElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14FFE31C0AE1963300136BF5 /* HTMLFrameElementBase.cpp */; };
</span><span class="cx">                 15145B901B3A1CE000662BF7 /* MediaDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15145B8F1B3A1B3E00662BF7 /* MediaDeviceInfo.h */; };
</span><ins>+                152A29B41B4EF5B700B52AE0 /* MediaDevicesPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 152A29B21B4EF59600B52AE0 /* MediaDevicesPrivate.cpp */; };
+                152A29B51B4EF5BA00B52AE0 /* MediaDevicesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 152A29B31B4EF59600B52AE0 /* MediaDevicesPrivate.h */; };
</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">                 159AE82B1B3A402F0037478B /* MediaDeviceInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 159AE82A1B3A402F0037478B /* MediaDeviceInfo.cpp */; };
</span><span class="lines">@@ -7751,6 +7753,8 @@
</span><span class="cx">                 14FFE31C0AE1963300136BF5 /* HTMLFrameElementBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFrameElementBase.cpp; 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><ins>+                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;; };
</ins><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">                 159AE82A1B3A402F0037478B /* MediaDeviceInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDeviceInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14807,6 +14811,8 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 0729B14D17CFCCA0004F1D60 /* mac */,
</span><span class="cx">                                 07221B9917CF0AD400848E51 /* MediaConstraints.h */,
</span><ins>+                                152A29B21B4EF59600B52AE0 /* MediaDevicesPrivate.cpp */,
+                                152A29B31B4EF59600B52AE0 /* MediaDevicesPrivate.h */,
</ins><span class="cx">                                 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */,
</span><span class="cx">                                 07221BA017CF0AD400848E51 /* MediaStreamCreationClient.h */,
</span><span class="cx">                                 0711588F17DF633700EDFE2B /* MediaStreamPrivate.cpp */,
</span><span class="lines">@@ -24202,6 +24208,7 @@
</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><ins>+                                152A29B51B4EF5BA00B52AE0 /* MediaDevicesPrivate.h in Headers */,
</ins><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">@@ -29167,6 +29174,7 @@
</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><ins>+                                152A29B41B4EF5B700B52AE0 /* MediaDevicesPrivate.cpp in Sources */,
</ins><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="trunkSourceWebCoreplatformmediastreamMediaDevicesPrivatecppfromrev186607trunkSourceWebCoreModulesmediastreamMediaDeviceInfocpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp (from rev 186607, trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp) (0 => 186608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp        2015-07-09 20:47:15 UTC (rev 186608)
</span><span class="lines">@@ -0,0 +1,57 @@
</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;MediaDevicesPrivate.h&quot;
+
+#if ENABLE(MEDIA_STREAM)
+
+#include &quot;AVCaptureDeviceManager.h&quot;
+#include &quot;AVMediaCaptureSource.h&quot;
+#include &quot;MediaStreamTrackSourcesRequestClient.h&quot;
+
+namespace WebCore {
+
+MediaDevicesPrivate::MediaDevicesPrivate()
+{
+}
+
+Vector&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; MediaDevicesPrivate::availableMediaDevices(ScriptExecutionContext&amp; context)
+{
+    Vector&lt;RefPtr&lt;TrackSourceInfo&gt;&gt; capturedDevices = AVCaptureDeviceManager::singleton().getSourcesInfo(&quot;&quot;);
+    Vector&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; mediaDevicesInfo;
+    for (auto device : 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
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaDevicesPrivatehfromrev186607trunkSourceWebCoreModulesmediastreamMediaDeviceInfocpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.h (from rev 186607, trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp) (0 => 186608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/MediaDevicesPrivate.h        2015-07-09 20:47:15 UTC (rev 186608)
</span><span class="lines">@@ -0,0 +1,54 @@
</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 MediaDevicesPrivate_h
+#define MediaDevicesPrivate_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include &quot;AVCaptureDeviceManager.h&quot;
+#include &quot;MediaDeviceInfo.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 std::unique_ptr&lt;MediaDevicesPrivate&gt; {
+public:
+    MediaDevicesPrivate();
+
+    virtual ~MediaDevicesPrivate() { }
+
+    virtual Vector&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; availableMediaDevices(ScriptExecutionContext&amp;);
+};
+
+}
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // MediaDevicesPrivate_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaStreamTrackSourcesRequestClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h (186607 => 186608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h        2015-07-09 20:37:49 UTC (rev 186607)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h        2015-07-09 20:47:15 UTC (rev 186608)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><ins>+#include &lt;wtf/Ref.h&gt;
</ins><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -43,8 +44,15 @@
</span><span class="cx">         return adoptRef(new TrackSourceInfo(id, kind, label));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static Ref&lt;TrackSourceInfo&gt; create(const AtomicString&amp; id, SourceKind kind, const AtomicString&amp; label, const AtomicString&amp; groupId, const AtomicString&amp; deviceId)
+    {
+        return adoptRef(*new TrackSourceInfo(id, kind, label, groupId, deviceId));
+    }
+
</ins><span class="cx">     const AtomicString&amp; id() const { return m_id; }
</span><span class="cx">     const AtomicString&amp; label() const { return m_label; }
</span><ins>+    const AtomicString&amp; groupId() const { return m_groupId; }
+    const AtomicString&amp; deviceId() const { return m_deviceId; }
</ins><span class="cx">     SourceKind kind() const { return m_kind; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -54,10 +62,21 @@
</span><span class="cx">         , m_label(label)
</span><span class="cx">     {
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+    TrackSourceInfo(const AtomicString&amp; id, SourceKind kind, const AtomicString&amp; label, const AtomicString&amp; groupId, const AtomicString&amp; deviceId)
+        : m_id(id)
+        , m_kind(kind)
+        , m_label(label)
+        , m_groupId(groupId)
+        , m_deviceId(deviceId)
+    {
+    }
+
</ins><span class="cx">     AtomicString m_id;
</span><span class="cx">     SourceKind m_kind;
</span><span class="cx">     AtomicString m_label;
</span><ins>+    AtomicString m_groupId;
+    AtomicString m_deviceId;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class MediaStreamTrackSourcesRequestClient : public RefCounted&lt;MediaStreamTrackSourcesRequestClient&gt; {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacAVCaptureDeviceManagermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm (186607 => 186608)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm        2015-07-09 20:37:49 UTC (rev 186607)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm        2015-07-09 20:47:15 UTC (rev 186608)
</span><span class="lines">@@ -329,11 +329,11 @@
</span><span class="cx"> 
</span><span class="cx">         if (!devices[i].m_enabled)
</span><span class="cx">             continue;
</span><del>-
</del><ins>+        // FIXME: Change groupID from localizedName to something more meaningful
</ins><span class="cx">         if (devices[i].m_videoSource)
</span><del>-            sourcesInfo.append(TrackSourceInfo::create(devices[i].m_videoSourceId, TrackSourceInfo::Video, device.localizedName));
</del><ins>+            sourcesInfo.append(TrackSourceInfo::create(devices[i].m_videoSourceId, TrackSourceInfo::Video, device.localizedName, device.localizedName, devices[i].m_captureDeviceID));
</ins><span class="cx">         if (devices[i].m_audioSource)
</span><del>-            sourcesInfo.append(TrackSourceInfo::create(devices[i].m_audioSourceId, TrackSourceInfo::Audio, device.localizedName));
</del><ins>+            sourcesInfo.append(TrackSourceInfo::create(devices[i].m_audioSourceId, TrackSourceInfo::Audio, device.localizedName, device.localizedName, devices[i].m_captureDeviceID));
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     LOG(Media, &quot;AVCaptureDeviceManager::getSourcesInfo(%p), found %d active devices&quot;, this, sourcesInfo.size());
</span></span></pre>
</div>
</div>

</body>
</html>