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

Side by Side Diff: src/cancelable-task.h

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 unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | src/cancelable-task.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_CANCELABLE_TASK_H_
6 #define V8_CANCELABLE_TASK_H_
7
8 #include "include/v8-platform.h"
9 #include "src/base/macros.h"
10
11 namespace v8 {
12 namespace internal {
13
14 class Isolate;
15
16 class CancelableTask : public Task {
17 public:
18 explicit CancelableTask(Isolate* isolate);
19 ~CancelableTask() override;
20
21 void Cancel() { is_cancelled_ = true; }
22
23 void Run() final {
24 if (!is_cancelled_) {
25 RunInternal();
26 }
27 }
28
29 virtual void RunInternal() = 0;
30
31 protected:
32 Isolate* isolate_;
33
34 private:
35 bool is_cancelled_;
36
37 DISALLOW_COPY_AND_ASSIGN(CancelableTask);
38 };
39
40 } // namespace internal
41 } // namespace v8
42
43 #endif // V8_CANCELABLE_TASK_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/cancelable-task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698