| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h" | 6 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 // EncryptedMediaRequest implementation. | 89 // EncryptedMediaRequest implementation. |
| 90 WebString keySystem() const override { return m_keySystem; } | 90 WebString keySystem() const override { return m_keySystem; } |
| 91 const WebVector<WebMediaKeySystemConfiguration>& supportedConfigurations() c
onst override { return m_supportedConfigurations; } | 91 const WebVector<WebMediaKeySystemConfiguration>& supportedConfigurations() c
onst override { return m_supportedConfigurations; } |
| 92 SecurityOrigin* securityOrigin() const override { return m_resolver->executi
onContext()->securityOrigin(); } | 92 SecurityOrigin* securityOrigin() const override { return m_resolver->executi
onContext()->securityOrigin(); } |
| 93 void requestSucceeded(WebContentDecryptionModuleAccess*) override; | 93 void requestSucceeded(WebContentDecryptionModuleAccess*) override; |
| 94 void requestNotSupported(const WebString& errorMessage) override; | 94 void requestNotSupported(const WebString& errorMessage) override; |
| 95 | 95 |
| 96 ScriptPromise promise() { return m_resolver->promise(); } | 96 ScriptPromise promise() { return m_resolver->promise(); } |
| 97 | 97 |
| 98 DEFINE_INLINE_VIRTUAL_TRACE() |
| 99 { |
| 100 visitor->trace(m_resolver); |
| 101 EncryptedMediaRequest::trace(visitor); |
| 102 } |
| 103 |
| 98 private: | 104 private: |
| 99 RefPtr<ScriptPromiseResolver> m_resolver; | 105 Member<ScriptPromiseResolver> m_resolver; |
| 100 const String m_keySystem; | 106 const String m_keySystem; |
| 101 WebVector<WebMediaKeySystemConfiguration> m_supportedConfigurations; | 107 WebVector<WebMediaKeySystemConfiguration> m_supportedConfigurations; |
| 102 }; | 108 }; |
| 103 | 109 |
| 104 MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(ScriptState* sc
riptState, const String& keySystem, const HeapVector<MediaKeySystemConfiguration
>& supportedConfigurations) | 110 MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(ScriptState* sc
riptState, const String& keySystem, const HeapVector<MediaKeySystemConfiguration
>& supportedConfigurations) |
| 105 : m_resolver(ScriptPromiseResolver::create(scriptState)) | 111 : m_resolver(ScriptPromiseResolver::create(scriptState)) |
| 106 , m_keySystem(keySystem) | 112 , m_keySystem(keySystem) |
| 107 , m_supportedConfigurations(supportedConfigurations.size()) | 113 , m_supportedConfigurations(supportedConfigurations.size()) |
| 108 { | 114 { |
| 109 for (size_t i = 0; i < supportedConfigurations.size(); ++i) { | 115 for (size_t i = 0; i < supportedConfigurations.size(); ++i) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // initialize the MediaKeySystemAccess object. | 209 // initialize the MediaKeySystemAccess object. |
| 204 MediaKeysController* controller = MediaKeysController::from(document->page()
); | 210 MediaKeysController* controller = MediaKeysController::from(document->page()
); |
| 205 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec
utionContext); | 211 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec
utionContext); |
| 206 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize
r)); | 212 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize
r)); |
| 207 | 213 |
| 208 // 8. Return promise. | 214 // 8. Return promise. |
| 209 return promise; | 215 return promise; |
| 210 } | 216 } |
| 211 | 217 |
| 212 } // namespace blink | 218 } // namespace blink |
| OLD | NEW |