Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: Source/modules/mediastream/NavigatorUserMedia.cpp

Issue 1184743002: Implement enumerateDevices() according to spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix expected output of global interface listing test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "modules/mediastream/NavigatorUserMedia.h"
7
8 #include "core/frame/Navigator.h"
9 #include "modules/mediastream/MediaDevices.h"
10 #include "platform/Logging.h"
11
12 namespace blink {
13
14 NavigatorUserMedia::NavigatorUserMedia()
15 : m_mediaDevices(MediaDevices::create())
16 {
17 }
18
19 const char* NavigatorUserMedia::supplementName()
20 {
21 return "NavigatorUserMedia";
22 }
23
24 NavigatorUserMedia& NavigatorUserMedia::from(Navigator& navigator)
25 {
26 NavigatorUserMedia* supplement = static_cast<NavigatorUserMedia*>(HeapSupple ment<Navigator>::from(navigator, supplementName()));
27 if (!supplement) {
28 supplement = new NavigatorUserMedia();
29 provideTo(navigator, supplementName(), supplement);
30 }
31 return *supplement;
32 }
33
34 MediaDevices* NavigatorUserMedia::getMediaDevices()
35 {
36 return m_mediaDevices;
37 }
38
39 MediaDevices* NavigatorUserMedia::mediaDevices(Navigator& navigator)
40 {
41 return NavigatorUserMedia::from(navigator).getMediaDevices();
42 }
43
44 DEFINE_TRACE(NavigatorUserMedia)
45 {
46 visitor->trace(m_mediaDevices);
47 HeapSupplement<Navigator>::trace(visitor);
48 }
49
50 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698