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

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

Issue 1233173002: Have ScriptPromiseResolver on the Oilpan heap always. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix webusb ScriptPromiseResolver usage Created 5 years, 4 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
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 // EncryptedMediaRequest implementation. 90 // EncryptedMediaRequest implementation.
91 WebString keySystem() const override { return m_keySystem; } 91 WebString keySystem() const override { return m_keySystem; }
92 const WebVector<WebMediaKeySystemConfiguration>& supportedConfigurations() c onst override { return m_supportedConfigurations; } 92 const WebVector<WebMediaKeySystemConfiguration>& supportedConfigurations() c onst override { return m_supportedConfigurations; }
93 SecurityOrigin* securityOrigin() const override { return m_resolver->executi onContext()->securityOrigin(); } 93 SecurityOrigin* securityOrigin() const override { return m_resolver->executi onContext()->securityOrigin(); }
94 void requestSucceeded(WebContentDecryptionModuleAccess*) override; 94 void requestSucceeded(WebContentDecryptionModuleAccess*) override;
95 void requestNotSupported(const WebString& errorMessage) override; 95 void requestNotSupported(const WebString& errorMessage) override;
96 96
97 ScriptPromise promise() { return m_resolver->promise(); } 97 ScriptPromise promise() { return m_resolver->promise(); }
98 98
99 DEFINE_INLINE_VIRTUAL_TRACE()
100 {
101 visitor->trace(m_resolver);
102 EncryptedMediaRequest::trace(visitor);
103 }
104
99 private: 105 private:
100 RefPtr<ScriptPromiseResolver> m_resolver; 106 Member<ScriptPromiseResolver> m_resolver;
101 const String m_keySystem; 107 const String m_keySystem;
102 WebVector<WebMediaKeySystemConfiguration> m_supportedConfigurations; 108 WebVector<WebMediaKeySystemConfiguration> m_supportedConfigurations;
103 }; 109 };
104 110
105 MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(ScriptState* sc riptState, const String& keySystem, const HeapVector<MediaKeySystemConfiguration >& supportedConfigurations) 111 MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(ScriptState* sc riptState, const String& keySystem, const HeapVector<MediaKeySystemConfiguration >& supportedConfigurations)
106 : m_resolver(ScriptPromiseResolver::create(scriptState)) 112 : m_resolver(ScriptPromiseResolver::create(scriptState))
107 , m_keySystem(keySystem) 113 , m_keySystem(keySystem)
108 , m_supportedConfigurations(supportedConfigurations.size()) 114 , m_supportedConfigurations(supportedConfigurations.size())
109 { 115 {
110 for (size_t i = 0; i < supportedConfigurations.size(); ++i) { 116 for (size_t i = 0; i < supportedConfigurations.size(); ++i) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // initialize the MediaKeySystemAccess object. 210 // initialize the MediaKeySystemAccess object.
205 MediaKeysController* controller = MediaKeysController::from(document->page() ); 211 MediaKeysController* controller = MediaKeysController::from(document->page() );
206 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec utionContext); 212 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec utionContext);
207 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize r)); 213 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize r));
208 214
209 // 8. Return promise. 215 // 8. Return promise.
210 return promise; 216 return promise;
211 } 217 }
212 218
213 } // namespace blink 219 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp ('k') | Source/modules/fetch/Body.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698