| 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 23 matching lines...) Expand all Loading... |
| 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 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class DOMDataStore; | 41 class DOMDataStore; |
| 42 class GCEventData; | 42 class GCEventData; |
| 43 class StringCache; | 43 class StringCache; |
| 44 class V8HiddenPropertyName; | |
| 45 struct WrapperTypeInfo; | 44 struct WrapperTypeInfo; |
| 46 | 45 |
| 47 class ExternalStringVisitor; | 46 class ExternalStringVisitor; |
| 48 | 47 |
| 49 typedef WTF::Vector<DOMDataStore*> DOMDataList; | 48 typedef WTF::Vector<DOMDataStore*> DOMDataList; |
| 50 | 49 |
| 51 class V8PerIsolateData { | 50 class V8PerIsolateData { |
| 52 public: | 51 public: |
| 53 static V8PerIsolateData* create(v8::Isolate*); | 52 static V8PerIsolateData* create(v8::Isolate*); |
| 54 static void ensureInitialized(v8::Isolate*); | 53 static void ensureInitialized(v8::Isolate*); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 78 { | 77 { |
| 79 return v8::Local<v8::FunctionTemplate>::New(m_isolate, m_lazyEventListen
erToStringTemplate); | 78 return v8::Local<v8::FunctionTemplate>::New(m_isolate, m_lazyEventListen
erToStringTemplate); |
| 80 } | 79 } |
| 81 | 80 |
| 82 StringCache* stringCache() { return m_stringCache.get(); } | 81 StringCache* stringCache() { return m_stringCache.get(); } |
| 83 | 82 |
| 84 v8::Persistent<v8::Value>& ensureLiveRoot(); | 83 v8::Persistent<v8::Value>& ensureLiveRoot(); |
| 85 | 84 |
| 86 DOMDataList& allStores() { return m_domDataList; } | 85 DOMDataList& allStores() { return m_domDataList; } |
| 87 | 86 |
| 88 V8HiddenPropertyName* hiddenPropertyName() { return m_hiddenPropertyName.get
(); } | |
| 89 | |
| 90 void registerDOMDataStore(DOMDataStore* domDataStore) | 87 void registerDOMDataStore(DOMDataStore* domDataStore) |
| 91 { | 88 { |
| 92 ASSERT(m_domDataList.find(domDataStore) == kNotFound); | 89 ASSERT(m_domDataList.find(domDataStore) == kNotFound); |
| 93 m_domDataList.append(domDataStore); | 90 m_domDataList.append(domDataStore); |
| 94 } | 91 } |
| 95 | 92 |
| 96 void unregisterDOMDataStore(DOMDataStore* domDataStore) | 93 void unregisterDOMDataStore(DOMDataStore* domDataStore) |
| 97 { | 94 { |
| 98 ASSERT(m_domDataList.find(domDataStore) != kNotFound); | 95 ASSERT(m_domDataList.find(domDataStore) != kNotFound); |
| 99 m_domDataList.remove(m_domDataList.find(domDataStore)); | 96 m_domDataList.remove(m_domDataList.find(domDataStore)); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 v8::Isolate* m_isolate; | 141 v8::Isolate* m_isolate; |
| 145 TemplateMap m_templatesForMainWorld; | 142 TemplateMap m_templatesForMainWorld; |
| 146 TemplateMap m_templatesForNonMainWorld; | 143 TemplateMap m_templatesForNonMainWorld; |
| 147 ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate; | 144 ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate; |
| 148 v8::Persistent<v8::FunctionTemplate> m_lazyEventListenerToStringTemplate; | 145 v8::Persistent<v8::FunctionTemplate> m_lazyEventListenerToStringTemplate; |
| 149 OwnPtr<StringCache> m_stringCache; | 146 OwnPtr<StringCache> m_stringCache; |
| 150 | 147 |
| 151 Vector<DOMDataStore*> m_domDataList; | 148 Vector<DOMDataStore*> m_domDataList; |
| 152 DOMDataStore* m_workerDomDataStore; | 149 DOMDataStore* m_workerDomDataStore; |
| 153 | 150 |
| 154 OwnPtr<V8HiddenPropertyName> m_hiddenPropertyName; | |
| 155 ScopedPersistent<v8::Value> m_liveRoot; | 151 ScopedPersistent<v8::Value> m_liveRoot; |
| 156 ScopedPersistent<v8::Context> m_regexContext; | 152 ScopedPersistent<v8::Context> m_regexContext; |
| 157 | 153 |
| 158 const char* m_previousSamplingState; | 154 const char* m_previousSamplingState; |
| 159 | 155 |
| 160 bool m_constructorMode; | 156 bool m_constructorMode; |
| 161 friend class ConstructorMode; | 157 friend class ConstructorMode; |
| 162 | 158 |
| 163 int m_recursionLevel; | 159 int m_recursionLevel; |
| 164 | 160 |
| 165 #ifndef NDEBUG | 161 #ifndef NDEBUG |
| 166 int m_internalScriptRecursionLevel; | 162 int m_internalScriptRecursionLevel; |
| 167 #endif | 163 #endif |
| 168 OwnPtr<GCEventData> m_gcEventData; | 164 OwnPtr<GCEventData> m_gcEventData; |
| 169 bool m_shouldCollectGarbageSoon; | 165 bool m_shouldCollectGarbageSoon; |
| 170 }; | 166 }; |
| 171 | 167 |
| 172 } // namespace WebCore | 168 } // namespace WebCore |
| 173 | 169 |
| 174 #endif // V8PerIsolateData_h | 170 #endif // V8PerIsolateData_h |
| OLD | NEW |