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

Side by Side Diff: Source/modules/mediastream/MediaDevices.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/MediaDevices.h"
7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "bindings/core/v8/ScriptState.h"
11 #include "core/dom/DOMException.h"
12 #include "core/dom/Document.h"
13 #include "core/dom/ExceptionCode.h"
14 #include "modules/mediastream/UserMediaController.h"
15
16 namespace blink {
17
18 ScriptPromise MediaDevices::enumerateDevices(ScriptState* scriptState)
19 {
20 Document* document = toDocument(scriptState->executionContext());
21 UserMediaController* userMedia = UserMediaController::from(document->frame() );
22 if (!userMedia)
23 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(NotSupportedError, "No media device controller available; is this a detac hed window?"));
24
25 MediaDevicesRequest* request = MediaDevicesRequest::create(scriptState, user Media);
26 return request->start();
27 }
28
29 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698