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

Side by Side Diff: Source/bindings/tests/results/V8TestTypedefs.cpp

Issue 214143003: Bindings: use |holder| local variable in attribute getters and setters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 "V8TestTypedefs.h" 8 #include "V8TestTypedefs.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 namespace WebCore { 44 namespace WebCore {
45 const WrapperTypeInfo V8TestTypedefs::wrapperTypeInfo = { gin::kEmbedderBlink, V 8TestTypedefs::domTemplate, V8TestTypedefs::derefObject, 0, 0, 0, V8TestTypedefs ::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, false }; 45 const WrapperTypeInfo V8TestTypedefs::wrapperTypeInfo = { gin::kEmbedderBlink, V 8TestTypedefs::domTemplate, V8TestTypedefs::derefObject, 0, 0, 0, V8TestTypedefs ::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, false };
46 46
47 namespace TestTypedefsV8Internal { 47 namespace TestTypedefsV8Internal {
48 48
49 template <typename T> void V8_USE(T) { } 49 template <typename T> void V8_USE(T) { }
50 50
51 static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v 8::Value>& info) 51 static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v 8::Value>& info)
52 { 52 {
53 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 53 v8::Handle<v8::Object> holder = info.Holder();
54 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
54 v8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongAttr())); 55 v8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongAttr()));
55 } 56 }
56 57
57 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, c onst v8::PropertyCallbackInfo<v8::Value>& info) 58 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, c onst v8::PropertyCallbackInfo<v8::Value>& info)
58 { 59 {
59 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 60 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
60 TestTypedefsV8Internal::unsignedLongLongAttrAttributeGetter(info); 61 TestTypedefsV8Internal::unsignedLongLongAttrAttributeGetter(info);
61 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 62 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
62 } 63 }
63 64
64 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, co nst v8::PropertyCallbackInfo<void>& info) 65 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, co nst v8::PropertyCallbackInfo<void>& info)
65 { 66 {
66 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLo ngAttr", "TestTypedefs", info.Holder(), info.GetIsolate()); 67 v8::Isolate* isolate = info.GetIsolate();
67 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 68 v8::Handle<v8::Object> holder = info.Holder();
69 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLo ngAttr", "TestTypedefs", holder, isolate);
70 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
68 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(jsValue, ex ceptionState), exceptionState); 71 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(jsValue, ex ceptionState), exceptionState);
69 impl->setUnsignedLongLongAttr(cppValue); 72 impl->setUnsignedLongLongAttr(cppValue);
70 } 73 }
71 74
72 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v 8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 75 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v 8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
73 { 76 {
74 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 77 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
75 TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info); 78 TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info);
76 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 79 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
77 } 80 }
78 81
79 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info) 82 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info)
80 { 83 {
81 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 84 v8::Isolate* isolate = info.GetIsolate();
82 ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetter Exception", "TestTypedefs", info.Holder(), info.GetIsolate()); 85 v8::Handle<v8::Object> holder = info.Holder();
86 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
87 ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetter Exception", "TestTypedefs", holder, isolate);
83 int jsValue = impl->attrWithGetterException(exceptionState); 88 int jsValue = impl->attrWithGetterException(exceptionState);
84 if (UNLIKELY(exceptionState.throwIfNeeded())) 89 if (UNLIKELY(exceptionState.throwIfNeeded()))
85 return; 90 return;
86 v8SetReturnValueInt(info, jsValue); 91 v8SetReturnValueInt(info, jsValue);
87 } 92 }
88 93
89 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info) 94 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info)
90 { 95 {
91 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 96 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
92 TestTypedefsV8Internal::attrWithGetterExceptionAttributeGetter(info); 97 TestTypedefsV8Internal::attrWithGetterExceptionAttributeGetter(info);
93 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 98 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
94 } 99 }
95 100
96 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 101 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
97 { 102 {
98 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithGetter Exception", "TestTypedefs", info.Holder(), info.GetIsolate()); 103 v8::Isolate* isolate = info.GetIsolate();
99 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 104 v8::Handle<v8::Object> holder = info.Holder();
105 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithGetter Exception", "TestTypedefs", holder, isolate);
106 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
100 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState); 107 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState);
101 impl->setAttrWithGetterException(cppValue); 108 impl->setAttrWithGetterException(cppValue);
102 } 109 }
103 110
104 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 111 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
105 { 112 {
106 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
107 TestTypedefsV8Internal::attrWithGetterExceptionAttributeSetter(jsValue, info ); 114 TestTypedefsV8Internal::attrWithGetterExceptionAttributeSetter(jsValue, info );
108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
109 } 116 }
110 117
111 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info) 118 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info)
112 { 119 {
113 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 120 v8::Handle<v8::Object> holder = info.Holder();
121 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
114 v8SetReturnValueInt(info, impl->attrWithSetterException()); 122 v8SetReturnValueInt(info, impl->attrWithSetterException());
115 } 123 }
116 124
117 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info) 125 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info)
118 { 126 {
119 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 127 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
120 TestTypedefsV8Internal::attrWithSetterExceptionAttributeGetter(info); 128 TestTypedefsV8Internal::attrWithSetterExceptionAttributeGetter(info);
121 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 129 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
122 } 130 }
123 131
124 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 132 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
125 { 133 {
126 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetter Exception", "TestTypedefs", info.Holder(), info.GetIsolate()); 134 v8::Isolate* isolate = info.GetIsolate();
127 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 135 v8::Handle<v8::Object> holder = info.Holder();
136 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetter Exception", "TestTypedefs", holder, isolate);
137 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
128 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState); 138 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState);
129 impl->setAttrWithSetterException(cppValue, exceptionState); 139 impl->setAttrWithSetterException(cppValue, exceptionState);
130 exceptionState.throwIfNeeded(); 140 exceptionState.throwIfNeeded();
131 } 141 }
132 142
133 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 143 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
134 { 144 {
135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
136 TestTypedefsV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info ); 146 TestTypedefsV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info );
137 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
138 } 148 }
139 149
140 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb ackInfo<v8::Value>& info) 150 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb ackInfo<v8::Value>& info)
141 { 151 {
142 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 152 v8::Isolate* isolate = info.GetIsolate();
143 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWith GetterException", "TestTypedefs", info.Holder(), info.GetIsolate()); 153 v8::Handle<v8::Object> holder = info.Holder();
154 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
155 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWith GetterException", "TestTypedefs", holder, isolate);
144 String jsValue = impl->stringAttrWithGetterException(exceptionState); 156 String jsValue = impl->stringAttrWithGetterException(exceptionState);
145 if (UNLIKELY(exceptionState.throwIfNeeded())) 157 if (UNLIKELY(exceptionState.throwIfNeeded()))
146 return; 158 return;
147 v8SetReturnValueString(info, jsValue, info.GetIsolate()); 159 v8SetReturnValueString(info, jsValue, info.GetIsolate());
148 } 160 }
149 161
150 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info) 162 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info)
151 { 163 {
152 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
153 TestTypedefsV8Internal::stringAttrWithGetterExceptionAttributeGetter(info); 165 TestTypedefsV8Internal::stringAttrWithGetterExceptionAttributeGetter(info);
154 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 166 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
155 } 167 }
156 168
157 static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> js Value, const v8::PropertyCallbackInfo<void>& info) 169 static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> js Value, const v8::PropertyCallbackInfo<void>& info)
158 { 170 {
159 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 171 v8::Handle<v8::Object> holder = info.Holder();
172 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
160 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 173 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
161 impl->setStringAttrWithGetterException(cppValue); 174 impl->setStringAttrWithGetterException(cppValue);
162 } 175 }
163 176
164 static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info ) 177 static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info )
165 { 178 {
166 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 179 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
167 TestTypedefsV8Internal::stringAttrWithGetterExceptionAttributeSetter(jsValue , info); 180 TestTypedefsV8Internal::stringAttrWithGetterExceptionAttributeSetter(jsValue , info);
168 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 181 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
169 } 182 }
170 183
171 static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallb ackInfo<v8::Value>& info) 184 static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallb ackInfo<v8::Value>& info)
172 { 185 {
173 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 186 v8::Handle<v8::Object> holder = info.Holder();
187 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
174 v8SetReturnValueString(info, impl->stringAttrWithSetterException(), info.Get Isolate()); 188 v8SetReturnValueString(info, impl->stringAttrWithSetterException(), info.Get Isolate());
175 } 189 }
176 190
177 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info) 191 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info)
178 { 192 {
179 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 193 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
180 TestTypedefsV8Internal::stringAttrWithSetterExceptionAttributeGetter(info); 194 TestTypedefsV8Internal::stringAttrWithSetterExceptionAttributeGetter(info);
181 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 195 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
182 } 196 }
183 197
184 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js Value, const v8::PropertyCallbackInfo<void>& info) 198 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js Value, const v8::PropertyCallbackInfo<void>& info)
185 { 199 {
186 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWith SetterException", "TestTypedefs", info.Holder(), info.GetIsolate()); 200 v8::Isolate* isolate = info.GetIsolate();
187 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 201 v8::Handle<v8::Object> holder = info.Holder();
202 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWith SetterException", "TestTypedefs", holder, isolate);
203 TestTypedefs* impl = V8TestTypedefs::toNative(holder);
188 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 204 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
189 impl->setStringAttrWithSetterException(cppValue, exceptionState); 205 impl->setStringAttrWithSetterException(cppValue, exceptionState);
190 exceptionState.throwIfNeeded(); 206 exceptionState.throwIfNeeded();
191 } 207 }
192 208
193 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info ) 209 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info )
194 { 210 {
195 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
196 TestTypedefsV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue , info); 212 TestTypedefsV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue , info);
197 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 213 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 fromInternalPointer(object)->deref(); 535 fromInternalPointer(object)->deref();
520 } 536 }
521 537
522 template<> 538 template<>
523 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 539 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
524 { 540 {
525 return toV8(impl, creationContext, isolate); 541 return toV8(impl, creationContext, isolate);
526 } 542 }
527 543
528 } // namespace WebCore 544 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698