Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Unified Diff: src/global-handles.cc

Issue 1246603002: Don't run the second pass of the pending phantom callbacks if the heap has been torn down. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: update Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cancelable-task.cc ('k') | src/heap/memory-reducer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 4cd0a18ff8ece0cd658f744d19161269d5053de6..ab48997c58ecae4c1850dd14fd2ead507d0374a5 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -495,25 +495,23 @@ class GlobalHandles::NodeIterator {
DISALLOW_COPY_AND_ASSIGN(NodeIterator);
};
-class GlobalHandles::PendingPhantomCallbacksSecondPassTask : public v8::Task {
+class GlobalHandles::PendingPhantomCallbacksSecondPassTask
+ : public v8::internal::CancelableTask {
public:
// Takes ownership of the contents of pending_phantom_callbacks, leaving it in
// the same state it would be after a call to Clear().
PendingPhantomCallbacksSecondPassTask(
List<PendingPhantomCallback>* pending_phantom_callbacks, Isolate* isolate)
- : isolate_(isolate) {
+ : CancelableTask(isolate) {
pending_phantom_callbacks_.Swap(pending_phantom_callbacks);
}
- ~PendingPhantomCallbacksSecondPassTask() override {}
-
- void Run() override {
+ void RunInternal() override {
InvokeSecondPassPhantomCallbacks(&pending_phantom_callbacks_, isolate_);
}
private:
List<PendingPhantomCallback> pending_phantom_callbacks_;
- Isolate* isolate_;
DISALLOW_COPY_AND_ASSIGN(PendingPhantomCallbacksSecondPassTask);
};
@@ -845,7 +843,7 @@ int GlobalHandles::DispatchPendingPhantomCallbacks(
if (synchronous_second_pass) {
InvokeSecondPassPhantomCallbacks(&pending_phantom_callbacks_, isolate());
} else {
- auto* task = new PendingPhantomCallbacksSecondPassTask(
+ auto task = new PendingPhantomCallbacksSecondPassTask(
&pending_phantom_callbacks_, isolate());
V8::GetCurrentPlatform()->CallOnForegroundThread(
reinterpret_cast<v8::Isolate*>(isolate()), task);
« no previous file with comments | « src/cancelable-task.cc ('k') | src/heap/memory-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698