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