| 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 "platform/heap/Handle.h" |
| 10 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
| 11 | 11 |
| 12 namespace v8 { |
| 13 class Isolate; |
| 14 } |
| 15 |
| 12 namespace blink { | 16 namespace blink { |
| 13 | 17 |
| 14 class ScriptWrappable; | 18 class ScriptWrappable; |
| 15 class ScriptWrappableVisitor; | 19 class ScriptWrappableVisitor; |
| 16 | 20 |
| 17 /** | 21 /** |
| 18 * Classes deriving from ActiveScriptWrappable will be registered in a | 22 * Classes deriving from ActiveScriptWrappable will be registered in a |
| 19 * thread-specific list. They keep their wrappers and dependant objects alive | 23 * thread-specific list. They keep their wrappers and dependant objects alive |
| 20 * as long as they have pending activity. | 24 * as long as they have pending activity. |
| 21 */ | 25 */ |
| 22 class CORE_EXPORT ActiveScriptWrappable : public GarbageCollectedMixin { | 26 class CORE_EXPORT ActiveScriptWrappable : public GarbageCollectedMixin { |
| 23 WTF_MAKE_NONCOPYABLE(ActiveScriptWrappable); | 27 WTF_MAKE_NONCOPYABLE(ActiveScriptWrappable); |
| 24 public: | 28 public: |
| 25 explicit ActiveScriptWrappable(ScriptWrappable*); | 29 explicit ActiveScriptWrappable(ScriptWrappable*); |
| 26 | 30 |
| 27 static void traceActiveScriptWrappables(ScriptWrappableVisitor*); | 31 static void traceActiveScriptWrappables(v8::Isolate*, ScriptWrappableVisitor
*); |
| 28 | 32 |
| 29 virtual bool hasPendingActivity() const = 0; | 33 virtual bool hasPendingActivity() const = 0; |
| 30 | 34 |
| 31 ScriptWrappable* toScriptWrappable() const; | 35 ScriptWrappable* toScriptWrappable() const { return m_scriptWrappable; } |
| 32 | 36 |
| 33 private: | 37 private: |
| 34 ScriptWrappable* m_scriptWrappable; | 38 ScriptWrappable* m_scriptWrappable; |
| 35 }; | 39 }; |
| 36 | 40 |
| 37 } // namespace blink | 41 } // namespace blink |
| 38 | 42 |
| 39 #endif // ActiveScriptWrappable_h | 43 #endif // ActiveScriptWrappable_h |
| OLD | NEW |