Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 "core/frame/Navigator.h" | |
| 12 #include "modules/encryptedmedia/MediaKeySystemOptions.h" | |
| 13 #include "platform/Supplementable.h" | |
| 14 #include "platform/heap/Handle.h" | |
| 15 | |
| 16 namespace blink { | |
| 17 | |
| 18 class NavigatorRequestMediaKeySystemAccess : public NoBaseWillBeGarbageCollected <NavigatorRequestMediaKeySystemAccess>, public WillBeHeapSupplement<Navigator> { | |
| 19 public: | |
| 20 virtual ~NavigatorRequestMediaKeySystemAccess(); | |
| 21 | |
| 22 static NavigatorRequestMediaKeySystemAccess& from(Navigator&); | |
| 23 | |
| 24 static ScriptPromise requestMediaKeySystemAccess( | |
| 25 ScriptState*, | |
| 26 Navigator&, | |
| 27 const String& keySystem); | |
| 28 static ScriptPromise requestMediaKeySystemAccess( | |
| 29 ScriptState*, | |
| 30 Navigator&, | |
| 31 const String& keySystem, | |
| 32 const Vector<MediaKeySystemOptions>& supportedConfigurations); | |
| 33 | |
| 34 ScriptPromise requestMediaKeySystemAccess( | |
| 35 ScriptState*, | |
| 36 const String& keySystem, | |
| 37 const Vector<MediaKeySystemOptions>& supportedConfigurations); | |
| 38 | |
| 39 virtual void trace(Visitor*) override; | |
| 40 | |
| 41 private: | |
| 42 NavigatorRequestMediaKeySystemAccess(); | |
| 43 static const char* supplementName(); | |
| 44 }; | |
| 45 | |
| 46 // This is needed to convert a JavaScript object into a MediaKeySystemOptions | |
|
ddorwin
2014/10/23 18:02:31
nit: How about this?
... needed by the generated c
jrummell
2014/10/23 22:13:16
Done.
| |
| 47 // object by the generated code for Navigator (when creating | |
| 48 // Vector<MediaKeySystemOptions>). Since MediaKeySystemOptions is also | |
| 49 // generated code, this is defined here so that it will be included by the | |
| 50 // generated code. | |
| 51 // | |
| 52 // This needs to change if MediaKeySystemOptions.idl changes. | |
| 53 | |
| 54 MediaKeySystemOptions ConvertDictionaryIntoMediaKeySystemOptions(Dictionary&, Ex ceptionState&); | |
| 55 | |
| 56 template <> | |
| 57 struct NativeValueTraits<MediaKeySystemOptions> { | |
| 58 static inline MediaKeySystemOptions nativeValue(const v8::Handle<v8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState) | |
| 59 { | |
| 60 Dictionary dictionary(value, isolate); | |
| 61 return ConvertDictionaryIntoMediaKeySystemOptions(dictionary, exceptionS tate); | |
| 62 } | |
| 63 }; | |
| 64 | |
| 65 } // namespace blink | |
| 66 | |
| 67 #endif // NavigatorRequestMediaKeySystemAccess_h | |
| OLD | NEW |