OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |