[global-handles] Improve documentation on assertion
First pass callbacks are required to reset the handle before entering the second callback. Make this a CHECK and properly document what is required to fix when hitting this assertion. Change-Id: I13c6b0342fca16544cec01620ac74a87c290b87d Reviewed-on: https://chromium-review.googlesource.com/975609 Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#52169}
This commit is contained in:
parent
efca73ea1a
commit
447d384802
@ -877,8 +877,12 @@ void GlobalHandles::PendingPhantomCallback::Invoke(Isolate* isolate) {
|
||||
callback_ = nullptr;
|
||||
callback(data);
|
||||
if (node_ != nullptr) {
|
||||
// Transition to second pass state.
|
||||
DCHECK(node_->state() == Node::FREE);
|
||||
// Transition to second pass. It is required that the first pass callback
|
||||
// resets the handle using |v8::PersistentBase::Reset|. Also see comments on
|
||||
// |v8::WeakCallbackInfo|.
|
||||
CHECK_WITH_MSG(Node::FREE == node_->state(),
|
||||
"Handle not reset in first callback. See comments on "
|
||||
"|v8::WeakCallbackInfo|.");
|
||||
node_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user