| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 static V8PerIsolateData* from(v8::Isolate* isolate) | 59 static V8PerIsolateData* from(v8::Isolate* isolate) |
| 60 { | 60 { |
| 61 ASSERT(isolate); | 61 ASSERT(isolate); |
| 62 ASSERT(isolate->GetData(gin::kEmbedderBlink)); | 62 ASSERT(isolate->GetData(gin::kEmbedderBlink)); |
| 63 return static_cast<V8PerIsolateData*>(isolate->GetData(gin::kEmbedderBli
nk)); | 63 return static_cast<V8PerIsolateData*>(isolate->GetData(gin::kEmbedderBli
nk)); |
| 64 } | 64 } |
| 65 static void dispose(v8::Isolate*); | 65 static void dispose(v8::Isolate*); |
| 66 | 66 |
| 67 typedef HashMap<const void*, UnsafePersistent<v8::FunctionTemplate> > Templa
teMap; | 67 typedef HashMap<const void*, UnsafePersistent<v8::FunctionTemplate> > Templa
teMap; |
| 68 | 68 |
| 69 TemplateMap& rawDOMTemplateMap(WrapperWorldType worldType) | |
| 70 { | |
| 71 if (worldType == MainWorld) | |
| 72 return m_rawDOMTemplatesForMainWorld; | |
| 73 return m_rawDOMTemplatesForNonMainWorld; | |
| 74 } | |
| 75 | |
| 76 TemplateMap& templateMap(WrapperWorldType worldType) | 69 TemplateMap& templateMap(WrapperWorldType worldType) |
| 77 { | 70 { |
| 78 if (worldType == MainWorld) | 71 if (worldType == MainWorld) |
| 79 return m_templatesForMainWorld; | 72 return m_templatesForMainWorld; |
| 80 return m_templatesForNonMainWorld; | 73 return m_templatesForNonMainWorld; |
| 81 } | 74 } |
| 82 | 75 |
| 83 v8::Handle<v8::FunctionTemplate> toStringTemplate(); | 76 v8::Handle<v8::FunctionTemplate> toStringTemplate(); |
| 84 v8::Handle<v8::FunctionTemplate> lazyEventListenerToStringTemplate() | 77 v8::Handle<v8::FunctionTemplate> lazyEventListenerToStringTemplate() |
| 85 { | 78 { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // objects have been allocated that we want to take every opportunity | 120 // objects have been allocated that we want to take every opportunity |
| 128 // to collect. | 121 // to collect. |
| 129 void setShouldCollectGarbageSoon() { m_shouldCollectGarbageSoon = true; } | 122 void setShouldCollectGarbageSoon() { m_shouldCollectGarbageSoon = true; } |
| 130 void clearShouldCollectGarbageSoon() { m_shouldCollectGarbageSoon = false; } | 123 void clearShouldCollectGarbageSoon() { m_shouldCollectGarbageSoon = false; } |
| 131 bool shouldCollectGarbageSoon() const { return m_shouldCollectGarbageSoon; } | 124 bool shouldCollectGarbageSoon() const { return m_shouldCollectGarbageSoon; } |
| 132 | 125 |
| 133 v8::Handle<v8::FunctionTemplate> privateTemplate(WrapperWorldType, void* pri
vatePointer, v8::FunctionCallback = 0, v8::Handle<v8::Value> data = v8::Handle<v
8::Value>(), v8::Handle<v8::Signature> = v8::Handle<v8::Signature>(), int length
= 0); | 126 v8::Handle<v8::FunctionTemplate> privateTemplate(WrapperWorldType, void* pri
vatePointer, v8::FunctionCallback = 0, v8::Handle<v8::Value> data = v8::Handle<v
8::Value>(), v8::Handle<v8::Signature> = v8::Handle<v8::Signature>(), int length
= 0); |
| 134 v8::Handle<v8::FunctionTemplate> privateTemplateIfExists(WrapperWorldType, v
oid* privatePointer); | 127 v8::Handle<v8::FunctionTemplate> privateTemplateIfExists(WrapperWorldType, v
oid* privatePointer); |
| 135 void setPrivateTemplate(WrapperWorldType, void* privatePointer, v8::Handle<v
8::FunctionTemplate>); | 128 void setPrivateTemplate(WrapperWorldType, void* privatePointer, v8::Handle<v
8::FunctionTemplate>); |
| 136 | 129 |
| 137 v8::Handle<v8::FunctionTemplate> rawDOMTemplate(const WrapperTypeInfo*, Wrap
perWorldType); | |
| 138 | |
| 139 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, WrapperWorld
Type); | 130 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, WrapperWorld
Type); |
| 140 | 131 |
| 141 v8::Local<v8::Context> ensureRegexContext(); | 132 v8::Local<v8::Context> ensureRegexContext(); |
| 142 | 133 |
| 143 const char* previousSamplingState() const { return m_previousSamplingState;
} | 134 const char* previousSamplingState() const { return m_previousSamplingState;
} |
| 144 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } | 135 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } |
| 145 | 136 |
| 146 private: | 137 private: |
| 147 explicit V8PerIsolateData(v8::Isolate*); | 138 explicit V8PerIsolateData(v8::Isolate*); |
| 148 ~V8PerIsolateData(); | 139 ~V8PerIsolateData(); |
| 149 static void constructorOfToString(const v8::FunctionCallbackInfo<v8::Value>&
); | 140 static void constructorOfToString(const v8::FunctionCallbackInfo<v8::Value>&
); |
| 150 | 141 |
| 151 v8::Isolate* m_isolate; | 142 v8::Isolate* m_isolate; |
| 152 TemplateMap m_rawDOMTemplatesForMainWorld; | |
| 153 TemplateMap m_rawDOMTemplatesForNonMainWorld; | |
| 154 TemplateMap m_templatesForMainWorld; | 143 TemplateMap m_templatesForMainWorld; |
| 155 TemplateMap m_templatesForNonMainWorld; | 144 TemplateMap m_templatesForNonMainWorld; |
| 156 ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate; | 145 ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate; |
| 157 v8::Persistent<v8::FunctionTemplate> m_lazyEventListenerToStringTemplate; | 146 v8::Persistent<v8::FunctionTemplate> m_lazyEventListenerToStringTemplate; |
| 158 OwnPtr<StringCache> m_stringCache; | 147 OwnPtr<StringCache> m_stringCache; |
| 159 | 148 |
| 160 Vector<DOMDataStore*> m_domDataList; | 149 Vector<DOMDataStore*> m_domDataList; |
| 161 DOMDataStore* m_workerDomDataStore; | 150 DOMDataStore* m_workerDomDataStore; |
| 162 | 151 |
| 163 OwnPtr<V8HiddenPropertyName> m_hiddenPropertyName; | 152 OwnPtr<V8HiddenPropertyName> m_hiddenPropertyName; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 174 #ifndef NDEBUG | 163 #ifndef NDEBUG |
| 175 int m_internalScriptRecursionLevel; | 164 int m_internalScriptRecursionLevel; |
| 176 #endif | 165 #endif |
| 177 OwnPtr<GCEventData> m_gcEventData; | 166 OwnPtr<GCEventData> m_gcEventData; |
| 178 bool m_shouldCollectGarbageSoon; | 167 bool m_shouldCollectGarbageSoon; |
| 179 }; | 168 }; |
| 180 | 169 |
| 181 } // namespace WebCore | 170 } // namespace WebCore |
| 182 | 171 |
| 183 #endif // V8PerIsolateData_h | 172 #endif // V8PerIsolateData_h |
| OLD | NEW |