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

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

Issue 2567913002: Rename ActiveDOMObject to SuspendableObject (Closed)
Patch Set: Created 4 years 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 108
109 MediaSource* MediaSource::create(ExecutionContext* context) { 109 MediaSource* MediaSource::create(ExecutionContext* context) {
110 MediaSource* mediaSource = new MediaSource(context); 110 MediaSource* mediaSource = new MediaSource(context);
111 mediaSource->suspendIfNeeded(); 111 mediaSource->suspendIfNeeded();
112 return mediaSource; 112 return mediaSource;
113 } 113 }
114 114
115 MediaSource::MediaSource(ExecutionContext* context) 115 MediaSource::MediaSource(ExecutionContext* context)
116 : ActiveScriptWrappable(this), 116 : ActiveScriptWrappable(this),
117 ActiveDOMObject(context), 117 SuspendableObject(context),
118 m_readyState(closedKeyword()), 118 m_readyState(closedKeyword()),
119 m_asyncEventQueue(GenericEventQueue::create(this)), 119 m_asyncEventQueue(GenericEventQueue::create(this)),
120 m_attachedElement(nullptr), 120 m_attachedElement(nullptr),
121 m_sourceBuffers(SourceBufferList::create(getExecutionContext(), 121 m_sourceBuffers(SourceBufferList::create(getExecutionContext(),
122 m_asyncEventQueue.get())), 122 m_asyncEventQueue.get())),
123 m_activeSourceBuffers(SourceBufferList::create(getExecutionContext(), 123 m_activeSourceBuffers(SourceBufferList::create(getExecutionContext(),
124 m_asyncEventQueue.get())), 124 m_asyncEventQueue.get())),
125 m_liveSeekableRange(TimeRanges::create()), 125 m_liveSeekableRange(TimeRanges::create()),
126 m_addedToRegistryCounter(0) { 126 m_addedToRegistryCounter(0) {
127 BLINK_MSLOG << __func__ << " this=" << this; 127 BLINK_MSLOG << __func__ << " this=" << this;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 BLINK_MSLOG << __func__ << "(" << type << ") -> " 313 BLINK_MSLOG << __func__ << "(" << type << ") -> "
314 << (result ? "true" : "false"); 314 << (result ? "true" : "false");
315 return result; 315 return result;
316 } 316 }
317 317
318 const AtomicString& MediaSource::interfaceName() const { 318 const AtomicString& MediaSource::interfaceName() const {
319 return EventTargetNames::MediaSource; 319 return EventTargetNames::MediaSource;
320 } 320 }
321 321
322 ExecutionContext* MediaSource::getExecutionContext() const { 322 ExecutionContext* MediaSource::getExecutionContext() const {
323 return ActiveDOMObject::getExecutionContext(); 323 return SuspendableObject::getExecutionContext();
324 } 324 }
325 325
326 DEFINE_TRACE(MediaSource) { 326 DEFINE_TRACE(MediaSource) {
327 visitor->trace(m_asyncEventQueue); 327 visitor->trace(m_asyncEventQueue);
328 visitor->trace(m_attachedElement); 328 visitor->trace(m_attachedElement);
329 visitor->trace(m_sourceBuffers); 329 visitor->trace(m_sourceBuffers);
330 visitor->trace(m_activeSourceBuffers); 330 visitor->trace(m_activeSourceBuffers);
331 visitor->trace(m_liveSeekableRange); 331 visitor->trace(m_liveSeekableRange);
332 EventTargetWithInlineData::trace(visitor); 332 EventTargetWithInlineData::trace(visitor);
333 ActiveDOMObject::trace(visitor); 333 SuspendableObject::trace(visitor);
334 } 334 }
335 335
336 void MediaSource::setWebMediaSourceAndOpen( 336 void MediaSource::setWebMediaSourceAndOpen(
337 std::unique_ptr<WebMediaSource> webMediaSource) { 337 std::unique_ptr<WebMediaSource> webMediaSource) {
338 TRACE_EVENT_ASYNC_END0("media", "MediaSource::attachToElement", this); 338 TRACE_EVENT_ASYNC_END0("media", "MediaSource::attachToElement", this);
339 DCHECK(webMediaSource); 339 DCHECK(webMediaSource);
340 DCHECK(!m_webMediaSource); 340 DCHECK(!m_webMediaSource);
341 DCHECK(m_attachedElement); 341 DCHECK(m_attachedElement);
342 m_webMediaSource = std::move(webMediaSource); 342 m_webMediaSource = std::move(webMediaSource);
343 setReadyState(openKeyword()); 343 setReadyState(openKeyword());
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 event->setTarget(this); 815 event->setTarget(this);
816 816
817 m_asyncEventQueue->enqueueEvent(event); 817 m_asyncEventQueue->enqueueEvent(event);
818 } 818 }
819 819
820 URLRegistry& MediaSource::registry() const { 820 URLRegistry& MediaSource::registry() const {
821 return MediaSourceRegistry::registry(); 821 return MediaSourceRegistry::registry();
822 } 822 }
823 823
824 } // namespace blink 824 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698