| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 389 |
| 390 static const V8DOMConfiguration::MethodConfiguration V8TestSpecialOperationsIden
tifierRaisesExceptionMethods[] = { | 390 static const V8DOMConfiguration::MethodConfiguration V8TestSpecialOperationsIden
tifierRaisesExceptionMethods[] = { |
| 391 {"item", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::itemMetho
dCallback, 0, 1}, | 391 {"item", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::itemMetho
dCallback, 0, 1}, |
| 392 {"setItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setIte
mMethodCallback, 0, 2}, | 392 {"setItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::setIte
mMethodCallback, 0, 2}, |
| 393 {"deleteItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::del
eteItemMethodCallback, 0, 1}, | 393 {"deleteItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::del
eteItemMethodCallback, 0, 1}, |
| 394 {"namedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::name
dItemMethodCallback, 0, 1}, | 394 {"namedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::name
dItemMethodCallback, 0, 1}, |
| 395 {"setNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::s
etNamedItemMethodCallback, 0, 2}, | 395 {"setNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal::s
etNamedItemMethodCallback, 0, 2}, |
| 396 {"deleteNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal
::deleteNamedItemMethodCallback, 0, 1}, | 396 {"deleteNamedItem", TestSpecialOperationsIdentifierRaisesExceptionV8Internal
::deleteNamedItemMethodCallback, 0, 1}, |
| 397 }; | 397 }; |
| 398 | 398 |
| 399 static void configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(v8
::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWo
rldType currentWorldType) | 399 static void configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(v8
::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) |
| 400 { | 400 { |
| 401 functionTemplate->ReadOnlyPrototype(); | 401 functionTemplate->ReadOnlyPrototype(); |
| 402 | 402 |
| 403 v8::Local<v8::Signature> defaultSignature; | 403 v8::Local<v8::Signature> defaultSignature; |
| 404 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestSpecialOperationsIdentifierRaisesException", v8::Local<v8::FunctionTem
plate>(), V8TestSpecialOperationsIdentifierRaisesException::internalFieldCount, | 404 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestSpecialOperationsIdentifierRaisesException", v8::Local<v8::FunctionTem
plate>(), V8TestSpecialOperationsIdentifierRaisesException::internalFieldCount, |
| 405 0, 0, | 405 0, 0, |
| 406 0, 0, | 406 0, 0, |
| 407 V8TestSpecialOperationsIdentifierRaisesExceptionMethods, WTF_ARRAY_LENGT
H(V8TestSpecialOperationsIdentifierRaisesExceptionMethods), | 407 V8TestSpecialOperationsIdentifierRaisesExceptionMethods, WTF_ARRAY_LENGT
H(V8TestSpecialOperationsIdentifierRaisesExceptionMethods), |
| 408 isolate, currentWorldType); | 408 isolate); |
| 409 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 409 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 410 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 410 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 411 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialO
perationsIdentifierRaisesExceptionV8Internal::indexedPropertyGetterCallback, Tes
tSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertySetterCall
back, 0, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedProper
tyDeleterCallback, indexedPropertyEnumerator<TestSpecialOperationsIdentifierRais
esException>); | 411 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialO
perationsIdentifierRaisesExceptionV8Internal::indexedPropertyGetterCallback, Tes
tSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertySetterCall
back, 0, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedProper
tyDeleterCallback, indexedPropertyEnumerator<TestSpecialOperationsIdentifierRais
esException>); |
| 412 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOpe
rationsIdentifierRaisesExceptionV8Internal::namedPropertyGetterCallback, TestSpe
cialOperationsIdentifierRaisesExceptionV8Internal::namedPropertySetterCallback,
TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyQueryCall
back, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyDel
eterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPro
pertyEnumeratorCallback); | 412 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOpe
rationsIdentifierRaisesExceptionV8Internal::namedPropertyGetterCallback, TestSpe
cialOperationsIdentifierRaisesExceptionV8Internal::namedPropertySetterCallback,
TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyQueryCall
back, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyDel
eterCallback, TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPro
pertyEnumeratorCallback); |
| 413 | 413 |
| 414 // Custom toString template | 414 // Custom toString template |
| 415 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 415 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
| 416 } | 416 } |
| 417 | 417 |
| 418 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsIdentifierRaisesExceptio
n::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType) | 418 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsIdentifierRaisesExceptio
n::domTemplate(v8::Isolate* isolate) |
| 419 { | 419 { |
| 420 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 420 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 421 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 421 V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&w
rapperTypeInfo); |
| 422 if (result != data->templateMap(currentWorldType).end()) | 422 if (result != data->templateMap().end()) |
| 423 return result->value.newLocal(isolate); | 423 return result->value.newLocal(isolate); |
| 424 | 424 |
| 425 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 425 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 426 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 426 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 427 configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(templ, iso
late, currentWorldType); | 427 configureV8TestSpecialOperationsIdentifierRaisesExceptionTemplate(templ, iso
late); |
| 428 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 428 data->templateMap().add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTempl
ate>(isolate, templ)); |
| 429 return templ; | 429 return templ; |
| 430 } | 430 } |
| 431 | 431 |
| 432 bool V8TestSpecialOperationsIdentifierRaisesException::hasInstance(v8::Handle<v8
::Value> jsValue, v8::Isolate* isolate) | 432 bool V8TestSpecialOperationsIdentifierRaisesException::hasInstance(v8::Handle<v8
::Value> jsValue, v8::Isolate* isolate) |
| 433 { | 433 { |
| 434 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e); | 434 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e); |
| 435 } | 435 } |
| 436 | 436 |
| 437 v8::Handle<v8::Object> V8TestSpecialOperationsIdentifierRaisesException::findIns
tanceInPrototypeChain(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate) | 437 v8::Handle<v8::Object> V8TestSpecialOperationsIdentifierRaisesException::findIns
tanceInPrototypeChain(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate) |
| 438 { | 438 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 469 fromInternalPointer(object)->deref(); | 469 fromInternalPointer(object)->deref(); |
| 470 } | 470 } |
| 471 | 471 |
| 472 template<> | 472 template<> |
| 473 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsIdentifierRaisesExceptio
n* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 473 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsIdentifierRaisesExceptio
n* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 474 { | 474 { |
| 475 return toV8(impl, creationContext, isolate); | 475 return toV8(impl, creationContext, isolate); |
| 476 } | 476 } |
| 477 | 477 |
| 478 } // namespace WebCore | 478 } // namespace WebCore |
| OLD | NEW |