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

Side by Side Diff: third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp

Issue 2622533002: Prefer ContextClient mixin over manual ExecutionContext handling. (Closed)
Patch Set: Created 3 years, 11 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "modules/mediasource/SourceBufferList.h" 31 #include "modules/mediasource/SourceBufferList.h"
32 32
33 #include "core/dom/ExecutionContext.h"
34 #include "core/events/GenericEventQueue.h" 33 #include "core/events/GenericEventQueue.h"
35 #include "modules/EventModules.h" 34 #include "modules/EventModules.h"
36 #include "modules/mediasource/SourceBuffer.h" 35 #include "modules/mediasource/SourceBuffer.h"
37 36
38 namespace blink { 37 namespace blink {
39 38
40 SourceBufferList::SourceBufferList(ExecutionContext* context, 39 SourceBufferList::SourceBufferList(ExecutionContext* context,
41 GenericEventQueue* asyncEventQueue) 40 GenericEventQueue* asyncEventQueue)
42 : m_executionContext(context), m_asyncEventQueue(asyncEventQueue) {} 41 : ContextClient(context), m_asyncEventQueue(asyncEventQueue) {}
43 42
44 SourceBufferList::~SourceBufferList() {} 43 SourceBufferList::~SourceBufferList() {}
45 44
46 void SourceBufferList::add(SourceBuffer* buffer) { 45 void SourceBufferList::add(SourceBuffer* buffer) {
47 m_list.push_back(buffer); 46 m_list.push_back(buffer);
48 scheduleEvent(EventTypeNames::addsourcebuffer); 47 scheduleEvent(EventTypeNames::addsourcebuffer);
49 } 48 }
50 49
51 void SourceBufferList::insert(size_t position, SourceBuffer* buffer) { 50 void SourceBufferList::insert(size_t position, SourceBuffer* buffer) {
52 m_list.insert(position, buffer); 51 m_list.insert(position, buffer);
(...skipping 19 matching lines...) Expand all
72 Event* event = Event::create(eventName); 71 Event* event = Event::create(eventName);
73 event->setTarget(this); 72 event->setTarget(this);
74 73
75 m_asyncEventQueue->enqueueEvent(event); 74 m_asyncEventQueue->enqueueEvent(event);
76 } 75 }
77 76
78 const AtomicString& SourceBufferList::interfaceName() const { 77 const AtomicString& SourceBufferList::interfaceName() const {
79 return EventTargetNames::SourceBufferList; 78 return EventTargetNames::SourceBufferList;
80 } 79 }
81 80
82 ExecutionContext* SourceBufferList::getExecutionContext() const {
83 return m_executionContext;
84 }
85
86 DEFINE_TRACE(SourceBufferList) { 81 DEFINE_TRACE(SourceBufferList) {
87 visitor->trace(m_executionContext);
88 visitor->trace(m_asyncEventQueue); 82 visitor->trace(m_asyncEventQueue);
89 visitor->trace(m_list); 83 visitor->trace(m_list);
90 EventTargetWithInlineData::trace(visitor); 84 EventTargetWithInlineData::trace(visitor);
85 ContextClient::trace(visitor);
91 } 86 }
92 87
93 } // namespace blink 88 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698