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

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

Issue 1226203012: Revert of bindings: Makes almost all attributes accessor-type properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 "V8TestInterfaceOwnProperties.h" 8 #include "V8TestInterfaceOwnProperties.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 19 matching lines...) Expand all
30 #pragma clang diagnostic pop 30 #pragma clang diagnostic pop
31 #endif 31 #endif
32 32
33 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eOwnProperties.h. 33 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eOwnProperties.h.
34 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 34 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
35 // bindings/core/v8/ScriptWrappable.h. 35 // bindings/core/v8/ScriptWrappable.h.
36 const WrapperTypeInfo& TestInterfaceOwnProperties::s_wrapperTypeInfo = V8TestInt erfaceOwnProperties::wrapperTypeInfo; 36 const WrapperTypeInfo& TestInterfaceOwnProperties::s_wrapperTypeInfo = V8TestInt erfaceOwnProperties::wrapperTypeInfo;
37 37
38 namespace TestInterfaceOwnPropertiesV8Internal { 38 namespace TestInterfaceOwnPropertiesV8Internal {
39 39
40 static void noExposeJSAccessorAttributeAttributeGetter(const v8::FunctionCallbac kInfo<v8::Value>& info) 40 static void noExposeJSAccessorAttributeAttributeGetter(const v8::PropertyCallbac kInfo<v8::Value>& info)
41 { 41 {
42 v8::Local<v8::Object> holder = info.Holder(); 42 v8::Local<v8::Object> holder = info.Holder();
43 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er); 43 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er);
44 v8SetReturnValueInt(info, impl->noExposeJSAccessorAttribute()); 44 v8SetReturnValueInt(info, impl->noExposeJSAccessorAttribute());
45 } 45 }
46 46
47 static void noExposeJSAccessorAttributeAttributeGetterCallback(const v8::Functio nCallbackInfo<v8::Value>& info) 47 static void noExposeJSAccessorAttributeAttributeGetterCallback(v8::Local<v8::Nam e>, const v8::PropertyCallbackInfo<v8::Value>& info)
48 { 48 {
49 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 49 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
50 TestInterfaceOwnPropertiesV8Internal::noExposeJSAccessorAttributeAttributeGe tter(info); 50 TestInterfaceOwnPropertiesV8Internal::noExposeJSAccessorAttributeAttributeGe tter(info);
51 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 51 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
52 } 52 }
53 53
54 static void noExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v8Va lue, const v8::FunctionCallbackInfo<v8::Value>& info) 54 static void noExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v8Va lue, const v8::PropertyCallbackInfo<void>& info)
55 { 55 {
56 v8::Local<v8::Object> holder = info.Holder(); 56 v8::Local<v8::Object> holder = info.Holder();
57 ExceptionState exceptionState(ExceptionState::SetterContext, "noExposeJSAcce ssorAttribute", "TestInterfaceOwnProperties", holder, info.GetIsolate()); 57 ExceptionState exceptionState(ExceptionState::SetterContext, "noExposeJSAcce ssorAttribute", "TestInterfaceOwnProperties", holder, info.GetIsolate());
58 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er); 58 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er);
59 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState); 59 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState);
60 if (exceptionState.throwIfNeeded()) 60 if (exceptionState.throwIfNeeded())
61 return; 61 return;
62 impl->setNoExposeJSAccessorAttribute(cppValue); 62 impl->setNoExposeJSAccessorAttribute(cppValue);
63 } 63 }
64 64
65 static void noExposeJSAccessorAttributeAttributeSetterCallback(const v8::Functio nCallbackInfo<v8::Value>& info) 65 static void noExposeJSAccessorAttributeAttributeSetterCallback(v8::Local<v8::Nam e>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
66 { 66 {
67 v8::Local<v8::Value> v8Value = info[0];
68 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 67 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
69 TestInterfaceOwnPropertiesV8Internal::noExposeJSAccessorAttributeAttributeSe tter(v8Value, info); 68 TestInterfaceOwnPropertiesV8Internal::noExposeJSAccessorAttributeAttributeSe tter(v8Value, info);
70 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 69 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
71 } 70 }
72 71
73 static void exposeJSAccessorAttributeAttributeGetter(const v8::FunctionCallbackI nfo<v8::Value>& info) 72 static void exposeJSAccessorAttributeAttributeGetter(const v8::FunctionCallbackI nfo<v8::Value>& info)
74 { 73 {
75 v8::Local<v8::Object> holder = info.Holder(); 74 v8::Local<v8::Object> holder = info.Holder();
76 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er); 75 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er);
77 v8SetReturnValueInt(info, impl->exposeJSAccessorAttribute()); 76 v8SetReturnValueInt(info, impl->exposeJSAccessorAttribute());
(...skipping 18 matching lines...) Expand all
96 } 95 }
97 96
98 static void exposeJSAccessorAttributeAttributeSetterCallback(const v8::FunctionC allbackInfo<v8::Value>& info) 97 static void exposeJSAccessorAttributeAttributeSetterCallback(const v8::FunctionC allbackInfo<v8::Value>& info)
99 { 98 {
100 v8::Local<v8::Value> v8Value = info[0]; 99 v8::Local<v8::Value> v8Value = info[0];
101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 100 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
102 TestInterfaceOwnPropertiesV8Internal::exposeJSAccessorAttributeAttributeSett er(v8Value, info); 101 TestInterfaceOwnPropertiesV8Internal::exposeJSAccessorAttributeAttributeSett er(v8Value, info);
103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 102 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
104 } 103 }
105 104
106 static void doNotExposeJSAccessorAttributeAttributeGetter(const v8::FunctionCall backInfo<v8::Value>& info) 105 static void doNotExposeJSAccessorAttributeAttributeGetter(const v8::PropertyCall backInfo<v8::Value>& info)
107 { 106 {
108 v8::Local<v8::Object> holder = info.Holder(); 107 v8::Local<v8::Object> holder = info.Holder();
109 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er); 108 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er);
110 v8SetReturnValueInt(info, impl->doNotExposeJSAccessorAttribute()); 109 v8SetReturnValueInt(info, impl->doNotExposeJSAccessorAttribute());
111 } 110 }
112 111
113 static void doNotExposeJSAccessorAttributeAttributeGetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) 112 static void doNotExposeJSAccessorAttributeAttributeGetterCallback(v8::Local<v8:: Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
114 { 113 {
115 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 114 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
116 TestInterfaceOwnPropertiesV8Internal::doNotExposeJSAccessorAttributeAttribut eGetter(info); 115 TestInterfaceOwnPropertiesV8Internal::doNotExposeJSAccessorAttributeAttribut eGetter(info);
117 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 116 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
118 } 117 }
119 118
120 static void doNotExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v 8Value, const v8::FunctionCallbackInfo<v8::Value>& info) 119 static void doNotExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<void>& info)
121 { 120 {
122 v8::Local<v8::Object> holder = info.Holder(); 121 v8::Local<v8::Object> holder = info.Holder();
123 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotExposeJSA ccessorAttribute", "TestInterfaceOwnProperties", holder, info.GetIsolate()); 122 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotExposeJSA ccessorAttribute", "TestInterfaceOwnProperties", holder, info.GetIsolate());
124 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er); 123 TestInterfaceOwnProperties* impl = V8TestInterfaceOwnProperties::toImpl(hold er);
125 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState); 124 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState);
126 if (exceptionState.throwIfNeeded()) 125 if (exceptionState.throwIfNeeded())
127 return; 126 return;
128 impl->setDoNotExposeJSAccessorAttribute(cppValue); 127 impl->setDoNotExposeJSAccessorAttribute(cppValue);
129 } 128 }
130 129
131 static void doNotExposeJSAccessorAttributeAttributeSetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) 130 static void doNotExposeJSAccessorAttributeAttributeSetterCallback(v8::Local<v8:: Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
132 { 131 {
133 v8::Local<v8::Value> v8Value = info[0];
134 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 132 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
135 TestInterfaceOwnPropertiesV8Internal::doNotExposeJSAccessorAttributeAttribut eSetter(v8Value, info); 133 TestInterfaceOwnPropertiesV8Internal::doNotExposeJSAccessorAttributeAttribut eSetter(v8Value, info);
136 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 134 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
137 } 135 }
138 136
139 } // namespace TestInterfaceOwnPropertiesV8Internal 137 } // namespace TestInterfaceOwnPropertiesV8Internal
140 138
139 // Suppress warning: global constructors, because AttributeConfiguration is triv ial
140 // and does not depend on another global objects.
141 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
142 #pragma clang diagnostic push
143 #pragma clang diagnostic ignored "-Wglobal-constructors"
144 #endif
145 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceOwnProper tiesAttributes[] = {
146 {"noExposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::noExpo seJSAccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8Intern al::noExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8: :AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DO MConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfig uration::CheckHolder},
147 {"doNotExposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::doN otExposeJSAccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8 Internal::doNotExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static _cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No ne), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8 DOMConfiguration::CheckHolder},
148 };
149 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
150 #pragma clang diagnostic pop
151 #endif
152
141 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceOwnPropert iesAccessors[] = { 153 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceOwnPropert iesAccessors[] = {
142 {"noExposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::noExpo seJSAccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8Intern al::noExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, st atic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScri pts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder}, 154 {"exposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::exposeJS AccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8Internal:: exposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acces sControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfi guration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfigurati on::CheckHolder},
143 {"exposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::exposeJS AccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8Internal:: exposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_c ast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V 8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
144 {"doNotExposeJSAccessorAttribute", TestInterfaceOwnPropertiesV8Internal::doN otExposeJSAccessorAttributeAttributeGetterCallback, TestInterfaceOwnPropertiesV8 Internal::doNotExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DE FAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::Exposed ToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder},
145 }; 155 };
146 156
147 static void installV8TestInterfaceOwnPropertiesTemplate(v8::Local<v8::FunctionTe mplate> functionTemplate, v8::Isolate* isolate) 157 static void installV8TestInterfaceOwnPropertiesTemplate(v8::Local<v8::FunctionTe mplate> functionTemplate, v8::Isolate* isolate)
148 { 158 {
149 functionTemplate->ReadOnlyPrototype(); 159 functionTemplate->ReadOnlyPrototype();
150 160
151 v8::Local<v8::Signature> defaultSignature; 161 v8::Local<v8::Signature> defaultSignature;
152 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceOwnProperties", V8TestInterfaceEmpty::domTemplate(is olate), V8TestInterfaceOwnProperties::internalFieldCount, 162 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceOwnProperties", V8TestInterfaceEmpty::domTemplate(is olate), V8TestInterfaceOwnProperties::internalFieldCount,
153 0, 0, 163 V8TestInterfaceOwnPropertiesAttributes, WTF_ARRAY_LENGTH(V8TestInterface OwnPropertiesAttributes),
154 V8TestInterfaceOwnPropertiesAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceO wnPropertiesAccessors), 164 V8TestInterfaceOwnPropertiesAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceO wnPropertiesAccessors),
155 0, 0); 165 0, 0);
156 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 166 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
157 ALLOW_UNUSED_LOCAL(instanceTemplate); 167 ALLOW_UNUSED_LOCAL(instanceTemplate);
158 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 168 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
159 ALLOW_UNUSED_LOCAL(prototypeTemplate); 169 ALLOW_UNUSED_LOCAL(prototypeTemplate);
160 170
161 // Custom toString template 171 // Custom toString template
162 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate()); 172 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate());
163 } 173 }
(...skipping 22 matching lines...) Expand all
186 { 196 {
187 scriptWrappable->toImpl<TestInterfaceOwnProperties>()->ref(); 197 scriptWrappable->toImpl<TestInterfaceOwnProperties>()->ref();
188 } 198 }
189 199
190 void V8TestInterfaceOwnProperties::derefObject(ScriptWrappable* scriptWrappable) 200 void V8TestInterfaceOwnProperties::derefObject(ScriptWrappable* scriptWrappable)
191 { 201 {
192 scriptWrappable->toImpl<TestInterfaceOwnProperties>()->deref(); 202 scriptWrappable->toImpl<TestInterfaceOwnProperties>()->deref();
193 } 203 }
194 204
195 } // namespace blink 205 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698