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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return from(v8::Isolate::GetCurrent()); | 56 return from(v8::Isolate::GetCurrent()); |
57 } | 57 } |
58 static V8PerIsolateData* from(v8::Isolate* isolate) | 58 static V8PerIsolateData* from(v8::Isolate* isolate) |
59 { | 59 { |
60 ASSERT(isolate); | 60 ASSERT(isolate); |
61 ASSERT(isolate->GetData()); | 61 ASSERT(isolate->GetData()); |
62 return static_cast<V8PerIsolateData*>(isolate->GetData()); | 62 return static_cast<V8PerIsolateData*>(isolate->GetData()); |
63 } | 63 } |
64 static void dispose(v8::Isolate*); | 64 static void dispose(v8::Isolate*); |
65 | 65 |
66 typedef HashMap<void*, UnsafePersistent<v8::FunctionTemplate> > TemplateMap; | 66 typedef HashMap<const void*, UnsafePersistent<v8::FunctionTemplate> > Templa
teMap; |
67 | 67 |
68 TemplateMap& rawTemplateMap(WrapperWorldType worldType) | 68 TemplateMap& rawTemplateMap(WrapperWorldType worldType) |
69 { | 69 { |
70 if (worldType == MainWorld) | 70 if (worldType == MainWorld) |
71 return m_rawTemplatesForMainWorld; | 71 return m_rawTemplatesForMainWorld; |
72 return m_rawTemplatesForNonMainWorld; | 72 return m_rawTemplatesForNonMainWorld; |
73 } | 73 } |
74 | 74 |
75 TemplateMap& templateMap(WrapperWorldType worldType) | 75 TemplateMap& templateMap(WrapperWorldType worldType) |
76 { | 76 { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // objects have been allocated that we want to take every opportunity | 126 // objects have been allocated that we want to take every opportunity |
127 // to collect. | 127 // to collect. |
128 void setShouldCollectGarbageSoon() { m_shouldCollectGarbageSoon = true; } | 128 void setShouldCollectGarbageSoon() { m_shouldCollectGarbageSoon = true; } |
129 void clearShouldCollectGarbageSoon() { m_shouldCollectGarbageSoon = false; } | 129 void clearShouldCollectGarbageSoon() { m_shouldCollectGarbageSoon = false; } |
130 bool shouldCollectGarbageSoon() const { return m_shouldCollectGarbageSoon; } | 130 bool shouldCollectGarbageSoon() const { return m_shouldCollectGarbageSoon; } |
131 | 131 |
132 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); | 132 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); |
133 v8::Handle<v8::FunctionTemplate> privateTemplateIfExists(WrapperWorldType, v
oid* privatePointer); | 133 v8::Handle<v8::FunctionTemplate> privateTemplateIfExists(WrapperWorldType, v
oid* privatePointer); |
134 void setPrivateTemplate(WrapperWorldType, void* privatePointer, v8::Handle<v
8::FunctionTemplate>); | 134 void setPrivateTemplate(WrapperWorldType, void* privatePointer, v8::Handle<v
8::FunctionTemplate>); |
135 | 135 |
136 v8::Handle<v8::FunctionTemplate> rawTemplate(WrapperTypeInfo*, WrapperWorldT
ype); | 136 v8::Handle<v8::FunctionTemplate> rawTemplate(const WrapperTypeInfo*, Wrapper
WorldType); |
137 | 137 |
138 bool hasInstance(WrapperTypeInfo*, v8::Handle<v8::Value>, WrapperWorldType); | 138 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, WrapperWorld
Type); |
139 | 139 |
140 v8::Local<v8::Context> ensureRegexContext(); | 140 v8::Local<v8::Context> ensureRegexContext(); |
141 | 141 |
142 const char* previousSamplingState() const { return m_previousSamplingState;
} | 142 const char* previousSamplingState() const { return m_previousSamplingState;
} |
143 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } | 143 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } |
144 | 144 |
145 private: | 145 private: |
146 explicit V8PerIsolateData(v8::Isolate*); | 146 explicit V8PerIsolateData(v8::Isolate*); |
147 ~V8PerIsolateData(); | 147 ~V8PerIsolateData(); |
148 static void constructorOfToString(const v8::FunctionCallbackInfo<v8::Value>&
); | 148 static void constructorOfToString(const v8::FunctionCallbackInfo<v8::Value>&
); |
(...skipping 24 matching lines...) Expand all Loading... |
173 #ifndef NDEBUG | 173 #ifndef NDEBUG |
174 int m_internalScriptRecursionLevel; | 174 int m_internalScriptRecursionLevel; |
175 #endif | 175 #endif |
176 OwnPtr<GCEventData> m_gcEventData; | 176 OwnPtr<GCEventData> m_gcEventData; |
177 bool m_shouldCollectGarbageSoon; | 177 bool m_shouldCollectGarbageSoon; |
178 }; | 178 }; |
179 | 179 |
180 } // namespace WebCore | 180 } // namespace WebCore |
181 | 181 |
182 #endif // V8PerIsolateData_h | 182 #endif // V8PerIsolateData_h |
OLD | NEW |