forked from mirrors/gecko-dev
Bug 1326330. Part 2 - add assertions and checks. r=JamesCheng
1. ensure the 'finish' event is notified only once. 2. assert pushing items to a finished queue. MozReview-Commit-ID: 9lYWPANVz0m --HG-- extra : rebase_source : c05b0c77fdee324798579e0e2ebec6ce6303cbf6 extra : intermediate-source : 80be35003c76fc9cc74f206576394b46317b7880 extra : source : 14f5d5c064fddbbcf5728fb4d19e9c0a4e45fac7
This commit is contained in:
parent
3985fd7208
commit
4eb1252534
1 changed files with 5 additions and 2 deletions
|
|
@ -43,6 +43,7 @@ public:
|
|||
|
||||
inline void Push(T* aItem) {
|
||||
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
||||
MOZ_ASSERT(!mEndOfStream);
|
||||
MOZ_ASSERT(aItem);
|
||||
NS_ADDREF(aItem);
|
||||
MOZ_ASSERT(aItem->GetEndTime() >= aItem->mTime);
|
||||
|
|
@ -88,9 +89,11 @@ public:
|
|||
// Informs the media queue that it won't be receiving any more items.
|
||||
void Finish() {
|
||||
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
||||
if (!mEndOfStream) {
|
||||
mEndOfStream = true;
|
||||
mFinishEvent.Notify();
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the approximate number of microseconds of items in the queue.
|
||||
int64_t Duration() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue