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 29 matching lines...) Expand all Loading... |
40 #include "V8TestSubObj.h" | 40 #include "V8TestSubObj.h" |
41 #include "bindings/v8/ExceptionMessages.h" | 41 #include "bindings/v8/ExceptionMessages.h" |
42 #include "bindings/v8/ExceptionState.h" | 42 #include "bindings/v8/ExceptionState.h" |
43 #include "bindings/v8/SerializedScriptValue.h" | 43 #include "bindings/v8/SerializedScriptValue.h" |
44 #include "bindings/v8/V8DOMConfiguration.h" | 44 #include "bindings/v8/V8DOMConfiguration.h" |
45 #include "bindings/v8/V8ObjectConstructor.h" | 45 #include "bindings/v8/V8ObjectConstructor.h" |
46 #include "core/dom/ContextFeatures.h" | 46 #include "core/dom/ContextFeatures.h" |
47 #include "core/dom/Document.h" | 47 #include "core/dom/Document.h" |
48 #include "core/svg/properties/SVGPropertyTearOff.h" | 48 #include "core/svg/properties/SVGPropertyTearOff.h" |
49 #include "platform/TraceEvent.h" | 49 #include "platform/TraceEvent.h" |
50 #include "wtf/UnusedParam.h" | |
51 | 50 |
52 namespace WebCore { | 51 namespace WebCore { |
53 | 52 |
54 static void initializeScriptWrappableForInterface(TestTypedefs* object) | 53 static void initializeScriptWrappableForInterface(TestTypedefs* object) |
55 { | 54 { |
56 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 55 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
57 ScriptWrappable::setTypeInfoInObject(object, &V8TestTypedefs::wrapperTyp
eInfo); | 56 ScriptWrappable::setTypeInfoInObject(object, &V8TestTypedefs::wrapperTyp
eInfo); |
58 else | 57 else |
59 ASSERT_NOT_REACHED(); | 58 ASSERT_NOT_REACHED(); |
60 } | 59 } |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestTypedefsTemplate(v8::Hand
le<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldTyp
e currentWorldType) | 488 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestTypedefsTemplate(v8::Hand
le<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldTyp
e currentWorldType) |
490 { | 489 { |
491 functionTemplate->ReadOnlyPrototype(); | 490 functionTemplate->ReadOnlyPrototype(); |
492 | 491 |
493 v8::Local<v8::Signature> defaultSignature; | 492 v8::Local<v8::Signature> defaultSignature; |
494 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestTypedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internal
FieldCount, | 493 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestTypedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internal
FieldCount, |
495 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes), | 494 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes), |
496 0, 0, | 495 0, 0, |
497 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods), | 496 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods), |
498 isolate, currentWorldType); | 497 isolate, currentWorldType); |
499 UNUSED_PARAM(defaultSignature); | |
500 functionTemplate->SetCallHandler(V8TestTypedefs::constructorCallback); | 498 functionTemplate->SetCallHandler(V8TestTypedefs::constructorCallback); |
501 functionTemplate->SetLength(2); | 499 functionTemplate->SetLength(2); |
502 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 500 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
503 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 501 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
504 UNUSED_PARAM(instanceTemplate); | |
505 UNUSED_PARAM(prototypeTemplate); | |
506 functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "Te
stSubObj", v8::String::kInternalizedString), TestTypedefsV8Internal::TestTypedef
sConstructorGetter, 0, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&
V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum
), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAU
LT)); | 502 functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "Te
stSubObj", v8::String::kInternalizedString), TestTypedefsV8Internal::TestTypedef
sConstructorGetter, 0, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&
V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum
), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAU
LT)); |
507 | 503 |
508 // Custom toString template | 504 // Custom toString template |
509 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 505 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
510 return functionTemplate; | 506 return functionTemplate; |
511 } | 507 } |
512 | 508 |
513 v8::Handle<v8::FunctionTemplate> V8TestTypedefs::domTemplate(v8::Isolate* isolat
e, WrapperWorldType currentWorldType) | 509 v8::Handle<v8::FunctionTemplate> V8TestTypedefs::domTemplate(v8::Isolate* isolat
e, WrapperWorldType currentWorldType) |
514 { | 510 { |
515 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 511 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 fromInternalPointer(object)->deref(); | 558 fromInternalPointer(object)->deref(); |
563 } | 559 } |
564 | 560 |
565 template<> | 561 template<> |
566 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 562 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) |
567 { | 563 { |
568 return toV8(impl, creationContext, isolate); | 564 return toV8(impl, creationContext, isolate); |
569 } | 565 } |
570 | 566 |
571 } // namespace WebCore | 567 } // namespace WebCore |
OLD | NEW |