Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp

Issue 1193793003: bindings: Makes almost all attributes accessor-type properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestInterfaceWillBeGarbageCollected.h" 8 #include "V8TestInterfaceWillBeGarbageCollected.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 21 matching lines...) Expand all
32 #pragma clang diagnostic pop 32 #pragma clang diagnostic pop
33 #endif 33 #endif
34 34
35 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eWillBeGarbageCollected.h. 35 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eWillBeGarbageCollected.h.
36 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 36 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
37 // bindings/core/v8/ScriptWrappable.h. 37 // bindings/core/v8/ScriptWrappable.h.
38 const WrapperTypeInfo& TestInterfaceWillBeGarbageCollected::s_wrapperTypeInfo = V8TestInterfaceWillBeGarbageCollected::wrapperTypeInfo; 38 const WrapperTypeInfo& TestInterfaceWillBeGarbageCollected::s_wrapperTypeInfo = V8TestInterfaceWillBeGarbageCollected::wrapperTypeInfo;
39 39
40 namespace TestInterfaceWillBeGarbageCollectedV8Internal { 40 namespace TestInterfaceWillBeGarbageCollectedV8Internal {
41 41
42 static void attr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info ) 42 static void attr1AttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info )
43 { 43 {
44 v8::Local<v8::Object> holder = info.Holder(); 44 v8::Local<v8::Object> holder = info.Holder();
45 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl ected::toImpl(holder); 45 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl ected::toImpl(holder);
46 v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl); 46 v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl);
47 } 47 }
48 48
49 static void attr1AttributeGetterCallback(v8::Local<v8::Name>, const v8::Property CallbackInfo<v8::Value>& info) 49 static void attr1AttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info)
50 { 50 {
51 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 51 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
52 TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGetter(info); 52 TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGetter(info);
53 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 53 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
54 } 54 }
55 55
56 static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Propert yCallbackInfo<void>& info) 56 static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Functio nCallbackInfo<v8::Value>& info)
57 { 57 {
58 v8::Local<v8::Object> holder = info.Holder(); 58 v8::Local<v8::Object> holder = info.Holder();
59 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl ected::toImpl(holder); 59 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl ected::toImpl(holder);
60 TestInterfaceWillBeGarbageCollected* cppValue = V8TestInterfaceWillBeGarbage Collected::toImplWithTypeCheck(info.GetIsolate(), v8Value); 60 TestInterfaceWillBeGarbageCollected* cppValue = V8TestInterfaceWillBeGarbage Collected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
61 impl->setAttr1(WTF::getPtr(cppValue)); 61 impl->setAttr1(WTF::getPtr(cppValue));
62 } 62 }
63 63
64 static void attr1AttributeSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Valu e> v8Value, const v8::PropertyCallbackInfo<void>& info) 64 static void attr1AttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info)
65 { 65 {
66 v8::Local<v8::Value> v8Value = info[0];
66 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 67 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
67 TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info); 68 TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info);
68 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 69 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
69 } 70 }
70 71
71 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 72 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
72 { 73 {
73 if (UNLIKELY(info.Length() < 1)) { 74 if (UNLIKELY(info.Length() < 1)) {
74 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "func", "TestInterfaceWillBeGarbageCollected", 1, info.Length() ), info.GetIsolate()); 75 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "func", "TestInterfaceWillBeGarbageCollected", 1, info.Length() ), info.GetIsolate());
75 return; 76 return;
(...skipping 26 matching lines...) Expand all
102 return; 103 return;
103 } 104 }
104 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl = TestInterface WillBeGarbageCollected::create(str); 105 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl = TestInterface WillBeGarbageCollected::create(str);
105 v8::Local<v8::Object> wrapper = info.Holder(); 106 v8::Local<v8::Object> wrapper = info.Holder();
106 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceWillBeGarbageC ollected::wrapperTypeInfo, wrapper); 107 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceWillBeGarbageC ollected::wrapperTypeInfo, wrapper);
107 v8SetReturnValue(info, wrapper); 108 v8SetReturnValue(info, wrapper);
108 } 109 }
109 110
110 } // namespace TestInterfaceWillBeGarbageCollectedV8Internal 111 } // namespace TestInterfaceWillBeGarbageCollectedV8Internal
111 112
112 // Suppress warning: global constructors, because AttributeConfiguration is triv ial 113 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceWillBeGarb ageCollectedAccessors[] = {
113 // and does not depend on another global objects. 114 {"attr1", TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGette rCallback, TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetterCa llback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::DontDelete) , V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOM Configuration::CheckHolder},
114 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
115 #pragma clang diagnostic push
116 #pragma clang diagnostic ignored "-Wglobal-constructors"
117 #endif
118 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceWillBeGar bageCollectedAttributes[] = {
119 {"attr1", TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGette rCallback, TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetterCa llback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS_OVERWRITING), stat ic_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAll Scripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder},
120 }; 115 };
121 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
122 #pragma clang diagnostic pop
123 #endif
124 116
125 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial 117 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial
126 // and does not depend on another global objects. 118 // and does not depend on another global objects.
127 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 119 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
128 #pragma clang diagnostic push 120 #pragma clang diagnostic push
129 #pragma clang diagnostic ignored "-Wglobal-constructors" 121 #pragma clang diagnostic ignored "-Wglobal-constructors"
130 #endif 122 #endif
131 const WrapperTypeInfo V8TestInterfaceWillBeGarbageCollectedConstructor::wrapperT ypeInfo = { gin::kEmbedderBlink, V8TestInterfaceWillBeGarbageCollectedConstructo r::domTemplate, V8TestInterfaceWillBeGarbageCollected::refObject, V8TestInterfac eWillBeGarbageCollected::derefObject, V8TestInterfaceWillBeGarbageCollected::tra ce, 0, 0, V8TestInterfaceWillBeGarbageCollected::preparePrototypeObject, V8TestI nterfaceWillBeGarbageCollected::installConditionallyEnabledProperties, "TestInte rfaceWillBeGarbageCollected", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, Wr apperTypeInfo::ObjectClassId, WrapperTypeInfo::InheritFromEventTarget, WrapperTy peInfo::Independent, WrapperTypeInfo::WillBeGarbageCollectedObject }; 123 const WrapperTypeInfo V8TestInterfaceWillBeGarbageCollectedConstructor::wrapperT ypeInfo = { gin::kEmbedderBlink, V8TestInterfaceWillBeGarbageCollectedConstructo r::domTemplate, V8TestInterfaceWillBeGarbageCollected::refObject, V8TestInterfac eWillBeGarbageCollected::derefObject, V8TestInterfaceWillBeGarbageCollected::tra ce, 0, 0, V8TestInterfaceWillBeGarbageCollected::preparePrototypeObject, V8TestI nterfaceWillBeGarbageCollected::installConditionallyEnabledProperties, "TestInte rfaceWillBeGarbageCollected", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, Wr apperTypeInfo::ObjectClassId, WrapperTypeInfo::InheritFromEventTarget, WrapperTy peInfo::Independent, WrapperTypeInfo::WillBeGarbageCollectedObject };
132 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 124 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
133 #pragma clang diagnostic pop 125 #pragma clang diagnostic pop
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 185
194 TestInterfaceWillBeGarbageCollectedV8Internal::constructor(info); 186 TestInterfaceWillBeGarbageCollectedV8Internal::constructor(info);
195 } 187 }
196 188
197 static void installV8TestInterfaceWillBeGarbageCollectedTemplate(v8::Local<v8::F unctionTemplate> functionTemplate, v8::Isolate* isolate) 189 static void installV8TestInterfaceWillBeGarbageCollectedTemplate(v8::Local<v8::F unctionTemplate> functionTemplate, v8::Isolate* isolate)
198 { 190 {
199 functionTemplate->ReadOnlyPrototype(); 191 functionTemplate->ReadOnlyPrototype();
200 192
201 v8::Local<v8::Signature> defaultSignature; 193 v8::Local<v8::Signature> defaultSignature;
202 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceWillBeGarbageCollected", V8EventTarget::domTemplate( isolate), V8TestInterfaceWillBeGarbageCollected::internalFieldCount, 194 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceWillBeGarbageCollected", V8EventTarget::domTemplate( isolate), V8TestInterfaceWillBeGarbageCollected::internalFieldCount,
203 V8TestInterfaceWillBeGarbageCollectedAttributes, WTF_ARRAY_LENGTH(V8Test InterfaceWillBeGarbageCollectedAttributes),
204 0, 0, 195 0, 0,
196 V8TestInterfaceWillBeGarbageCollectedAccessors, WTF_ARRAY_LENGTH(V8TestI nterfaceWillBeGarbageCollectedAccessors),
205 0, 0); 197 0, 0);
206 functionTemplate->SetCallHandler(V8TestInterfaceWillBeGarbageCollected::cons tructorCallback); 198 functionTemplate->SetCallHandler(V8TestInterfaceWillBeGarbageCollected::cons tructorCallback);
207 functionTemplate->SetLength(1); 199 functionTemplate->SetLength(1);
208 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 200 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
209 ALLOW_UNUSED_LOCAL(instanceTemplate); 201 ALLOW_UNUSED_LOCAL(instanceTemplate);
210 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 202 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
211 ALLOW_UNUSED_LOCAL(prototypeTemplate); 203 ALLOW_UNUSED_LOCAL(prototypeTemplate);
212 const V8DOMConfiguration::MethodConfiguration funcMethodConfiguration = { 204 const V8DOMConfiguration::MethodConfiguration funcMethodConfiguration = {
213 "func", TestInterfaceWillBeGarbageCollectedV8Internal::funcMethodCallbac k, 0, 1, V8DOMConfiguration::ExposedToAllScripts, 205 "func", TestInterfaceWillBeGarbageCollectedV8Internal::funcMethodCallbac k, 0, 1, V8DOMConfiguration::ExposedToAllScripts,
214 }; 206 };
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 } 238 }
247 239
248 void V8TestInterfaceWillBeGarbageCollected::derefObject(ScriptWrappable* scriptW rappable) 240 void V8TestInterfaceWillBeGarbageCollected::derefObject(ScriptWrappable* scriptW rappable)
249 { 241 {
250 #if !ENABLE(OILPAN) 242 #if !ENABLE(OILPAN)
251 scriptWrappable->toImpl<TestInterfaceWillBeGarbageCollected>()->deref(); 243 scriptWrappable->toImpl<TestInterfaceWillBeGarbageCollected>()->deref();
252 #endif 244 #endif
253 } 245 }
254 246
255 } // namespace blink 247 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698