OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ActiveScriptWrappable_h | 5 #ifndef ActiveScriptWrappable_h |
6 #define ActiveScriptWrappable_h | 6 #define ActiveScriptWrappable_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/heap/Handle.h" |
9 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class ScriptWrappable; | 14 class ScriptWrappable; |
14 class ScriptWrappableVisitor; | 15 class ScriptWrappableVisitor; |
15 | 16 |
16 /** | 17 /** |
17 * Classes deriving from ActiveScriptWrappable will be registered in a | 18 * Classes deriving from ActiveScriptWrappable will be registered in a |
18 * thread-specific list. They keep their wrappers and dependant objects alive | 19 * thread-specific list. They keep their wrappers and dependant objects alive |
19 * as long as they have pending activity. | 20 * as long as they have pending activity. |
20 */ | 21 */ |
21 class CORE_EXPORT ActiveScriptWrappable { | 22 class CORE_EXPORT ActiveScriptWrappable : public GarbageCollectedMixin { |
22 WTF_MAKE_NONCOPYABLE(ActiveScriptWrappable); | 23 WTF_MAKE_NONCOPYABLE(ActiveScriptWrappable); |
23 public: | 24 public: |
24 explicit ActiveScriptWrappable(ScriptWrappable*); | 25 explicit ActiveScriptWrappable(ScriptWrappable*); |
25 | 26 |
26 static void traceActiveScriptWrappables(ScriptWrappableVisitor*); | 27 static void traceActiveScriptWrappables(ScriptWrappableVisitor*); |
27 | 28 |
28 virtual bool hasPendingActivity() const = 0; | 29 virtual bool hasPendingActivity() const = 0; |
29 | 30 |
30 ScriptWrappable* toScriptWrappable() const; | 31 ScriptWrappable* toScriptWrappable() const; |
31 | 32 |
32 protected: | |
33 virtual ~ActiveScriptWrappable(); | |
34 | |
35 private: | 33 private: |
36 ScriptWrappable* m_scriptWrappable; | 34 ScriptWrappable* m_scriptWrappable; |
37 }; | 35 }; |
38 | 36 |
39 } // namespace blink | 37 } // namespace blink |
40 | 38 |
41 #endif // ActiveScriptWrappable_h | 39 #endif // ActiveScriptWrappable_h |
OLD | NEW |