| 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
|
|
|