| OLD | NEW |
| 1 /* | 1 /* |
| 2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
| 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
| 4 | 4 |
| 5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
| 6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
| 7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
| 8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
| 9 | 9 |
| 10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 { | 74 { |
| 75 TestEventConstructor* imp = V8TestEventConstructor::toNative(info.Holder()); | 75 TestEventConstructor* imp = V8TestEventConstructor::toNative(info.Holder()); |
| 76 return v8String(imp->attr2(), info.GetIsolate(), ReturnUnsafeHandle); | 76 return v8String(imp->attr2(), info.GetIsolate(), ReturnUnsafeHandle); |
| 77 } | 77 } |
| 78 | 78 |
| 79 static v8::Handle<v8::Value> attr2AttrGetterCallback(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | 79 static v8::Handle<v8::Value> attr2AttrGetterCallback(v8::Local<v8::String> name,
const v8::AccessorInfo& info) |
| 80 { | 80 { |
| 81 return TestEventConstructorV8Internal::attr2AttrGetter(name, info); | 81 return TestEventConstructorV8Internal::attr2AttrGetter(name, info); |
| 82 } | 82 } |
| 83 | 83 |
| 84 static v8::Handle<v8::Value> constructor(const v8::Arguments& args) | 84 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args) |
| 85 { | 85 { |
| 86 if (args.Length() < 1) | 86 if (args.Length() < 1) { |
| 87 return throwNotEnoughArgumentsError(args.GetIsolate()); | 87 throwNotEnoughArgumentsError(args.GetIsolate()); |
| 88 return; |
| 89 } |
| 88 | 90 |
| 89 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, args[0]); | 91 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]); |
| 90 TestEventConstructorInit eventInit; | 92 TestEventConstructorInit eventInit; |
| 91 if (args.Length() >= 2) { | 93 if (args.Length() >= 2) { |
| 92 V8TRYCATCH(Dictionary, options, Dictionary(args[1], args.GetIsolate())); | 94 V8TRYCATCH_VOID(Dictionary, options, Dictionary(args[1], args.GetIsolate
())); |
| 93 if (!fillTestEventConstructorInit(eventInit, options)) | 95 if (!fillTestEventConstructorInit(eventInit, options)) |
| 94 return v8Undefined(); | 96 return; |
| 95 } | 97 } |
| 96 | 98 |
| 97 RefPtr<TestEventConstructor> event = TestEventConstructor::create(type, even
tInit); | 99 RefPtr<TestEventConstructor> event = TestEventConstructor::create(type, even
tInit); |
| 98 | 100 |
| 99 v8::Handle<v8::Object> wrapper = args.Holder(); | 101 v8::Handle<v8::Object> wrapper = args.Holder(); |
| 100 V8DOMWrapper::associateObjectWithWrapper(event.release(), &V8TestEventConstr
uctor::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); | 102 V8DOMWrapper::associateObjectWithWrapper(event.release(), &V8TestEventConstr
uctor::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); |
| 101 return wrapper; | 103 args.GetReturnValue().Set(wrapper); |
| 102 } | 104 } |
| 103 } // namespace TestEventConstructorV8Internal | 105 } // namespace TestEventConstructorV8Internal |
| 104 | 106 |
| 105 static const V8DOMConfiguration::BatchedAttribute V8TestEventConstructorAttrs[]
= { | 107 static const V8DOMConfiguration::BatchedAttribute V8TestEventConstructorAttrs[]
= { |
| 106 // Attribute 'attr1' (Type: 'attribute' ExtAttr: '') | 108 // Attribute 'attr1' (Type: 'attribute' ExtAttr: '') |
| 107 {"attr1", TestEventConstructorV8Internal::attr1AttrGetterCallback, 0, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, | 109 {"attr1", TestEventConstructorV8Internal::attr1AttrGetterCallback, 0, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, |
| 108 // Attribute 'attr2' (Type: 'attribute' ExtAttr: 'InitializedByEventConstruc
tor') | 110 // Attribute 'attr2' (Type: 'attribute' ExtAttr: 'InitializedByEventConstruc
tor') |
| 109 {"attr2", TestEventConstructorV8Internal::attr2AttrGetterCallback, 0, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, | 111 {"attr2", TestEventConstructorV8Internal::attr2AttrGetterCallback, 0, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, |
| 110 }; | 112 }; |
| 111 | 113 |
| 112 bool fillTestEventConstructorInit(TestEventConstructorInit& eventInit, const Dic
tionary& options) | 114 bool fillTestEventConstructorInit(TestEventConstructorInit& eventInit, const Dic
tionary& options) |
| 113 { | 115 { |
| 114 options.get("attr2", eventInit.attr2); | 116 options.get("attr2", eventInit.attr2); |
| 115 return true; | 117 return true; |
| 116 } | 118 } |
| 117 | 119 |
| 118 v8::Handle<v8::Value> V8TestEventConstructor::constructorCallback(const v8::Argu
ments& args) | 120 void V8TestEventConstructor::constructorCallback(const v8::FunctionCallbackInfo<
v8::Value>& args) |
| 119 { | 121 { |
| 120 if (!args.IsConstructCall()) | 122 if (!args.IsConstructCall()) { |
| 121 return throwTypeError("DOM object constructor cannot be called as a func
tion.", args.GetIsolate()); | 123 throwTypeError("DOM object constructor cannot be called as a function.",
args.GetIsolate()); |
| 124 return; |
| 125 } |
| 122 | 126 |
| 123 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) | 127 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { |
| 124 return args.Holder(); | 128 args.GetReturnValue().Set(args.Holder()); |
| 129 return; |
| 130 } |
| 125 | 131 |
| 126 return TestEventConstructorV8Internal::constructor(args); | 132 TestEventConstructorV8Internal::constructor(args); |
| 127 } | 133 } |
| 128 | 134 |
| 129 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestEventConstructorTempl
ate(v8::Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorl
dType currentWorldType) | 135 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestEventConstructorTempl
ate(v8::Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorl
dType currentWorldType) |
| 130 { | 136 { |
| 131 desc->ReadOnlyPrototype(); | 137 desc->ReadOnlyPrototype(); |
| 132 | 138 |
| 133 v8::Local<v8::Signature> defaultSignature; | 139 v8::Local<v8::Signature> defaultSignature; |
| 134 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestEventCon
structor", v8::Persistent<v8::FunctionTemplate>(), V8TestEventConstructor::inter
nalFieldCount, | 140 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestEventCon
structor", v8::Persistent<v8::FunctionTemplate>(), V8TestEventConstructor::inter
nalFieldCount, |
| 135 V8TestEventConstructorAttrs, WTF_ARRAY_LENGTH(V8TestEventConstructorAttr
s), | 141 V8TestEventConstructorAttrs, WTF_ARRAY_LENGTH(V8TestEventConstructorAttr
s), |
| 136 0, 0, isolate, currentWorldType); | 142 0, 0, isolate, currentWorldType); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 installPerContextProperties(wrapper, impl.get(), isolate); | 188 installPerContextProperties(wrapper, impl.get(), isolate); |
| 183 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, Wrap
perConfiguration::Independent); | 189 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, Wrap
perConfiguration::Independent); |
| 184 return wrapper; | 190 return wrapper; |
| 185 } | 191 } |
| 186 void V8TestEventConstructor::derefObject(void* object) | 192 void V8TestEventConstructor::derefObject(void* object) |
| 187 { | 193 { |
| 188 static_cast<TestEventConstructor*>(object)->deref(); | 194 static_cast<TestEventConstructor*>(object)->deref(); |
| 189 } | 195 } |
| 190 | 196 |
| 191 } // namespace WebCore | 197 } // namespace WebCore |
| OLD | NEW |