forked from mirrors/gecko-dev
Bug 1943912 - Do not reset the chunk manager while shutdown a=dmeehan
Original Revision: https://phabricator.services.mozilla.com/D235642 Differential Revision: https://phabricator.services.mozilla.com/D237219
This commit is contained in:
parent
97dfb547ef
commit
ade99491c4
2 changed files with 10 additions and 4 deletions
|
|
@ -139,6 +139,12 @@ void ProfilerChild::SetupChunkManager() {
|
|||
});
|
||||
}
|
||||
|
||||
/* static */ void ProfilerChild::ClearPendingUpdate() {
|
||||
auto lockedUpdate = sPendingChunkManagerUpdate.Lock();
|
||||
lockedUpdate->mProfilerChild = nullptr;
|
||||
lockedUpdate->mUpdate.Clear();
|
||||
}
|
||||
|
||||
void ProfilerChild::ResetChunkManager() {
|
||||
if (!mChunkManager) {
|
||||
return;
|
||||
|
|
@ -149,9 +155,7 @@ void ProfilerChild::ResetChunkManager() {
|
|||
mChunkManager->SetUpdateCallback({});
|
||||
|
||||
// Clear the pending update.
|
||||
auto lockedUpdate = sPendingChunkManagerUpdate.Lock();
|
||||
lockedUpdate->mProfilerChild = nullptr;
|
||||
lockedUpdate->mUpdate.Clear();
|
||||
ClearPendingUpdate();
|
||||
// And process a final update right now.
|
||||
ProcessChunkManagerUpdate(
|
||||
ProfileBufferControlledChunkManager::Update(nullptr));
|
||||
|
|
@ -483,7 +487,7 @@ void ProfilerChild::ActorDestroy(ActorDestroyReason aActorDestroyReason) {
|
|||
}
|
||||
|
||||
void ProfilerChild::Destroy() {
|
||||
ResetChunkManager();
|
||||
ClearPendingUpdate();
|
||||
if (!mDestroyed) {
|
||||
Close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@ class ProfilerChild final : public PProfilerChild,
|
|||
void ProcessChunkManagerUpdate(
|
||||
ProfileBufferControlledChunkManager::Update&& aUpdate);
|
||||
|
||||
static void ClearPendingUpdate();
|
||||
|
||||
static void GatherProfileThreadFunction(void* already_AddRefedParameters);
|
||||
|
||||
nsCOMPtr<nsIThread> mThread;
|
||||
|
|
|
|||
Loading…
Reference in a new issue