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/MediaKeySystemAccess.h" | 6 #include "modules/encryptedmedia/MediaKeySystemAccess.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 18 matching lines...) Expand all Loading... |
29 private: | 29 private: |
30 MediaKeysInitializer(blink::ScriptState*, const String& keySystem); | 30 MediaKeysInitializer(blink::ScriptState*, const String& keySystem); |
31 void timerFired(blink::Timer<MediaKeysInitializer>*); | 31 void timerFired(blink::Timer<MediaKeysInitializer>*); |
32 | 32 |
33 const String m_keySystem; | 33 const String m_keySystem; |
34 blink::Timer<MediaKeysInitializer> m_timer; | 34 blink::Timer<MediaKeysInitializer> m_timer; |
35 }; | 35 }; |
36 | 36 |
37 blink::ScriptPromise MediaKeysInitializer::create(blink::ScriptState* scriptStat
e, const String& keySystem) | 37 blink::ScriptPromise MediaKeysInitializer::create(blink::ScriptState* scriptStat
e, const String& keySystem) |
38 { | 38 { |
39 RefPtr<MediaKeysInitializer> initializer = adoptRef(new MediaKeysInitializer
(scriptState, keySystem)); | 39 RefPtrWillBeRawPtr<MediaKeysInitializer> initializer = adoptRefWillBeNoop(ne
w MediaKeysInitializer(scriptState, keySystem)); |
40 initializer->suspendIfNeeded(); | 40 initializer->suspendIfNeeded(); |
41 initializer->keepAliveWhilePending(); | 41 initializer->keepAliveWhilePending(); |
42 return initializer->promise(); | 42 return initializer->promise(); |
43 } | 43 } |
44 | 44 |
45 MediaKeysInitializer::MediaKeysInitializer(blink::ScriptState* scriptState, cons
t String& keySystem) | 45 MediaKeysInitializer::MediaKeysInitializer(blink::ScriptState* scriptState, cons
t String& keySystem) |
46 : blink::ScriptPromiseResolver(scriptState) | 46 : blink::ScriptPromiseResolver(scriptState) |
47 , m_keySystem(keySystem) | 47 , m_keySystem(keySystem) |
48 , m_timer(this, &MediaKeysInitializer::timerFired) | 48 , m_timer(this, &MediaKeysInitializer::timerFired) |
49 { | 49 { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // 2. Asynchronously create and initialize the MediaKeys object. | 112 // 2. Asynchronously create and initialize the MediaKeys object. |
113 // 3. Return promise. | 113 // 3. Return promise. |
114 return MediaKeysInitializer::create(scriptState, m_keySystem); | 114 return MediaKeysInitializer::create(scriptState, m_keySystem); |
115 } | 115 } |
116 | 116 |
117 void MediaKeySystemAccess::trace(Visitor*) | 117 void MediaKeySystemAccess::trace(Visitor*) |
118 { | 118 { |
119 } | 119 } |
120 | 120 |
121 } // namespace blink | 121 } // namespace blink |
OLD | NEW |