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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 static v8::Isolate* mainThreadIsolate(); | 66 static v8::Isolate* mainThreadIsolate(); |
67 | 67 |
68 bool isMainThread() { return m_isMainThread; } | 68 bool isMainThread() { return m_isMainThread; } |
69 v8::Isolate* isolate() { return m_isolate; } | 69 v8::Isolate* isolate() { return m_isolate; } |
70 | 70 |
71 typedef HashMap<const void*, UnsafePersistent<v8::FunctionTemplate> > Templa
teMap; | |
72 | |
73 TemplateMap& templateMap(WrapperWorldType worldType) | |
74 { | |
75 if (worldType == MainWorld) | |
76 return m_templatesForMainWorld; | |
77 return m_templatesForNonMainWorld; | |
78 } | |
79 | |
80 v8::Handle<v8::FunctionTemplate> toStringTemplate(); | 71 v8::Handle<v8::FunctionTemplate> toStringTemplate(); |
81 | 72 |
82 StringCache* stringCache() { return m_stringCache.get(); } | 73 StringCache* stringCache() { return m_stringCache.get(); } |
83 | 74 |
84 v8::Persistent<v8::Value>& ensureLiveRoot(); | 75 v8::Persistent<v8::Value>& ensureLiveRoot(); |
85 | 76 |
86 int recursionLevel() const { return m_recursionLevel; } | 77 int recursionLevel() const { return m_recursionLevel; } |
87 int incrementRecursionLevel() { return ++m_recursionLevel; } | 78 int incrementRecursionLevel() { return ++m_recursionLevel; } |
88 int decrementRecursionLevel() { return --m_recursionLevel; } | 79 int decrementRecursionLevel() { return --m_recursionLevel; } |
89 | 80 |
90 bool performingMicrotaskCheckpoint() const { return m_performingMicrotaskChe
ckpoint; } | 81 bool performingMicrotaskCheckpoint() const { return m_performingMicrotaskChe
ckpoint; } |
91 void setPerformingMicrotaskCheckpoint(bool performingMicrotaskCheckpoint) {
m_performingMicrotaskCheckpoint = performingMicrotaskCheckpoint; } | 82 void setPerformingMicrotaskCheckpoint(bool performingMicrotaskCheckpoint) {
m_performingMicrotaskCheckpoint = performingMicrotaskCheckpoint; } |
92 | 83 |
93 #ifndef NDEBUG | 84 #ifndef NDEBUG |
94 int internalScriptRecursionLevel() const { return m_internalScriptRecursionL
evel; } | 85 int internalScriptRecursionLevel() const { return m_internalScriptRecursionL
evel; } |
95 int incrementInternalScriptRecursionLevel() { return ++m_internalScriptRecur
sionLevel; } | 86 int incrementInternalScriptRecursionLevel() { return ++m_internalScriptRecur
sionLevel; } |
96 int decrementInternalScriptRecursionLevel() { return --m_internalScriptRecur
sionLevel; } | 87 int decrementInternalScriptRecursionLevel() { return --m_internalScriptRecur
sionLevel; } |
97 #endif | 88 #endif |
98 | 89 |
99 GCEventData* gcEventData() { return m_gcEventData.get(); } | 90 GCEventData* gcEventData() { return m_gcEventData.get(); } |
100 V8HiddenValue* hiddenValue() { return m_hiddenValue.get(); } | 91 V8HiddenValue* hiddenValue() { return m_hiddenValue.get(); } |
101 | 92 |
102 v8::Handle<v8::FunctionTemplate> domTemplate(WrapperWorldType, void* domTemp
lateKey, v8::FunctionCallback = 0, v8::Handle<v8::Value> data = v8::Handle<v8::V
alue>(), v8::Handle<v8::Signature> = v8::Handle<v8::Signature>(), int length = 0
); | 93 typedef HashMap<const void*, UnsafePersistent<v8::FunctionTemplate> > Templa
teMap; |
103 v8::Handle<v8::FunctionTemplate> existingDOMTemplate(WrapperWorldType, void*
domTemplateKey); | 94 TemplateMap& templateMap(); |
104 void setDOMTemplate(WrapperWorldType, void* domTemplateKey, v8::Handle<v8::F
unctionTemplate>); | 95 v8::Handle<v8::FunctionTemplate> domTemplate(void* domTemplateKey, v8::Funct
ionCallback = 0, v8::Handle<v8::Value> data = v8::Handle<v8::Value>(), v8::Handl
e<v8::Signature> = v8::Handle<v8::Signature>(), int length = 0); |
| 96 v8::Handle<v8::FunctionTemplate> existingDOMTemplate(void* domTemplateKey); |
| 97 void setDOMTemplate(void* domTemplateKey, v8::Handle<v8::FunctionTemplate>); |
105 | 98 |
106 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>); | 99 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>); |
107 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*,
v8::Handle<v8::Value>); | 100 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*,
v8::Handle<v8::Value>); |
108 | 101 |
109 v8::Local<v8::Context> ensureRegexContext(); | 102 v8::Local<v8::Context> ensureRegexContext(); |
110 | 103 |
111 const char* previousSamplingState() const { return m_previousSamplingState;
} | 104 const char* previousSamplingState() const { return m_previousSamplingState;
} |
112 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } | 105 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } |
113 | 106 |
114 private: | 107 private: |
(...skipping 24 matching lines...) Expand all Loading... |
139 #ifndef NDEBUG | 132 #ifndef NDEBUG |
140 int m_internalScriptRecursionLevel; | 133 int m_internalScriptRecursionLevel; |
141 #endif | 134 #endif |
142 OwnPtr<GCEventData> m_gcEventData; | 135 OwnPtr<GCEventData> m_gcEventData; |
143 bool m_performingMicrotaskCheckpoint; | 136 bool m_performingMicrotaskCheckpoint; |
144 }; | 137 }; |
145 | 138 |
146 } // namespace WebCore | 139 } // namespace WebCore |
147 | 140 |
148 #endif // V8PerIsolateData_h | 141 #endif // V8PerIsolateData_h |
OLD | NEW |