2 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
34 #include "V8TestSpecialOperationsIdentifierRaisesException.h"
36 #include "RuntimeEnabledFeatures.h"
37 #include "V8TestInterfaceEmpty.h"
38 #include "bindings/v8/ExceptionState.h"
39 #include "bindings/v8/V8DOMConfiguration.h"
40 #include "bindings/v8/V8ObjectConstructor.h"
41 #include "core/dom/ContextFeatures.h"
42 #include "core/dom/Document.h"
43 #include "platform/TraceEvent.h"
44 #include "wtf/GetPtr.h"
45 #include "wtf/RefPtr.h"
49 static void initializeScriptWrappableForInterface(TestSpecialOperationsIdentifierRaisesException* object)
51 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
52 ScriptWrappable::setTypeInfoInObject(object, &V8TestSpecialOperationsIdentifierRaisesException::wrapperTypeInfo);
57 } // namespace WebCore
59 // In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
60 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
61 // in the global namespace.
62 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
63 void webCoreInitializeScriptWrappableForInterface(WebCore::TestSpecialOperationsIdentifierRaisesException* object)
65 WebCore::initializeScriptWrappableForInterface(object);
69 const WrapperTypeInfo V8TestSpecialOperationsIdentifierRaisesException::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestSpecialOperationsIdentifierRaisesException::domTemplate, V8TestSpecialOperationsIdentifierRaisesException::derefObject, 0, 0, 0, V8TestSpecialOperationsIdentifierRaisesException::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, false };
71 namespace TestSpecialOperationsIdentifierRaisesExceptionV8Internal {
73 template <typename T> void V8_USE(T) { }
75 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
77 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
78 if (UNLIKELY(info.Length() < 1)) {
79 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
80 exceptionState.throwIfNeeded();
83 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
84 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState), exceptionState);
85 RefPtr<TestInterfaceEmpty> result = imp->item(index, exceptionState);
86 if (exceptionState.throwIfNeeded())
88 v8SetReturnValue(info, result.release());
91 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
93 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
94 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::itemMethod(info);
95 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
98 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
100 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
101 if (UNLIKELY(info.Length() < 2)) {
102 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
103 exceptionState.throwIfNeeded();
106 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
107 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState), exceptionState);
108 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, value, info[1]);
109 String result = imp->setItem(index, value, exceptionState);
110 if (exceptionState.throwIfNeeded())
112 v8SetReturnValueString(info, result, info.GetIsolate());
115 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
118 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setItemMethod(info);
119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
122 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
124 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
125 if (UNLIKELY(info.Length() < 1)) {
126 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
127 exceptionState.throwIfNeeded();
130 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
131 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState), exceptionState);
132 bool result = imp->deleteItem(index, exceptionState);
133 if (exceptionState.throwIfNeeded())
135 v8SetReturnValueBool(info, result);
138 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
140 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
141 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteItemMethod(info);
142 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
145 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
147 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
148 if (UNLIKELY(info.Length() < 1)) {
149 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
150 exceptionState.throwIfNeeded();
153 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
154 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
155 RefPtr<TestInterfaceEmpty> result = imp->namedItem(name, exceptionState);
156 if (exceptionState.throwIfNeeded())
158 v8SetReturnValue(info, result.release());
161 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
163 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
164 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedItemMethod(info);
165 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
168 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
170 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
171 if (UNLIKELY(info.Length() < 2)) {
172 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
173 exceptionState.throwIfNeeded();
176 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
177 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
178 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, value, info[1]);
179 String result = imp->setNamedItem(name, value, exceptionState);
180 if (exceptionState.throwIfNeeded())
182 v8SetReturnValueString(info, result, info.GetIsolate());
185 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
187 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
188 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setNamedItemMethod(info);
189 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
192 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
194 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamedItem", "TestSpecialOperationsIdentifierRaisesException", info.Holder(), info.GetIsolate());
195 if (UNLIKELY(info.Length() < 1)) {
196 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
197 exceptionState.throwIfNeeded();
200 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
201 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
202 bool result = imp->deleteNamedItem(name, exceptionState);
203 if (exceptionState.throwIfNeeded())
205 v8SetReturnValueBool(info, result);
208 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
210 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
211 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteNamedItemMethod(info);
212 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
215 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
217 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
218 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
219 RefPtr<TestInterfaceEmpty> result = imp->item(index, exceptionState);
220 if (exceptionState.throwIfNeeded())
224 v8SetReturnValueFast(info, result.release(), imp);
227 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
229 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
230 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyGetter(index, info);
231 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
234 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
236 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
237 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsValue);
238 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
239 bool result = imp->setItem(index, propertyValue, exceptionState);
240 if (exceptionState.throwIfNeeded())
244 v8SetReturnValue(info, jsValue);
247 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
249 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
250 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertySetter(index, jsValue, info);
251 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
254 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
256 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
257 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
258 DeleteResult result = imp->deleteItem(index, exceptionState);
259 if (exceptionState.throwIfNeeded())
261 if (result != DeleteUnknownProperty)
262 return v8SetReturnValueBool(info, result == DeleteSuccess);
265 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
267 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
268 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyDeleter(index, info);
269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
272 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
274 if (info.Holder()->HasRealNamedProperty(name))
276 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
279 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
280 AtomicString propertyName = toCoreAtomicString(name);
281 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
282 RefPtr<TestInterfaceEmpty> result = imp->namedItem(propertyName, exceptionState);
283 if (exceptionState.throwIfNeeded())
287 v8SetReturnValueFast(info, result.release(), imp);
290 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
293 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyGetter(name, info);
294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
297 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
299 if (info.Holder()->HasRealNamedProperty(name))
301 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
304 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
305 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name);
306 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsValue);
307 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
308 bool result = imp->setNamedItem(propertyName, propertyValue, exceptionState);
309 if (exceptionState.throwIfNeeded())
313 v8SetReturnValue(info, jsValue);
316 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
318 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
319 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertySetter(name, jsValue, info);
320 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
323 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
325 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
326 AtomicString propertyName = toCoreAtomicString(name);
327 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
328 bool result = imp->namedPropertyQuery(propertyName, exceptionState);
329 if (exceptionState.throwIfNeeded())
333 v8SetReturnValueInt(info, v8::None);
336 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
338 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
339 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyQuery(name, info);
340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
343 static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
345 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
346 AtomicString propertyName = toCoreAtomicString(name);
347 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
348 DeleteResult result = imp->deleteNamedItem(propertyName, exceptionState);
349 if (exceptionState.throwIfNeeded())
351 if (result != DeleteUnknownProperty)
352 return v8SetReturnValueBool(info, result == DeleteSuccess);
355 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
357 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
358 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyDeleter(name, info);
359 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
362 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
364 TestSpecialOperationsIdentifierRaisesException* imp = V8TestSpecialOperationsIdentifierRaisesException::toNative(info.Holder());
365 Vector<String> names;
366 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
367 imp->namedPropertyEnumerator(names, exceptionState);
368 if (exceptionState.throwIfNeeded())
370 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
371 for (size_t i = 0; i < names.size(); ++i)
372 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i]));
373 v8SetReturnValue(info, v8names);
376 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
378 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
379 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyEnumerator(info);
380 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
383 } // namespace TestSpecialOperationsIdentifierRaisesExceptionV8Internal
385 static const V8DOMConfiguration::MethodConfiguration V8TestSpecialOperationsIdentifierRaisesExceptionMethods[] = {
386 {"item", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::itemMethodCallback, 0, 1},
387 {"setItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setItemMethodCallback, 0, 2},
388 {"deleteItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteItemMethodCallback, 0, 1},
389 {"namedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedItemMethodCallback, 0, 1},
390 {"setNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setNamedItemMethodCallback, 0, 2},
391 {"deleteNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::deleteNamedItemMethodCallback, 0, 1},
394 static void configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
396 functionTemplate->ReadOnlyPrototype();
398 v8::Local<v8::Signature> defaultSignature;
399 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestSpecialOperationsIdentifierRaisesException", v8::Local<v8::FunctionTemplate>(), V8TestSpecialOperationsIdentifierRaisesException::internalFieldCount,
402 V8TestSpecialOperationsIdentifierRaisesExceptionMethods, WTF_ARRAY_LENGTH(V8TestSpecialOperationsIdentifierRaisesExceptionMethods),
403 isolate, currentWorldType);
404 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
405 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
406 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyGetterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertySetterCallback, 0, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestSpecialOperationsIdentifierRaisesException>);
407 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyGetterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertySetterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyQueryCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyDeleterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyEnumeratorCallback);
409 // Custom toString template
410 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::current()->toStringTemplate());
413 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsIdentifierRaisesException::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
415 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
416 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
417 if (result != data->templateMap(currentWorldType).end())
418 return result->value.newLocal(isolate);
420 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
421 v8::EscapableHandleScope handleScope(isolate);
422 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
423 configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(templ, isolate, currentWorldType);
424 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
425 return handleScope.Escape(templ);
428 bool V8TestSpecialOperationsIdentifierRaisesException::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
430 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeInfo, jsValue)
431 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTypeInfo, jsValue);
434 v8::Handle<v8::Object> V8TestSpecialOperationsIdentifierRaisesException::createWrapper(PassRefPtr<TestSpecialOperationsIdentifierRaisesException> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
437 ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperationsIdentifierRaisesException>(impl.get(), isolate));
438 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
439 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
440 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
441 // the same object de-ref functions, though, so use that as the basis of the check.
442 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
445 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
446 if (UNLIKELY(wrapper.IsEmpty()))
449 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
450 V8DOMWrapper::associateObjectWithWrapper<V8TestSpecialOperationsIdentifierRaisesException>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
454 void V8TestSpecialOperationsIdentifierRaisesException::derefObject(void* object)
456 fromInternalPointer(object)->deref();
460 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsIdentifierRaisesException* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
462 return toV8(impl, creationContext, isolate);
465 } // namespace WebCore