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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 ASSERT(isolate->GetData(gin::kEmbedderBlink)); | 67 ASSERT(isolate->GetData(gin::kEmbedderBlink)); |
68 return static_cast<V8PerIsolateData*>(isolate->GetData(gin::kEmbedderBli
nk)); | 68 return static_cast<V8PerIsolateData*>(isolate->GetData(gin::kEmbedderBli
nk)); |
69 } | 69 } |
70 | 70 |
71 static void willBeDestroyed(v8::Isolate*); | 71 static void willBeDestroyed(v8::Isolate*); |
72 static void destroy(v8::Isolate*); | 72 static void destroy(v8::Isolate*); |
73 static v8::Isolate* mainThreadIsolate(); | 73 static v8::Isolate* mainThreadIsolate(); |
74 | 74 |
75 static void enableIdleTasks(v8::Isolate*, PassOwnPtr<gin::V8IdleTaskRunner>)
; | 75 static void enableIdleTasks(v8::Isolate*, PassOwnPtr<gin::V8IdleTaskRunner>)
; |
76 | 76 |
77 bool destructionPending() const { return m_destructionPending; } | |
78 v8::Isolate* isolate() { return m_isolateHolder->isolate(); } | 77 v8::Isolate* isolate() { return m_isolateHolder->isolate(); } |
79 | 78 |
80 StringCache* getStringCache() { return m_stringCache.get(); } | 79 StringCache* getStringCache() { return m_stringCache.get(); } |
81 | 80 |
82 v8::Persistent<v8::Value>& ensureLiveRoot(); | 81 v8::Persistent<v8::Value>& ensureLiveRoot(); |
83 | 82 |
84 int recursionLevel() const { return m_recursionLevel; } | |
85 int incrementRecursionLevel() { return ++m_recursionLevel; } | |
86 int decrementRecursionLevel() { return --m_recursionLevel; } | |
87 bool isHandlingRecursionLevelError() const { return m_isHandlingRecursionLev
elError; } | 83 bool isHandlingRecursionLevelError() const { return m_isHandlingRecursionLev
elError; } |
88 void setIsHandlingRecursionLevelError(bool value) { m_isHandlingRecursionLev
elError = value; } | 84 void setIsHandlingRecursionLevelError(bool value) { m_isHandlingRecursionLev
elError = value; } |
89 | 85 |
90 bool isReportingException() const { return m_isReportingException; } | 86 bool isReportingException() const { return m_isReportingException; } |
91 void setReportingException(bool value) { m_isReportingException = value; } | 87 void setReportingException(bool value) { m_isReportingException = value; } |
92 | 88 |
93 bool performingMicrotaskCheckpoint() const { return m_performingMicrotaskChe
ckpoint; } | |
94 void setPerformingMicrotaskCheckpoint(bool performingMicrotaskCheckpoint) {
m_performingMicrotaskCheckpoint = performingMicrotaskCheckpoint; } | |
95 | |
96 #if ENABLE(ASSERT) | |
97 int internalScriptRecursionLevel() const { return m_internalScriptRecursionL
evel; } | |
98 int incrementInternalScriptRecursionLevel() { return ++m_internalScriptRecur
sionLevel; } | |
99 int decrementInternalScriptRecursionLevel() { return --m_internalScriptRecur
sionLevel; } | |
100 #endif | |
101 | |
102 V8HiddenValue* hiddenValue() { return m_hiddenValue.get(); } | 89 V8HiddenValue* hiddenValue() { return m_hiddenValue.get(); } |
103 | 90 |
104 v8::Local<v8::FunctionTemplate> domTemplate(const void* domTemplateKey, v8::
FunctionCallback = 0, v8::Local<v8::Value> data = v8::Local<v8::Value>(), v8::Lo
cal<v8::Signature> = v8::Local<v8::Signature>(), int length = 0); | 91 v8::Local<v8::FunctionTemplate> domTemplate(const void* domTemplateKey, v8::
FunctionCallback = 0, v8::Local<v8::Value> data = v8::Local<v8::Value>(), v8::Lo
cal<v8::Signature> = v8::Local<v8::Signature>(), int length = 0); |
105 v8::Local<v8::FunctionTemplate> existingDOMTemplate(const void* domTemplateK
ey); | 92 v8::Local<v8::FunctionTemplate> existingDOMTemplate(const void* domTemplateK
ey); |
106 void setDOMTemplate(const void* domTemplateKey, v8::Local<v8::FunctionTempla
te>); | 93 void setDOMTemplate(const void* domTemplateKey, v8::Local<v8::FunctionTempla
te>); |
107 | 94 |
108 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>); | 95 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>); |
109 v8::Local<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, v
8::Local<v8::Value>); | 96 v8::Local<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, v
8::Local<v8::Value>); |
110 | 97 |
111 v8::Local<v8::Context> ensureScriptRegexpContext(); | 98 v8::Local<v8::Context> ensureScriptRegexpContext(); |
(...skipping 12 matching lines...) Expand all Loading... |
124 | 111 |
125 private: | 112 private: |
126 V8PerIsolateData(); | 113 V8PerIsolateData(); |
127 ~V8PerIsolateData(); | 114 ~V8PerIsolateData(); |
128 | 115 |
129 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate>> DOMTemplateM
ap; | 116 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate>> DOMTemplateM
ap; |
130 DOMTemplateMap& currentDOMTemplateMap(); | 117 DOMTemplateMap& currentDOMTemplateMap(); |
131 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>, DOM
TemplateMap&); | 118 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>, DOM
TemplateMap&); |
132 v8::Local<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, v
8::Local<v8::Value>, DOMTemplateMap&); | 119 v8::Local<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, v
8::Local<v8::Value>, DOMTemplateMap&); |
133 | 120 |
134 bool m_destructionPending; | |
135 OwnPtr<gin::IsolateHolder> m_isolateHolder; | 121 OwnPtr<gin::IsolateHolder> m_isolateHolder; |
136 DOMTemplateMap m_domTemplateMapForMainWorld; | 122 DOMTemplateMap m_domTemplateMapForMainWorld; |
137 DOMTemplateMap m_domTemplateMapForNonMainWorld; | 123 DOMTemplateMap m_domTemplateMapForNonMainWorld; |
138 OwnPtr<StringCache> m_stringCache; | 124 OwnPtr<StringCache> m_stringCache; |
139 OwnPtr<V8HiddenValue> m_hiddenValue; | 125 OwnPtr<V8HiddenValue> m_hiddenValue; |
140 ScopedPersistent<v8::Value> m_liveRoot; | 126 ScopedPersistent<v8::Value> m_liveRoot; |
141 RefPtr<ScriptState> m_scriptRegexpScriptState; | 127 RefPtr<ScriptState> m_scriptRegexpScriptState; |
142 | 128 |
143 bool m_constructorMode; | 129 bool m_constructorMode; |
144 friend class ConstructorMode; | 130 friend class ConstructorMode; |
145 | 131 |
146 int m_recursionLevel; | |
147 bool m_isHandlingRecursionLevelError; | 132 bool m_isHandlingRecursionLevelError; |
148 bool m_isReportingException; | 133 bool m_isReportingException; |
149 | 134 |
150 #if ENABLE(ASSERT) | |
151 int m_internalScriptRecursionLevel; | |
152 #endif | |
153 bool m_performingMicrotaskCheckpoint; | |
154 | |
155 Vector<OwnPtr<EndOfScopeTask>> m_endOfScopeTasks; | 135 Vector<OwnPtr<EndOfScopeTask>> m_endOfScopeTasks; |
156 OwnPtr<ThreadDebugger> m_threadDebugger; | 136 OwnPtr<ThreadDebugger> m_threadDebugger; |
157 }; | 137 }; |
158 | 138 |
159 } // namespace blink | 139 } // namespace blink |
160 | 140 |
161 #endif // V8PerIsolateData_h | 141 #endif // V8PerIsolateData_h |
OLD | NEW |