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

Side by Side Diff: third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More build fixes Created 4 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 "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h" 5 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 18 matching lines...) Expand all
29 class SetMediaKeysHandler : public ScriptPromiseResolver { 29 class SetMediaKeysHandler : public ScriptPromiseResolver {
30 WTF_MAKE_NONCOPYABLE(SetMediaKeysHandler); 30 WTF_MAKE_NONCOPYABLE(SetMediaKeysHandler);
31 public: 31 public:
32 static ScriptPromise create(ScriptState*, HTMLMediaElement&, MediaKeys*); 32 static ScriptPromise create(ScriptState*, HTMLMediaElement&, MediaKeys*);
33 ~SetMediaKeysHandler() override; 33 ~SetMediaKeysHandler() override;
34 34
35 DECLARE_VIRTUAL_TRACE(); 35 DECLARE_VIRTUAL_TRACE();
36 36
37 private: 37 private:
38 SetMediaKeysHandler(ScriptState*, HTMLMediaElement&, MediaKeys*); 38 SetMediaKeysHandler(ScriptState*, HTMLMediaElement&, MediaKeys*);
39 void timerFired(Timer<SetMediaKeysHandler>*); 39 void timerFired(TimerBase*);
40 40
41 void clearExistingMediaKeys(); 41 void clearExistingMediaKeys();
42 void setNewMediaKeys(); 42 void setNewMediaKeys();
43 43
44 void finish(); 44 void finish();
45 void fail(ExceptionCode, const String& errorMessage); 45 void fail(ExceptionCode, const String& errorMessage);
46 46
47 void clearFailed(ExceptionCode, const String& errorMessage); 47 void clearFailed(ExceptionCode, const String& errorMessage);
48 void setFailed(ExceptionCode, const String& errorMessage); 48 void setFailed(ExceptionCode, const String& errorMessage);
49 49
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 DVLOG(EME_LOG_LEVEL) << __func__; 121 DVLOG(EME_LOG_LEVEL) << __func__;
122 122
123 // 5. Run the following steps in parallel. 123 // 5. Run the following steps in parallel.
124 m_timer.startOneShot(0, BLINK_FROM_HERE); 124 m_timer.startOneShot(0, BLINK_FROM_HERE);
125 } 125 }
126 126
127 SetMediaKeysHandler::~SetMediaKeysHandler() 127 SetMediaKeysHandler::~SetMediaKeysHandler()
128 { 128 {
129 } 129 }
130 130
131 void SetMediaKeysHandler::timerFired(Timer<SetMediaKeysHandler>*) 131 void SetMediaKeysHandler::timerFired(TimerBase*)
132 { 132 {
133 clearExistingMediaKeys(); 133 clearExistingMediaKeys();
134 } 134 }
135 135
136 void SetMediaKeysHandler::clearExistingMediaKeys() 136 void SetMediaKeysHandler::clearExistingMediaKeys()
137 { 137 {
138 DVLOG(EME_LOG_LEVEL) << __func__; 138 DVLOG(EME_LOG_LEVEL) << __func__;
139 HTMLMediaElementEncryptedMedia& thisElement = HTMLMediaElementEncryptedMedia ::from(*m_element); 139 HTMLMediaElementEncryptedMedia& thisElement = HTMLMediaElementEncryptedMedia ::from(*m_element);
140 140
141 // 5.1 If mediaKeys is not null, the CDM instance represented by 141 // 5.1 If mediaKeys is not null, the CDM instance represented by
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 } 408 }
409 409
410 DEFINE_TRACE(HTMLMediaElementEncryptedMedia) 410 DEFINE_TRACE(HTMLMediaElementEncryptedMedia)
411 { 411 {
412 visitor->trace(m_mediaElement); 412 visitor->trace(m_mediaElement);
413 visitor->trace(m_mediaKeys); 413 visitor->trace(m_mediaKeys);
414 Supplement<HTMLMediaElement>::trace(visitor); 414 Supplement<HTMLMediaElement>::trace(visitor);
415 } 415 }
416 416
417 } // namespace blink 417 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698