/* -*- 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/. */
// The listener should be held alive by any async operations, so if it // is going away then there must not be any child actors. This in turn // ensures that StartDestroy() will not trigger the delayed path.
MOZ_DIAGNOSTIC_ASSERT(NumChildActors() == 0);
StartDestroy();
}
// StartDestroy() can get called from either Cache or the WorkerRef. // Theoretically we can get double called if the right race happens. Handle // that by just ignoring the second StartDestroy() call. if (!listener) { return;
}
listener->DestroyInternal(this);
// Cache listener should call ClearListener() in DestroyInternal()
MOZ_DIAGNOSTIC_ASSERT(!mListener);
// Start actor destruction from parent process
QM_WARNONLY_TRY(OkIf(SendTeardown()));
}
void CacheChild::ActorDestroy(ActorDestroyReason aReason) {
NS_ASSERT_OWNINGTHREAD(CacheChild);
RefPtr<Cache> listener = mListener; if (listener) {
listener->DestroyInternal(this); // Cache listener should call ClearListener() in DestroyInternal()
MOZ_DIAGNOSTIC_ASSERT(!mListener);
}
RemoveWorkerRef();
}
void CacheChild::NoteDeletedActor() { // Check to see if DestroyInternal was delayed because there were still active // CacheOpChilds when StartDestroy was called from WorkerRef notification. If // the last CacheOpChild is getting destructed; it's the time for us to // SendTearDown to the other side. if (NumChildActors() == 0 && mDelayedDestroy && !mLocked) DestroyInternal();
}
already_AddRefed<PCacheOpChild> CacheChild::AllocPCacheOpChild( const CacheOpArgs& aOpArgs) {
MOZ_CRASH("CacheOpChild should be manually constructed."); return nullptr;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.