Files
palemoon27/dom/media/FlushableTaskQueue.cpp
T
roytam1 d370ac889b import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1224115 - Don't flash rows when they're unhidden. r=mratcliffe (64cb22c4f3)
- Bug 1224115 - Fix keyboard navigation for filtered TableWidget. r=mratcliffe (494a5beda5)
- Bug 1184644 - Remove hardcoded colors from the SideMenu theme, and refresh it. r=vporof (9378d86abf)
- Bug 1253981 - Fix out of view breakpoint checkboxes in debugger. r=bgrins (07bbbf2611)
- Bug 1258197 - Recordings list empty label text has a different background color than its parent container, r=jsantell (90f21f52d7)
- Bug 1257063 - Don't destruct the runnable inside the lock when TaskQueue::Dispatch fails. r=bobbyholley. (1f6b254bb0)
- Bug 1224115 - Tweak storage inspector styling for filtering functionality. r=mikeratcliffe (573cb5dc97)
- Bug 1202148 - Move current in only one location in Intervals.h, r=jya (2c98d86b10)
- Bug 1258673. Part 1 - cache mStreamOffset so we won't read at the wrong position when Other Read() interrupt the current Read(). r=jya. (87ab65cc30)
- Bug 1258673. Part 2 - since mStreamOffset is not updated until the end of MediaCacheStream::Read(), we have to pass stream offset to MediaCache::NoteBlockUsage explicitly to avoid hitting the assertion. r=jya. (f02806ea1c)
- Bug 1235350 - Storage Inspector needs a simplified inline editor r+pbro (615da8f863)
- Bug 1224545 - Remove async-utils/async method and use Task.async instead. r=jryans (37e2c7df8f)
- Bug 1171903 - Test for storage inspector endless scrolling. r=miker (cd07c4da21)
- Bug 1242832 - Fix intermittent browser_storage_overflow.js timeouts. r=pbro (dccdf54962)
- Bug 1224115 - Test for storage inspector search. r=mratcliffe (301c7af8c9)
- Bug 1233497 - Don't yield or resolve CPOWs from Tasks or Promises in devtools tests. r=jryans (ceed1b85cf)
- Bug 1229272 - Stop using CPOW when creating indexed DB in storage tests. r=mratcliffe (c49d24d48a)
- Bug 1231154 - Make cookies table fields editable via double-click in storage inspector r+pbro (572b6090e1)
- Bug 1231437 - Storage Inspector: context menu to remove cookie/storage item r=mratcliffe (d33b236c51)
- Bug 1231179 - Make sessionStorage entry rows editable via double-click in storage inspector r=pbro (c11b3a8c9b)
- Bug 1231155 - Make localstorage entry rows editable via double-click in storage inspector r=pbro (d1d012fc30)
- Bug 1231434 - Add 'Delete All' context menu entry to storage inspector. r=mratcliffe (68985287c8)
- Bug 1258114 - use invisible borders to drag devtools splitters on both sides;r=bgrins (88108f3e48)
- Bug 1248447 - Stop grafting prototypes in storage.js::patchMetadataMapsAndProtos() r+pbro (8b2f5af32d)
- Bug 1237915 - Fix devtools storage interface to use the correct user context id when opening indexdb connections. r=mratcliffe (16bd8ea657)
- Bug 1262766 - Storage Inspector breaks down when Cache Storage throws a DOM security error. r=mratcliffe (b02b2b74c5)
2024-06-25 16:00:17 +08:00

58 lines
1.6 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "FlushableTaskQueue.h"
namespace mozilla {
void
FlushableTaskQueue::Flush()
{
MonitorAutoLock mon(mQueueMonitor);
AutoSetFlushing autoFlush(this);
FlushLocked();
AwaitIdleLocked();
}
nsresult
FlushableTaskQueue::FlushAndDispatch(already_AddRefed<nsIRunnable> aRunnable)
{
nsCOMPtr<nsIRunnable> r = aRunnable;
{
MonitorAutoLock mon(mQueueMonitor);
AutoSetFlushing autoFlush(this);
FlushLocked();
nsresult rv = DispatchLocked(/* passed by ref */r, IgnoreFlushing, AssertDispatchSuccess);
NS_ENSURE_SUCCESS(rv, rv);
AwaitIdleLocked();
}
// If the ownership of |r| is not transferred in DispatchLocked() due to
// dispatch failure, it will be deleted here outside the lock. We do so
// since the destructor of the runnable might access TaskQueue and result
// in deadlocks.
return NS_OK;
}
void
FlushableTaskQueue::FlushLocked()
{
// Make sure there are no tasks for this queue waiting in the caller's tail
// dispatcher.
MOZ_ASSERT_IF(AbstractThread::GetCurrent(),
!AbstractThread::GetCurrent()->TailDispatcher().HasTasksFor(this));
mQueueMonitor.AssertCurrentThreadOwns();
MOZ_ASSERT(mIsFlushing);
// Clear the tasks. If this strikes you as awful, stop using a
// FlushableTaskQueue.
while (!mTasks.empty()) {
mTasks.pop();
}
}
} // namespace mozilla