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

Unified Diff: src/cancelable-task.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.h ('k') | src/global-handles.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cancelable-task.cc
diff --git a/src/cancelable-task.cc b/src/cancelable-task.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5eab9605b4a3c692b6ce58dd4ce51a148e7bd072
--- /dev/null
+++ b/src/cancelable-task.cc
@@ -0,0 +1,28 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/cancelable-task.h"
+
+#include "src/base/platform/platform.h"
+#include "src/v8.h"
+
+namespace v8 {
+namespace internal {
+
+
+CancelableTask::CancelableTask(Isolate* isolate)
+ : isolate_(isolate), is_cancelled_(false) {
+ isolate->RegisterCancelableTask(this);
+}
+
+
+CancelableTask::~CancelableTask() {
+ if (!is_cancelled_) {
+ isolate_->RemoveCancelableTask(this);
+ }
+}
+
+
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/cancelable-task.h ('k') | src/global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698