Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Side by Side Diff: Source/bindings/tests/results/V8TestSpecialOperationsIdentifierRaisesException.cpp

Issue 217053007: Revert of Make DOMWrapperWorld::current() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revert 213543004 too Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestInterface2.h" 8 #include "V8TestSpecialOperationsIdentifierRaisesException.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
11 #include "V8Interface1.h"
12 #include "V8Interface2.h"
13 #include "V8TestInterfaceEmpty.h" 11 #include "V8TestInterfaceEmpty.h"
14 #include "bindings/v8/ExceptionState.h" 12 #include "bindings/v8/ExceptionState.h"
15 #include "bindings/v8/V8DOMConfiguration.h" 13 #include "bindings/v8/V8DOMConfiguration.h"
16 #include "bindings/v8/V8GCController.h"
17 #include "bindings/v8/V8HiddenValue.h" 14 #include "bindings/v8/V8HiddenValue.h"
18 #include "bindings/v8/V8ObjectConstructor.h" 15 #include "bindings/v8/V8ObjectConstructor.h"
19 #include "core/dom/ContextFeatures.h" 16 #include "core/dom/ContextFeatures.h"
20 #include "core/dom/Document.h" 17 #include "core/dom/Document.h"
21 #include "core/dom/Element.h"
22 #include "core/frame/DOMWindow.h"
23 #include "platform/TraceEvent.h" 18 #include "platform/TraceEvent.h"
24 #include "wtf/GetPtr.h" 19 #include "wtf/GetPtr.h"
25 #include "wtf/RefPtr.h" 20 #include "wtf/RefPtr.h"
26 21
27 namespace WebCore { 22 namespace WebCore {
28 23
29 static void initializeScriptWrappableForInterface(TestInterface2* object) 24 static void initializeScriptWrappableForInterface(TestSpecialOperationsIdentifie rRaisesException* object)
30 { 25 {
31 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 26 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
32 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterface2::wrapperT ypeInfo); 27 ScriptWrappable::setTypeInfoInObject(object, &V8TestSpecialOperationsIde ntifierRaisesException::wrapperTypeInfo);
33 else 28 else
34 ASSERT_NOT_REACHED(); 29 ASSERT_NOT_REACHED();
35 } 30 }
36 31
37 } // namespace WebCore 32 } // namespace WebCore
38 33
39 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterface2* objec t) 34 void webCoreInitializeScriptWrappableForInterface(WebCore::TestSpecialOperations IdentifierRaisesException* object)
40 { 35 {
41 WebCore::initializeScriptWrappableForInterface(object); 36 WebCore::initializeScriptWrappableForInterface(object);
42 } 37 }
43 38
44 namespace WebCore { 39 namespace WebCore {
45 const WrapperTypeInfo V8TestInterface2::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface2::domTemplate, V8TestInterface2::derefObject, 0, 0, V8TestInter face2::visitDOMWrapper, V8TestInterface2::installPerContextEnabledMethods, 0, Wr apperTypeObjectPrototype, false }; 40 const WrapperTypeInfo V8TestSpecialOperationsIdentifierRaisesException::wrapperT ypeInfo = { gin::kEmbedderBlink, V8TestSpecialOperationsIdentifierRaisesExceptio n::domTemplate, V8TestSpecialOperationsIdentifierRaisesException::derefObject, 0 , 0, 0, V8TestSpecialOperationsIdentifierRaisesException::installPerContextEnabl edMethods, 0, WrapperTypeObjectPrototype, false };
46 41
47 namespace TestInterface2V8Internal { 42 namespace TestSpecialOperationsIdentifierRaisesExceptionV8Internal {
48 43
49 template <typename T> void V8_USE(T) { } 44 template <typename T> void V8_USE(T) { }
50 45
51 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 46 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
52 { 47 {
53 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes tInterface2", info.Holder(), info.GetIsolate()); 48 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes tSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
54 if (UNLIKELY(info.Length() < 1)) { 49 if (UNLIKELY(info.Length() < 1)) {
55 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 50 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
56 exceptionState.throwIfNeeded(); 51 exceptionState.throwIfNeeded();
57 return; 52 return;
58 } 53 }
59 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 54 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
60 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState) , exceptionState); 55 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState) , exceptionState);
61 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState); 56 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState);
62 if (exceptionState.throwIfNeeded()) 57 if (exceptionState.throwIfNeeded())
63 return; 58 return;
64 v8SetReturnValue(info, result.release()); 59 v8SetReturnValue(info, result.release());
65 } 60 }
66 61
67 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 62 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
68 { 63 {
69 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 64 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
70 TestInterface2V8Internal::itemMethod(info); 65 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::itemMethod(info);
71 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 66 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
72 } 67 }
73 68
74 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 69 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
75 { 70 {
76 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestInterface2", info.Holder(), info.GetIsolate()); 71 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate( ));
77 if (UNLIKELY(info.Length() < 2)) { 72 if (UNLIKELY(info.Length() < 2)) {
78 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length())); 73 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length()));
79 exceptionState.throwIfNeeded(); 74 exceptionState.throwIfNeeded();
80 return; 75 return;
81 } 76 }
82 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 77 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
83 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState) , exceptionState); 78 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState) , exceptionState);
84 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, value, info[1]); 79 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, value, info[1]);
85 String result = impl->setItem(index, value, exceptionState); 80 String result = impl->setItem(index, value, exceptionState);
86 if (exceptionState.throwIfNeeded()) 81 if (exceptionState.throwIfNeeded())
87 return; 82 return;
88 v8SetReturnValueString(info, result, info.GetIsolate()); 83 v8SetReturnValueString(info, result, info.GetIsolate());
89 } 84 }
90 85
91 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 86 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
92 { 87 {
93 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 88 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
94 TestInterface2V8Internal::setItemMethod(info); 89 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setItemMethod(info );
95 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 90 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
96 } 91 }
97 92
98 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 93 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
99 { 94 {
100 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestInterface2", info.Holder(), info.GetIsolate()); 95 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsola te());
101 if (UNLIKELY(info.Length() < 1)) { 96 if (UNLIKELY(info.Length() < 1)) {
102 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 97 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
103 exceptionState.throwIfNeeded(); 98 exceptionState.throwIfNeeded();
104 return; 99 return;
105 } 100 }
106 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 101 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
107 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState) , exceptionState); 102 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState) , exceptionState);
108 bool result = impl->deleteItem(index, exceptionState); 103 bool result = impl->deleteItem(index, exceptionState);
109 if (exceptionState.throwIfNeeded()) 104 if (exceptionState.throwIfNeeded())
110 return; 105 return;
111 v8SetReturnValueBool(info, result); 106 v8SetReturnValueBool(info, result);
112 } 107 }
113 108
114 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 109 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
115 { 110 {
116 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 111 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
117 TestInterface2V8Internal::deleteItemMethod(info); 112 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteItemMethod(i nfo);
118 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 113 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
119 } 114 }
120 115
121 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 116 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
122 { 117 {
123 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestInterface2", info.Holder(), info.GetIsolate()); 118 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolat e());
124 if (UNLIKELY(info.Length() < 1)) { 119 if (UNLIKELY(info.Length() < 1)) {
125 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 120 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
126 exceptionState.throwIfNeeded(); 121 exceptionState.throwIfNeeded();
127 return; 122 return;
128 } 123 }
129 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 124 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
130 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); 125 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
131 RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState); 126 RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState);
132 if (exceptionState.throwIfNeeded()) 127 if (exceptionState.throwIfNeeded())
133 return; 128 return;
134 v8SetReturnValue(info, result.release()); 129 v8SetReturnValue(info, result.release());
135 } 130 }
136 131
137 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 132 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
138 { 133 {
139 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
140 TestInterface2V8Internal::namedItemMethod(info); 135 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedItemMethod(in fo);
141 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
142 } 137 }
143 138
144 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 139 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
145 { 140 {
146 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestInterface2", info.Holder(), info.GetIsolate()); 141 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIso late());
147 if (UNLIKELY(info.Length() < 2)) { 142 if (UNLIKELY(info.Length() < 2)) {
148 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length())); 143 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length()));
149 exceptionState.throwIfNeeded(); 144 exceptionState.throwIfNeeded();
150 return; 145 return;
151 } 146 }
152 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 147 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
153 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); 148 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
154 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, value, info[1]); 149 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, value, info[1]);
155 String result = impl->setNamedItem(name, value, exceptionState); 150 String result = impl->setNamedItem(name, value, exceptionState);
156 if (exceptionState.throwIfNeeded()) 151 if (exceptionState.throwIfNeeded())
157 return; 152 return;
158 v8SetReturnValueString(info, result, info.GetIsolate()); 153 v8SetReturnValueString(info, result, info.GetIsolate());
159 } 154 }
160 155
161 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info) 156 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)
162 { 157 {
163 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
164 TestInterface2V8Internal::setNamedItemMethod(info); 159 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setNamedItemMethod (info);
165 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
166 } 161 }
167 162
168 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o) 163 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o)
169 { 164 {
170 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestInterface2", info.Holder(), info.GetIsolate()); 165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.Get Isolate());
171 if (UNLIKELY(info.Length() < 1)) { 166 if (UNLIKELY(info.Length() < 1)) {
172 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 167 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
173 exceptionState.throwIfNeeded(); 168 exceptionState.throwIfNeeded();
174 return; 169 return;
175 } 170 }
176 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 171 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
177 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); 172 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
178 bool result = impl->deleteNamedItem(name, exceptionState); 173 bool result = impl->deleteNamedItem(name, exceptionState);
179 if (exceptionState.throwIfNeeded()) 174 if (exceptionState.throwIfNeeded())
180 return; 175 return;
181 v8SetReturnValueBool(info, result); 176 v8SetReturnValueBool(info, result);
182 } 177 }
183 178
184 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info) 179 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info)
185 { 180 {
186 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 181 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
187 TestInterface2V8Internal::deleteNamedItemMethod(info); 182 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteNamedItemMet hod(info);
188 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 183 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
189 } 184 }
190 185
191 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
192 {
193 v8::Isolate* isolate = info.GetIsolate();
194 RefPtr<TestInterface2> impl = TestInterface2::create();
195
196 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), isolate);
197 v8SetReturnValue(info, wrapper);
198 }
199
200 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 186 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
201 { 187 {
202 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 188 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
203 ExceptionState exceptionState(ExceptionState::IndexedGetterContext, "TestInt erface2", info.Holder(), info.GetIsolate()); 189 ExceptionState exceptionState(ExceptionState::IndexedGetterContext, "TestSpe cialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
204 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState); 190 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState);
205 if (exceptionState.throwIfNeeded()) 191 if (exceptionState.throwIfNeeded())
206 return; 192 return;
207 if (!result) 193 if (!result)
208 return; 194 return;
209 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); 195 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
210 } 196 }
211 197
212 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info) 198 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info)
213 { 199 {
214 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); 200 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
215 TestInterface2V8Internal::indexedPropertyGetter(index, info); 201 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyGet ter(index, info);
216 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 202 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
217 } 203 }
218 204
219 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 205 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
220 { 206 {
221 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 207 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
222 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, v8Va lue); 208 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, v8Va lue);
223 ExceptionState exceptionState(ExceptionState::IndexedSetterContext, "TestInt erface2", info.Holder(), info.GetIsolate()); 209 ExceptionState exceptionState(ExceptionState::IndexedSetterContext, "TestSpe cialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
224 bool result = impl->setItem(index, propertyValue, exceptionState); 210 bool result = impl->setItem(index, propertyValue, exceptionState);
225 if (exceptionState.throwIfNeeded()) 211 if (exceptionState.throwIfNeeded())
226 return; 212 return;
227 if (!result) 213 if (!result)
228 return; 214 return;
229 v8SetReturnValue(info, v8Value); 215 v8SetReturnValue(info, v8Value);
230 } 216 }
231 217
232 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 218 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
233 { 219 {
234 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); 220 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
235 TestInterface2V8Internal::indexedPropertySetter(index, v8Value, info); 221 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertySet ter(index, v8Value, info);
236 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 222 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
237 } 223 }
238 224
239 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf o<v8::Boolean>& info) 225 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf o<v8::Boolean>& info)
240 { 226 {
241 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 227 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
242 ExceptionState exceptionState(ExceptionState::IndexedDeletionContext, "TestI nterface2", info.Holder(), info.GetIsolate()); 228 ExceptionState exceptionState(ExceptionState::IndexedDeletionContext, "TestS pecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
243 DeleteResult result = impl->deleteItem(index, exceptionState); 229 DeleteResult result = impl->deleteItem(index, exceptionState);
244 if (exceptionState.throwIfNeeded()) 230 if (exceptionState.throwIfNeeded())
245 return; 231 return;
246 if (result != DeleteUnknownProperty) 232 if (result != DeleteUnknownProperty)
247 return v8SetReturnValueBool(info, result == DeleteSuccess); 233 return v8SetReturnValueBool(info, result == DeleteSuccess);
248 } 234 }
249 235
250 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal lbackInfo<v8::Boolean>& info) 236 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal lbackInfo<v8::Boolean>& info)
251 { 237 {
252 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); 238 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
253 TestInterface2V8Internal::indexedPropertyDeleter(index, info); 239 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyDel eter(index, info);
254 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 240 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
255 } 241 }
256 242
257 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info) 243 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info)
258 { 244 {
259 if (info.Holder()->HasRealNamedProperty(name)) 245 if (info.Holder()->HasRealNamedProperty(name))
260 return; 246 return;
261 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) 247 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
262 return; 248 return;
263 249
264 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 250 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
265 AtomicString propertyName = toCoreAtomicString(name); 251 AtomicString propertyName = toCoreAtomicString(name);
266 v8::String::Utf8Value namedProperty(name); 252 v8::String::Utf8Value namedProperty(name);
267 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate()); 253 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolat e());
268 RefPtr<TestInterfaceEmpty> result = impl->namedItem(propertyName, exceptionS tate); 254 RefPtr<TestInterfaceEmpty> result = impl->namedItem(propertyName, exceptionS tate);
269 if (exceptionState.throwIfNeeded()) 255 if (exceptionState.throwIfNeeded())
270 return; 256 return;
271 if (!result) 257 if (!result)
272 return; 258 return;
273 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); 259 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
274 } 260 }
275 261
276 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info) 262 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info)
277 { 263 {
278 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 264 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
279 TestInterface2V8Internal::namedPropertyGetter(name, info); 265 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyGette r(name, info);
280 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 266 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
281 } 267 }
282 268
283 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 269 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
284 { 270 {
285 if (info.Holder()->HasRealNamedProperty(name)) 271 if (info.Holder()->HasRealNamedProperty(name))
286 return; 272 return;
287 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) 273 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
288 return; 274 return;
289 275
290 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 276 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
291 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name) ; 277 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name) ;
292 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, v8Va lue); 278 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, v8Va lue);
293 v8::String::Utf8Value namedProperty(name); 279 v8::String::Utf8Value namedProperty(name);
294 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate()); 280 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty, "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolat e());
295 bool result = impl->setNamedItem(propertyName, propertyValue, exceptionState ); 281 bool result = impl->setNamedItem(propertyName, propertyValue, exceptionState );
296 if (exceptionState.throwIfNeeded()) 282 if (exceptionState.throwIfNeeded())
297 return; 283 return;
298 if (!result) 284 if (!result)
299 return; 285 return;
300 v8SetReturnValue(info, v8Value); 286 v8SetReturnValue(info, v8Value);
301 } 287 }
302 288
303 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8 ::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 289 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8 ::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
304 { 290 {
305 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 291 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
306 TestInterface2V8Internal::namedPropertySetter(name, v8Value, info); 292 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertySette r(name, v8Value, info);
307 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 293 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
308 } 294 }
309 295
310 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info) 296 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info)
311 { 297 {
312 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 298 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
313 AtomicString propertyName = toCoreAtomicString(name); 299 AtomicString propertyName = toCoreAtomicString(name);
314 v8::String::Utf8Value namedProperty(name); 300 v8::String::Utf8Value namedProperty(name);
315 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate()); 301 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolat e());
316 bool result = impl->namedPropertyQuery(propertyName, exceptionState); 302 bool result = impl->namedPropertyQuery(propertyName, exceptionState);
317 if (exceptionState.throwIfNeeded()) 303 if (exceptionState.throwIfNeeded())
318 return; 304 return;
319 if (!result) 305 if (!result)
320 return; 306 return;
321 v8SetReturnValueInt(info, v8::None); 307 v8SetReturnValueInt(info, v8::None);
322 } 308 }
323 309
324 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info) 310 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info)
325 { 311 {
326 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 312 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
327 TestInterface2V8Internal::namedPropertyQuery(name, info); 313 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyQuery (name, info);
328 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 314 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
329 } 315 }
330 316
331 static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyC allbackInfo<v8::Boolean>& info) 317 static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyC allbackInfo<v8::Boolean>& info)
332 { 318 {
333 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 319 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
334 AtomicString propertyName = toCoreAtomicString(name); 320 AtomicString propertyName = toCoreAtomicString(name);
335 v8::String::Utf8Value namedProperty(name); 321 v8::String::Utf8Value namedProperty(name);
336 ExceptionState exceptionState(ExceptionState::DeletionContext, *namedPropert y, "TestInterface2", info.Holder(), info.GetIsolate()); 322 ExceptionState exceptionState(ExceptionState::DeletionContext, *namedPropert y, "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsol ate());
337 DeleteResult result = impl->deleteNamedItem(propertyName, exceptionState); 323 DeleteResult result = impl->deleteNamedItem(propertyName, exceptionState);
338 if (exceptionState.throwIfNeeded()) 324 if (exceptionState.throwIfNeeded())
339 return; 325 return;
340 if (result != DeleteUnknownProperty) 326 if (result != DeleteUnknownProperty)
341 return v8SetReturnValueBool(info, result == DeleteSuccess); 327 return v8SetReturnValueBool(info, result == DeleteSuccess);
342 } 328 }
343 329
344 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::P ropertyCallbackInfo<v8::Boolean>& info) 330 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::P ropertyCallbackInfo<v8::Boolean>& info)
345 { 331 {
346 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 332 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
347 TestInterface2V8Internal::namedPropertyDeleter(name, info); 333 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyDelet er(name, info);
348 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 334 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
349 } 335 }
350 336
351 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) 337 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo)
352 { 338 {
353 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 339 TestSpecialOperationsIdentifierRaisesException* impl = V8TestSpecialOperatio nsIdentifierRaisesException::toNative(info.Holder());
354 v8::Isolate* isolate = info.GetIsolate(); 340 v8::Isolate* isolate = info.GetIsolate();
355 Vector<String> names; 341 Vector<String> names;
356 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter face2", info.Holder(), isolate); 342 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestSpeci alOperationsIdentifierRaisesException", info.Holder(), isolate);
357 impl->namedPropertyEnumerator(names, exceptionState); 343 impl->namedPropertyEnumerator(names, exceptionState);
358 if (exceptionState.throwIfNeeded()) 344 if (exceptionState.throwIfNeeded())
359 return; 345 return;
360 v8::Handle<v8::Array> v8names = v8::Array::New(isolate, names.size()); 346 v8::Handle<v8::Array> v8names = v8::Array::New(isolate, names.size());
361 for (size_t i = 0; i < names.size(); ++i) 347 for (size_t i = 0; i < names.size(); ++i)
362 v8names->Set(v8::Integer::New(isolate, i), v8String(isolate, names[i])); 348 v8names->Set(v8::Integer::New(isolate, i), v8String(isolate, names[i]));
363 v8SetReturnValue(info, v8names); 349 v8SetReturnValue(info, v8names);
364 } 350 }
365 351
366 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 352 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
367 { 353 {
368 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 354 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
369 TestInterface2V8Internal::namedPropertyEnumerator(info); 355 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyEnume rator(info);
370 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 356 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
371 } 357 }
372 358
373 } // namespace TestInterface2V8Internal 359 } // namespace TestSpecialOperationsIdentifierRaisesExceptionV8Internal
374 360
375 void V8TestInterface2::visitDOMWrapper(void* object, const v8::Persistent<v8::Ob ject>& wrapper, v8::Isolate* isolate) 361 static const V8DOMConfiguration::MethodConfiguration V8TestSpecialOperationsIden tifierRaisesExceptionMethods[] = {
376 { 362 {"item", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::itemMetho dCallback, 0, 1},
377 TestInterface2* impl = fromInternalPointer(object); 363 {"setItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setIte mMethodCallback, 0, 2},
378 // The ownerNode() method may return a reference or a pointer. 364 {"deleteItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::del eteItemMethodCallback, 0, 1},
379 if (Node* owner = WTF::getPtr(impl->ownerNode())) { 365 {"namedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::name dItemMethodCallback, 0, 1},
380 Node* root = V8GCController::opaqueRootForGC(owner, isolate); 366 {"setNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::s etNamedItemMethodCallback, 0, 2},
381 isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(r oot)), wrapper); 367 {"deleteNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal ::deleteNamedItemMethodCallback, 0, 1},
382 return;
383 }
384 setObjectGroup(object, wrapper, isolate);
385 }
386
387 static const V8DOMConfiguration::MethodConfiguration V8TestInterface2Methods[] = {
388 {"item", TestInterface2V8Internal::itemMethodCallback, 0, 1},
389 {"setItem", TestInterface2V8Internal::setItemMethodCallback, 0, 2},
390 {"deleteItem", TestInterface2V8Internal::deleteItemMethodCallback, 0, 1},
391 {"namedItem", TestInterface2V8Internal::namedItemMethodCallback, 0, 1},
392 {"setNamedItem", TestInterface2V8Internal::setNamedItemMethodCallback, 0, 2} ,
393 {"deleteNamedItem", TestInterface2V8Internal::deleteNamedItemMethodCallback, 0, 1},
394 }; 368 };
395 369
396 void V8TestInterface2::constructorCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) 370 static void configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(v8 ::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
397 {
398 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
399 if (!info.IsConstructCall()) {
400 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test Interface2"), info.GetIsolate());
401 return;
402 }
403
404 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
405 v8SetReturnValue(info, info.Holder());
406 return;
407 }
408
409 TestInterface2V8Internal::constructor(info);
410 }
411
412 static void configureV8TestInterface2Template(v8::Handle<v8::FunctionTemplate> f unctionTemplate, v8::Isolate* isolate)
413 { 371 {
414 functionTemplate->ReadOnlyPrototype(); 372 functionTemplate->ReadOnlyPrototype();
415 373
416 v8::Local<v8::Signature> defaultSignature; 374 v8::Local<v8::Signature> defaultSignature;
417 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterface2", v8::Local<v8::FunctionTemplate>(), V8TestInterface2::inte rnalFieldCount, 375 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestSpecialOperationsIdentifierRaisesException", v8::Local<v8::FunctionTem plate>(), V8TestSpecialOperationsIdentifierRaisesException::internalFieldCount,
418 0, 0, 376 0, 0,
419 0, 0, 377 0, 0,
420 V8TestInterface2Methods, WTF_ARRAY_LENGTH(V8TestInterface2Methods), 378 V8TestSpecialOperationsIdentifierRaisesExceptionMethods, WTF_ARRAY_LENGT H(V8TestSpecialOperationsIdentifierRaisesExceptionMethods),
421 isolate); 379 isolate);
422 functionTemplate->SetCallHandler(V8TestInterface2::constructorCallback);
423 functionTemplate->SetLength(0);
424 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate(); 380 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate();
425 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate(); 381 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate();
426 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestInterfac e2V8Internal::indexedPropertyGetterCallback, TestInterface2V8Internal::indexedPr opertySetterCallback, 0, TestInterface2V8Internal::indexedPropertyDeleterCallbac k, indexedPropertyEnumerator<TestInterface2>); 382 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialO perationsIdentifierRaisesExceptionV8Internal::indexedPropertyGetterCallback, Tes tSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertySetterCall back, 0, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedProper tyDeleterCallback, indexedPropertyEnumerator<TestSpecialOperationsIdentifierRais esException>);
427 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterface2 V8Internal::namedPropertyGetterCallback, TestInterface2V8Internal::namedProperty SetterCallback, TestInterface2V8Internal::namedPropertyQueryCallback, TestInterf ace2V8Internal::namedPropertyDeleterCallback, TestInterface2V8Internal::namedPro pertyEnumeratorCallback); 383 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOpe rationsIdentifierRaisesExceptionV8Internal::namedPropertyGetterCallback, TestSpe cialOperationsIdentifierRaisesExceptionV8Internal::namedPropertySetterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyQueryCall back, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyDel eterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPro pertyEnumeratorCallback);
428 384
429 // Custom toString template 385 // Custom toString template
430 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :current()->toStringTemplate()); 386 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :current()->toStringTemplate());
431 } 387 }
432 388
433 v8::Handle<v8::FunctionTemplate> V8TestInterface2::domTemplate(v8::Isolate* isol ate) 389 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsIdentifierRaisesExceptio n::domTemplate(v8::Isolate* isolate)
434 { 390 {
435 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 391 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
436 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas t<WrapperTypeInfo*>(&wrapperTypeInfo)); 392 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas t<WrapperTypeInfo*>(&wrapperTypeInfo));
437 if (!result.IsEmpty()) 393 if (!result.IsEmpty())
438 return result; 394 return result;
439 395
440 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); 396 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
441 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons tructorMode); 397 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons tructorMode);
442 configureV8TestInterface2Template(result, isolate); 398 configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(result, is olate);
443 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result) ; 399 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result) ;
444 return result; 400 return result;
445 } 401 }
446 402
447 bool V8TestInterface2::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* i solate) 403 bool V8TestSpecialOperationsIdentifierRaisesException::hasInstance(v8::Handle<v8 ::Value> v8Value, v8::Isolate* isolate)
448 { 404 {
449 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e); 405 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e);
450 } 406 }
451 407
452 v8::Handle<v8::Object> V8TestInterface2::findInstanceInPrototypeChain(v8::Handle <v8::Value> v8Value, v8::Isolate* isolate) 408 v8::Handle<v8::Object> V8TestSpecialOperationsIdentifierRaisesException::findIns tanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
453 { 409 {
454 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 410 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
455 } 411 }
456 412
457 TestInterface2* V8TestInterface2::toNativeWithTypeCheck(v8::Isolate* isolate, v8 ::Handle<v8::Value> value) 413 TestSpecialOperationsIdentifierRaisesException* V8TestSpecialOperationsIdentifie rRaisesException::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Val ue> value)
458 { 414 {
459 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0; 415 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0;
460 } 416 }
461 417
462 v8::Handle<v8::Object> wrap(TestInterface2* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate) 418 v8::Handle<v8::Object> V8TestSpecialOperationsIdentifierRaisesException::createW rapper(PassRefPtr<TestSpecialOperationsIdentifierRaisesException> impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate)
463 { 419 {
464 ASSERT(impl); 420 ASSERT(impl);
465 if (impl->isInterface1()) 421 ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperationsIdentifierRaise sException>(impl.get(), isolate));
466 return wrap(toInterface1(impl), creationContext, isolate);
467 if (impl->isInterface2())
468 return wrap(toInterface2(impl), creationContext, isolate);
469 v8::Handle<v8::Object> wrapper = V8TestInterface2::createWrapper(impl, creat ionContext, isolate);
470 return wrapper;
471 }
472
473 v8::Handle<v8::Object> V8TestInterface2::createWrapper(PassRefPtr<TestInterface2 > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
474 {
475 ASSERT(impl);
476 ASSERT(!DOMDataStore::containsWrapper<V8TestInterface2>(impl.get(), isolate) );
477 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 422 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
478 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get()); 423 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get());
479 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have 424 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have
480 // the same object de-ref functions, though, so use that as the basis of the check. 425 // the same object de-ref functions, though, so use that as the basis of the check.
481 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction); 426 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
482 } 427 }
483 428
484 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); 429 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
485 if (UNLIKELY(wrapper.IsEmpty())) 430 if (UNLIKELY(wrapper.IsEmpty()))
486 return wrapper; 431 return wrapper;
487 432
488 installPerContextEnabledProperties(wrapper, impl.get(), isolate); 433 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
489 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface2>(impl, &wrapperTyp eInfo, wrapper, isolate, WrapperConfiguration::Dependent); 434 V8DOMWrapper::associateObjectWithWrapper<V8TestSpecialOperationsIdentifierRa isesException>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::I ndependent);
490 return wrapper; 435 return wrapper;
491 } 436 }
492 437
493 void V8TestInterface2::derefObject(void* object) 438 void V8TestSpecialOperationsIdentifierRaisesException::derefObject(void* object)
494 { 439 {
495 fromInternalPointer(object)->deref(); 440 fromInternalPointer(object)->deref();
496 } 441 }
497 442
498 template<> 443 template<>
499 v8::Handle<v8::Value> toV8NoInline(TestInterface2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 444 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsIdentifierRaisesExceptio n* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
500 { 445 {
501 return toV8(impl, creationContext, isolate); 446 return toV8(impl, creationContext, isolate);
502 } 447 }
503 448
504 } // namespace WebCore 449 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698