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

Side by Side Diff: Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h

Issue 665213002: Implement navigator.requestMediaKeySystemAccess() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add comment Created 6 years, 1 month 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 2014 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 #ifndef NavigatorRequestMediaKeySystemAccess_h
6 #define NavigatorRequestMediaKeySystemAccess_h
7
8 #include "bindings/core/v8/Dictionary.h"
9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/V8Binding.h"
11 #include "bindings/modules/v8/V8MediaKeySystemOptions.h"
12 #include "core/frame/Navigator.h"
13 #include "modules/encryptedmedia/MediaKeySystemOptions.h"
14 #include "platform/Supplementable.h"
15 #include "platform/heap/Handle.h"
16
17 namespace blink {
18
19 class NavigatorRequestMediaKeySystemAccess final : public NoBaseWillBeGarbageCol lected<NavigatorRequestMediaKeySystemAccess>, public WillBeHeapSupplement<Naviga tor> {
20 public:
21 virtual ~NavigatorRequestMediaKeySystemAccess();
22
23 static NavigatorRequestMediaKeySystemAccess& from(Navigator&);
24
25 static ScriptPromise requestMediaKeySystemAccess(
26 ScriptState*,
27 Navigator&,
28 const String& keySystem);
29 static ScriptPromise requestMediaKeySystemAccess(
30 ScriptState*,
31 Navigator&,
32 const String& keySystem,
33 const Vector<MediaKeySystemOptions>& supportedConfigurations);
34
35 ScriptPromise requestMediaKeySystemAccess(
36 ScriptState*,
37 const String& keySystem,
38 const Vector<MediaKeySystemOptions>& supportedConfigurations);
39
40 virtual void trace(Visitor*) override;
41
42 private:
43 NavigatorRequestMediaKeySystemAccess();
44 static const char* supplementName();
45 };
46
47 // This is needed by the generated code for Navigator to convert a JavaScript
48 // object into a MediaKeySystemOptions object.
49 template <>
50 struct NativeValueTraits<MediaKeySystemOptions> {
51 static inline MediaKeySystemOptions nativeValue(const v8::Handle<v8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState)
52 {
53 MediaKeySystemOptions impl;
54 V8MediaKeySystemOptions::toImpl(isolate, value, impl, exceptionState);
55 return impl;
56 }
57 };
58
59 } // namespace blink
60
61 #endif // NavigatorRequestMediaKeySystemAccess_h
OLDNEW
« no previous file with comments | « Source/modules/encryptedmedia/MediaKeys.idl ('k') | Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698