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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "bindings/v8/ScopedPersistent.h" | 29 #include "bindings/v8/ScopedPersistent.h" |
30 #include "bindings/v8/UnsafePersistent.h" | 30 #include "bindings/v8/UnsafePersistent.h" |
31 #include "bindings/v8/WrapperTypeInfo.h" | 31 #include "bindings/v8/WrapperTypeInfo.h" |
32 #include "gin/public/gin_embedders.h" | 32 #include "gin/public/gin_embedders.h" |
33 #include <v8.h> | 33 #include <v8.h> |
34 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
35 #include "wtf/HashMap.h" | 35 #include "wtf/HashMap.h" |
36 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
37 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
| 38 #include "wtf/text/WTFString.h" |
38 | 39 |
39 namespace WebCore { | 40 namespace WebCore { |
40 | 41 |
41 class DOMDataStore; | 42 class DOMDataStore; |
42 class GCEventData; | 43 class GCEventData; |
43 class StringCache; | 44 class StringCache; |
44 class V8HiddenPropertyName; | 45 class V8HiddenPropertyName; |
45 struct WrapperTypeInfo; | 46 struct WrapperTypeInfo; |
46 | 47 |
47 class ExternalStringVisitor; | 48 class ExternalStringVisitor; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 v8::Handle<v8::FunctionTemplate> privateTemplateIfExists(WrapperWorldType, v
oid* privatePointer); | 128 v8::Handle<v8::FunctionTemplate> privateTemplateIfExists(WrapperWorldType, v
oid* privatePointer); |
128 void setPrivateTemplate(WrapperWorldType, void* privatePointer, v8::Handle<v
8::FunctionTemplate>); | 129 void setPrivateTemplate(WrapperWorldType, void* privatePointer, v8::Handle<v
8::FunctionTemplate>); |
129 | 130 |
130 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, WrapperWorld
Type); | 131 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, WrapperWorld
Type); |
131 | 132 |
132 v8::Local<v8::Context> ensureRegexContext(); | 133 v8::Local<v8::Context> ensureRegexContext(); |
133 | 134 |
134 const char* previousSamplingState() const { return m_previousSamplingState;
} | 135 const char* previousSamplingState() const { return m_previousSamplingState;
} |
135 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } | 136 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } |
136 | 137 |
| 138 v8::Handle<v8::Value> compiledBlinkInJavaScript(String); |
| 139 void setCompiledBlinkInJavaScript(String, v8::Handle<v8::Value>); |
| 140 |
137 private: | 141 private: |
138 explicit V8PerIsolateData(v8::Isolate*); | 142 explicit V8PerIsolateData(v8::Isolate*); |
139 ~V8PerIsolateData(); | 143 ~V8PerIsolateData(); |
140 static void constructorOfToString(const v8::FunctionCallbackInfo<v8::Value>&
); | 144 static void constructorOfToString(const v8::FunctionCallbackInfo<v8::Value>&
); |
141 | 145 |
142 v8::Isolate* m_isolate; | 146 v8::Isolate* m_isolate; |
143 TemplateMap m_templatesForMainWorld; | 147 TemplateMap m_templatesForMainWorld; |
144 TemplateMap m_templatesForNonMainWorld; | 148 TemplateMap m_templatesForNonMainWorld; |
145 ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate; | 149 ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate; |
146 v8::Persistent<v8::FunctionTemplate> m_lazyEventListenerToStringTemplate; | 150 v8::Persistent<v8::FunctionTemplate> m_lazyEventListenerToStringTemplate; |
147 OwnPtr<StringCache> m_stringCache; | 151 OwnPtr<StringCache> m_stringCache; |
148 | 152 |
149 Vector<DOMDataStore*> m_domDataList; | 153 Vector<DOMDataStore*> m_domDataList; |
150 DOMDataStore* m_workerDomDataStore; | 154 DOMDataStore* m_workerDomDataStore; |
151 | 155 |
152 OwnPtr<V8HiddenPropertyName> m_hiddenPropertyName; | 156 OwnPtr<V8HiddenPropertyName> m_hiddenPropertyName; |
153 ScopedPersistent<v8::Value> m_liveRoot; | 157 ScopedPersistent<v8::Value> m_liveRoot; |
154 ScopedPersistent<v8::Context> m_regexContext; | 158 ScopedPersistent<v8::Context> m_regexContext; |
155 | 159 |
| 160 HashMap<String, UnsafePersistent<v8::Value> > m_compiledBlinkInJavaScript; |
| 161 |
156 const char* m_previousSamplingState; | 162 const char* m_previousSamplingState; |
157 | 163 |
158 bool m_constructorMode; | 164 bool m_constructorMode; |
159 friend class ConstructorMode; | 165 friend class ConstructorMode; |
160 | 166 |
161 int m_recursionLevel; | 167 int m_recursionLevel; |
162 | 168 |
163 #ifndef NDEBUG | 169 #ifndef NDEBUG |
164 int m_internalScriptRecursionLevel; | 170 int m_internalScriptRecursionLevel; |
165 #endif | 171 #endif |
166 OwnPtr<GCEventData> m_gcEventData; | 172 OwnPtr<GCEventData> m_gcEventData; |
167 bool m_shouldCollectGarbageSoon; | 173 bool m_shouldCollectGarbageSoon; |
168 }; | 174 }; |
169 | 175 |
170 } // namespace WebCore | 176 } // namespace WebCore |
171 | 177 |
172 #endif // V8PerIsolateData_h | 178 #endif // V8PerIsolateData_h |
OLD | NEW |