Commit f647bd51 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

Revert "bindings: Fix second pass callbacks fired during teardown sequence"

This reverts commit 2018a9ef.

Reason for revert: Reverting as this was fixed on the V8 side and this restores a consistent state where  all callbacks assume non-null ThreadState.

Original change's description:
> bindings: Fix second pass callbacks fired during teardown sequence
> 
> Work around the problem where second pass callbacks are fired during
> teardown.
> 
> Previously, these callbacks where just dropped which is not correct for
> other reason, e.g., when components keep a state per process and not
> just per Isolate.
> 
> Bug: chromium:890631
> Change-Id: I1fd66f9ffee86c5c7bff053303c741c4dedefdb0
> Reviewed-on: https://chromium-review.googlesource.com/c/1253782
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#597525}

TBR=haraken@chromium.org,mlippautz@chromium.org,clemensh@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:890631
Change-Id: I8d6f55fe926093ba776d182d9c154ee0b6538ed1
Reviewed-on: https://chromium-review.googlesource.com/c/1288270Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600708}
parent 1a9af7c2
......@@ -21,14 +21,8 @@ void WrapperTypeInfo::WrapperCreated() {
}
void WrapperTypeInfo::WrapperDestroyed() {
ThreadState* const thread_state = ThreadState::Current();
// WrapperDestroyed may be called during thread teardown as part of invoking
// V8 callbacks in which case ThreadState has already been destroyed.
if (!thread_state)
return;
ThreadHeapStatsCollector* stats_collector =
thread_state->Heap().stats_collector();
ThreadState::Current()->Heap().stats_collector();
stats_collector->DecreaseWrapperCount(1);
stats_collector->IncreaseCollectedWrapperCount(1);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment