OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... |
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
23 * THE POSSIBILITY OF SUCH DAMAGE. | 23 * THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef V8PerIsolateData_h | 26 #ifndef V8PerIsolateData_h |
27 #define V8PerIsolateData_h | 27 #define V8PerIsolateData_h |
28 | 28 |
29 #include "bindings/core/v8/ScopedPersistent.h" | 29 #include "bindings/core/v8/ScopedPersistent.h" |
30 #include "bindings/core/v8/ScriptState.h" | 30 #include "bindings/core/v8/ScriptState.h" |
| 31 #include "bindings/core/v8/ScriptWrappableVisitor.h" |
31 #include "bindings/core/v8/V8HiddenValue.h" | 32 #include "bindings/core/v8/V8HiddenValue.h" |
32 #include "bindings/core/v8/WrapperTypeInfo.h" | 33 #include "bindings/core/v8/WrapperTypeInfo.h" |
33 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
34 #include "gin/public/isolate_holder.h" | 35 #include "gin/public/isolate_holder.h" |
35 #include "gin/public/v8_idle_task_runner.h" | 36 #include "gin/public/v8_idle_task_runner.h" |
36 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
37 #include "wtf/HashMap.h" | 38 #include "wtf/HashMap.h" |
38 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
39 #include "wtf/OwnPtr.h" | 40 #include "wtf/OwnPtr.h" |
40 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 void runEndOfScopeTasks(); | 140 void runEndOfScopeTasks(); |
140 void clearEndOfScopeTasks(); | 141 void clearEndOfScopeTasks(); |
141 | 142 |
142 void setThreadDebugger(PassOwnPtr<ThreadDebugger>); | 143 void setThreadDebugger(PassOwnPtr<ThreadDebugger>); |
143 ThreadDebugger* threadDebugger(); | 144 ThreadDebugger* threadDebugger(); |
144 | 145 |
145 using ActiveScriptWrappableSet = HeapHashSet<WeakMember<ActiveScriptWrappabl
e>>; | 146 using ActiveScriptWrappableSet = HeapHashSet<WeakMember<ActiveScriptWrappabl
e>>; |
146 void addActiveScriptWrappable(ActiveScriptWrappable*); | 147 void addActiveScriptWrappable(ActiveScriptWrappable*); |
147 const ActiveScriptWrappableSet* activeScriptWrappables() const { return m_ac
tiveScriptWrappables.get(); } | 148 const ActiveScriptWrappableSet* activeScriptWrappables() const { return m_ac
tiveScriptWrappables.get(); } |
148 | 149 |
| 150 void setScriptWrappableVisitor(std::unique_ptr<ScriptWrappableVisitor> visit
or) { m_scriptWrappableVisitor = std::move(visitor); } |
| 151 ScriptWrappableVisitor* scriptWrappableVisitor() { return m_scriptWrappableV
isitor.get(); } |
| 152 |
149 private: | 153 private: |
150 V8PerIsolateData(); | 154 V8PerIsolateData(); |
151 ~V8PerIsolateData(); | 155 ~V8PerIsolateData(); |
152 | 156 |
153 static void useCounterCallback(v8::Isolate*, v8::Isolate::UseCounterFeature)
; | 157 static void useCounterCallback(v8::Isolate*, v8::Isolate::UseCounterFeature)
; |
154 | 158 |
155 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate>> V8FunctionTe
mplateMap; | 159 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate>> V8FunctionTe
mplateMap; |
156 V8FunctionTemplateMap& selectInterfaceTemplateMap(const DOMWrapperWorld&); | 160 V8FunctionTemplateMap& selectInterfaceTemplateMap(const DOMWrapperWorld&); |
157 V8FunctionTemplateMap& selectOperationTemplateMap(const DOMWrapperWorld&); | 161 V8FunctionTemplateMap& selectOperationTemplateMap(const DOMWrapperWorld&); |
158 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>, V8F
unctionTemplateMap&); | 162 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>, V8F
unctionTemplateMap&); |
(...skipping 22 matching lines...) Expand all Loading... |
181 bool m_useCounterDisabled; | 185 bool m_useCounterDisabled; |
182 friend class UseCounterDisabledScope; | 186 friend class UseCounterDisabledScope; |
183 | 187 |
184 bool m_isHandlingRecursionLevelError; | 188 bool m_isHandlingRecursionLevelError; |
185 bool m_isReportingException; | 189 bool m_isReportingException; |
186 | 190 |
187 Vector<OwnPtr<EndOfScopeTask>> m_endOfScopeTasks; | 191 Vector<OwnPtr<EndOfScopeTask>> m_endOfScopeTasks; |
188 OwnPtr<ThreadDebugger> m_threadDebugger; | 192 OwnPtr<ThreadDebugger> m_threadDebugger; |
189 | 193 |
190 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables; | 194 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables; |
| 195 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor; |
191 }; | 196 }; |
192 | 197 |
193 } // namespace blink | 198 } // namespace blink |
194 | 199 |
195 #endif // V8PerIsolateData_h | 200 #endif // V8PerIsolateData_h |
OLD | NEW |