nsresult FlushableTaskQueue::FlushAndDispatch(already_AddRefed<nsIRunnable> aRunnable) { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); FlushLocked(); nsCOMPtr<nsIRunnable> r = dont_AddRef(aRunnable.take()); nsresult rv = DispatchLocked(r.forget(), IgnoreFlushing, AssertDispatchSuccess); NS_ENSURE_SUCCESS(rv, rv); AwaitIdleLocked(); return NS_OK; }
void nsAttrValue::SetTo(already_AddRefed<DeclarationBlock> aValue, const nsAString* aSerialized) { MiscContainer* cont = EnsureEmptyMiscContainer(); MOZ_ASSERT(cont->mValue.mRefCount == 0); cont->mValue.mCSSDeclaration = aValue.take(); cont->mType = eCSSDeclaration; NS_ADDREF(cont); SetMiscAtomOrString(aSerialized); MOZ_ASSERT(cont->mValue.mRefCount == 1); }