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

Side by Side Diff: Source/modules/mediasource/MediaSourceBase.cpp

Issue 16625011: Add minimal implementation of unprefixed MediaSource API that has feature parity with prefixed API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix global-constructors-listing-expected.txt Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/mediasource/MediaSource.idl ('k') | Source/modules/mediasource/SourceBuffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 169 }
170 170
171 bool MediaSourceBase::hasPendingActivity() const 171 bool MediaSourceBase::hasPendingActivity() const
172 { 172 {
173 return m_private || m_asyncEventQueue->hasPendingEvents() 173 return m_private || m_asyncEventQueue->hasPendingEvents()
174 || ActiveDOMObject::hasPendingActivity(); 174 || ActiveDOMObject::hasPendingActivity();
175 } 175 }
176 176
177 void MediaSourceBase::stop() 177 void MediaSourceBase::stop()
178 { 178 {
179 m_asyncEventQueue->close();
180 if (!isClosed())
181 setReadyState(closedKeyword());
179 m_private.clear(); 182 m_private.clear();
180 m_asyncEventQueue->cancelAllEvents();
181 } 183 }
182 184
183 PassOwnPtr<SourceBufferPrivate> MediaSourceBase::createSourceBufferPrivate(const String& type, const MediaSourcePrivate::CodecsArray& codecs, ExceptionCode& ec) 185 PassOwnPtr<SourceBufferPrivate> MediaSourceBase::createSourceBufferPrivate(const String& type, const MediaSourcePrivate::CodecsArray& codecs, ExceptionCode& ec)
184 { 186 {
185 OwnPtr<SourceBufferPrivate> sourceBufferPrivate; 187 OwnPtr<SourceBufferPrivate> sourceBufferPrivate;
186 switch (m_private->addSourceBuffer(type, codecs, &sourceBufferPrivate)) { 188 switch (m_private->addSourceBuffer(type, codecs, &sourceBufferPrivate)) {
187 case MediaSourcePrivate::Ok: { 189 case MediaSourcePrivate::Ok: {
188 return sourceBufferPrivate.release(); 190 return sourceBufferPrivate.release();
189 } 191 }
190 case MediaSourcePrivate::NotSupported: 192 case MediaSourcePrivate::NotSupported:
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 { 242 {
241 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); 243 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
242 ActiveDOMObject::reportMemoryUsage(memoryObjectInfo); 244 ActiveDOMObject::reportMemoryUsage(memoryObjectInfo);
243 info.addMember(m_eventTargetData, "eventTargetData"); 245 info.addMember(m_eventTargetData, "eventTargetData");
244 info.addMember(m_readyState, "readyState"); 246 info.addMember(m_readyState, "readyState");
245 info.addMember(m_private, "private"); 247 info.addMember(m_private, "private");
246 info.addMember(m_asyncEventQueue, "asyncEventQueue"); 248 info.addMember(m_asyncEventQueue, "asyncEventQueue");
247 } 249 }
248 250
249 } 251 }
OLDNEW
« no previous file with comments | « Source/modules/mediasource/MediaSource.idl ('k') | Source/modules/mediasource/SourceBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698