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

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterfaceAccessors.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 "V8TestInterfaceAccessors.h" 8 #include "V8TestInterfaceAccessors.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 97
98 static void exposeJSAccessorAttributeAttributeSetterCallback(const v8::FunctionC allbackInfo<v8::Value>& info) 98 static void exposeJSAccessorAttributeAttributeSetterCallback(const v8::FunctionC allbackInfo<v8::Value>& info)
99 { 99 {
100 v8::Local<v8::Value> v8Value = info[0]; 100 v8::Local<v8::Value> v8Value = info[0];
101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
102 TestInterfaceAccessorsV8Internal::exposeJSAccessorAttributeAttributeSetter(v 8Value, info); 102 TestInterfaceAccessorsV8Internal::exposeJSAccessorAttributeAttributeSetter(v 8Value, info);
103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
104 } 104 }
105 105
106 static void doNotExposeJSAccessorAttributeAttributeGetter(const v8::FunctionCall backInfo<v8::Value>& info) 106 static void doNotExposeJSAccessorAttributeAttributeGetter(const v8::PropertyCall backInfo<v8::Value>& info)
107 { 107 {
108 v8::Local<v8::Object> holder = info.Holder(); 108 v8::Local<v8::Object> holder = info.Holder();
109 TestInterfaceAccessors* impl = V8TestInterfaceAccessors::toImpl(holder); 109 TestInterfaceAccessors* impl = V8TestInterfaceAccessors::toImpl(holder);
110 v8SetReturnValueInt(info, impl->doNotExposeJSAccessorAttribute()); 110 v8SetReturnValueInt(info, impl->doNotExposeJSAccessorAttribute());
111 } 111 }
112 112
113 static void doNotExposeJSAccessorAttributeAttributeGetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) 113 static void doNotExposeJSAccessorAttributeAttributeGetterCallback(v8::Local<v8:: Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
114 { 114 {
115 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 115 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
116 TestInterfaceAccessorsV8Internal::doNotExposeJSAccessorAttributeAttributeGet ter(info); 116 TestInterfaceAccessorsV8Internal::doNotExposeJSAccessorAttributeAttributeGet ter(info);
117 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 117 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
118 } 118 }
119 119
120 static void doNotExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v 8Value, const v8::FunctionCallbackInfo<v8::Value>& info) 120 static void doNotExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<void>& info)
121 { 121 {
122 v8::Local<v8::Object> holder = info.Holder(); 122 v8::Local<v8::Object> holder = info.Holder();
123 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotExposeJSA ccessorAttribute", "TestInterfaceAccessors", holder, info.GetIsolate()); 123 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotExposeJSA ccessorAttribute", "TestInterfaceAccessors", holder, info.GetIsolate());
124 TestInterfaceAccessors* impl = V8TestInterfaceAccessors::toImpl(holder); 124 TestInterfaceAccessors* impl = V8TestInterfaceAccessors::toImpl(holder);
125 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState); 125 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState);
126 if (exceptionState.throwIfNeeded()) 126 if (exceptionState.throwIfNeeded())
127 return; 127 return;
128 impl->setDoNotExposeJSAccessorAttribute(cppValue); 128 impl->setDoNotExposeJSAccessorAttribute(cppValue);
129 } 129 }
130 130
131 static void doNotExposeJSAccessorAttributeAttributeSetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) 131 static void doNotExposeJSAccessorAttributeAttributeSetterCallback(v8::Local<v8:: Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
132 { 132 {
133 v8::Local<v8::Value> v8Value = info[0];
134 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 133 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
135 TestInterfaceAccessorsV8Internal::doNotExposeJSAccessorAttributeAttributeSet ter(v8Value, info); 134 TestInterfaceAccessorsV8Internal::doNotExposeJSAccessorAttributeAttributeSet ter(v8Value, info);
136 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 135 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
137 } 136 }
138 137
139 } // namespace TestInterfaceAccessorsV8Internal 138 } // namespace TestInterfaceAccessorsV8Internal
140 139
140 // Suppress warning: global constructors, because AttributeConfiguration is triv ial
141 // and does not depend on another global objects.
142 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
143 #pragma clang diagnostic push
144 #pragma clang diagnostic ignored "-Wglobal-constructors"
145 #endif
146 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAccessors Attributes[] = {
147 {"doNotExposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::doNotEx poseJSAccessorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal ::doNotExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8 ::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8D OMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfi guration::CheckHolder},
148 };
149 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
150 #pragma clang diagnostic pop
151 #endif
152
141 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceAccessorsA ccessors[] = { 153 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceAccessorsA ccessors[] = {
142 {"noExposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::noExposeJS AccessorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal::noEx poseJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cas t<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8D OMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, 154 {"noExposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::noExposeJS AccessorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal::noEx poseJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessC ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigu ration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration ::CheckHolder},
143 {"exposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::exposeJSAcce ssorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal::exposeJS AccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8:: PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConf iguration::OnPrototype, V8DOMConfiguration::CheckHolder}, 155 {"exposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::exposeJSAcce ssorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal::exposeJS AccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl >(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration ::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::Chec kHolder},
144 {"doNotExposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::doNotEx poseJSAccessorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal ::doNotExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, s tatic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScr ipts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder},
145 }; 156 };
146 157
147 static void installV8TestInterfaceAccessorsTemplate(v8::Local<v8::FunctionTempla te> functionTemplate, v8::Isolate* isolate) 158 static void installV8TestInterfaceAccessorsTemplate(v8::Local<v8::FunctionTempla te> functionTemplate, v8::Isolate* isolate)
148 { 159 {
149 functionTemplate->ReadOnlyPrototype(); 160 functionTemplate->ReadOnlyPrototype();
150 161
151 v8::Local<v8::Signature> defaultSignature; 162 v8::Local<v8::Signature> defaultSignature;
152 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceAccessors", V8TestInterfaceEmpty::domTemplate(isolat e), V8TestInterfaceAccessors::internalFieldCount, 163 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceAccessors", V8TestInterfaceEmpty::domTemplate(isolat e), V8TestInterfaceAccessors::internalFieldCount,
153 0, 0, 164 V8TestInterfaceAccessorsAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAcce ssorsAttributes),
154 V8TestInterfaceAccessorsAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceAcces sorsAccessors), 165 V8TestInterfaceAccessorsAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceAcces sorsAccessors),
155 0, 0); 166 0, 0);
156 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 167 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
157 ALLOW_UNUSED_LOCAL(instanceTemplate); 168 ALLOW_UNUSED_LOCAL(instanceTemplate);
158 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 169 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
159 ALLOW_UNUSED_LOCAL(prototypeTemplate); 170 ALLOW_UNUSED_LOCAL(prototypeTemplate);
160 171
161 // Custom toString template 172 // Custom toString template
162 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate()); 173 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate());
163 } 174 }
(...skipping 22 matching lines...) Expand all
186 { 197 {
187 scriptWrappable->toImpl<TestInterfaceAccessors>()->ref(); 198 scriptWrappable->toImpl<TestInterfaceAccessors>()->ref();
188 } 199 }
189 200
190 void V8TestInterfaceAccessors::derefObject(ScriptWrappable* scriptWrappable) 201 void V8TestInterfaceAccessors::derefObject(ScriptWrappable* scriptWrappable)
191 { 202 {
192 scriptWrappable->toImpl<TestInterfaceAccessors>()->deref(); 203 scriptWrappable->toImpl<TestInterfaceAccessors>()->deref();
193 } 204 }
194 205
195 } // namespace blink 206 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698