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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 2304453004: [Bindings] Expose V8 callback functions in generated code (Closed)
Patch Set: Expose call Callback functions in binding scripts Created 4 years, 3 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
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 "V8TestInterface5.h" 7 #include "V8TestInterface5.h"
8 8
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 namespace TestInterface5ImplementationV8Internal { 55 namespace TestInterface5ImplementationV8Internal {
56 56
57 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) 57 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info)
58 { 58 {
59 v8::Local<v8::Object> holder = info.Holder(); 59 v8::Local<v8::Object> holder = info.Holder();
60 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 60 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
61 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl ); 61 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl );
62 } 62 }
63 63
64 static void testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) 64 void testInterfaceAttributeAttributeGetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
65 { 65 {
66 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGette r(info); 66 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGette r(info);
67 } 67 }
68 68
69 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) 69 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
70 { 70 {
71 v8::Local<v8::Object> holder = info.Holder(); 71 v8::Local<v8::Object> holder = info.Holder();
72 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA ttribute", "TestInterface5", holder, info.GetIsolate()); 72 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA ttribute", "TestInterface5", holder, info.GetIsolate());
73 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 73 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
74 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeChe ck(info.GetIsolate(), v8Value); 74 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeChe ck(info.GetIsolate(), v8Value);
75 if (!cppValue) { 75 if (!cppValue) {
76 exceptionState.throwTypeError("The provided value is not of type 'TestIn terface5'."); 76 exceptionState.throwTypeError("The provided value is not of type 'TestIn terface5'.");
77 return; 77 return;
78 } 78 }
79 impl->setTestInterfaceAttribute(cppValue); 79 impl->setTestInterfaceAttribute(cppValue);
80 } 80 }
81 81
82 static void testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) 82 void testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
83 { 83 {
84 v8::Local<v8::Value> v8Value = info[0]; 84 v8::Local<v8::Value> v8Value = info[0];
85 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSette r(v8Value, info); 85 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSette r(v8Value, info);
86 } 86 }
87 87
88 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va lue>& info) 88 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va lue>& info)
89 { 89 {
90 v8::Local<v8::Object> holder = info.Holder(); 90 v8::Local<v8::Object> holder = info.Holder();
91 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 91 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
92 v8SetReturnValue(info, impl->doubleAttribute()); 92 v8SetReturnValue(info, impl->doubleAttribute());
93 } 93 }
94 94
95 static void doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info) 95 void doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
96 { 96 {
97 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info) ; 97 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info) ;
98 } 98 }
99 99
100 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::FunctionCallbackInfo<v8::Value>& info) 100 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::FunctionCallbackInfo<v8::Value>& info)
101 { 101 {
102 v8::Local<v8::Object> holder = info.Holder(); 102 v8::Local<v8::Object> holder = info.Holder();
103 ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribut e", "TestInterface5", holder, info.GetIsolate()); 103 ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribut e", "TestInterface5", holder, info.GetIsolate());
104 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 104 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
105 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionSt ate); 105 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionSt ate);
106 if (exceptionState.hadException()) 106 if (exceptionState.hadException())
107 return; 107 return;
108 impl->setDoubleAttribute(cppValue); 108 impl->setDoubleAttribute(cppValue);
109 } 109 }
110 110
111 static void doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info) 111 void doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
112 { 112 {
113 v8::Local<v8::Value> v8Value = info[0]; 113 v8::Local<v8::Value> v8Value = info[0];
114 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Val ue, info); 114 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Val ue, info);
115 } 115 }
116 116
117 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val ue>& info) 117 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val ue>& info)
118 { 118 {
119 v8::Local<v8::Object> holder = info.Holder(); 119 v8::Local<v8::Object> holder = info.Holder();
120 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 120 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
121 v8SetReturnValue(info, impl->floatAttribute()); 121 v8SetReturnValue(info, impl->floatAttribute());
122 } 122 }
123 123
124 static void floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo <v8::Value>& info) 124 void floatAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
125 { 125 {
126 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info); 126 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info);
127 } 127 }
128 128
129 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::FunctionCallbackInfo<v8::Value>& info) 129 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::FunctionCallbackInfo<v8::Value>& info)
130 { 130 {
131 v8::Local<v8::Object> holder = info.Holder(); 131 v8::Local<v8::Object> holder = info.Holder();
132 ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute ", "TestInterface5", holder, info.GetIsolate()); 132 ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute ", "TestInterface5", holder, info.GetIsolate());
133 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 133 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
134 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionStat e); 134 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionStat e);
135 if (exceptionState.hadException()) 135 if (exceptionState.hadException())
136 return; 136 return;
137 impl->setFloatAttribute(cppValue); 137 impl->setFloatAttribute(cppValue);
138 } 138 }
139 139
140 static void floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo <v8::Value>& info) 140 void floatAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
141 { 141 {
142 v8::Local<v8::Value> v8Value = info[0]; 142 v8::Local<v8::Value> v8Value = info[0];
143 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Valu e, info); 143 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Valu e, info);
144 } 144 }
145 145
146 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac kInfo<v8::Value>& info) 146 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac kInfo<v8::Value>& info)
147 { 147 {
148 v8::Local<v8::Object> holder = info.Holder(); 148 v8::Local<v8::Object> holder = info.Holder();
149 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 149 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
150 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); 150 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute());
151 } 151 }
152 152
153 static void unrestrictedDoubleAttributeAttributeGetterCallback(const v8::Functio nCallbackInfo<v8::Value>& info) 153 void unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallba ckInfo<v8::Value>& info)
154 { 154 {
155 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute Getter(info); 155 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute Getter(info);
156 } 156 }
157 157
158 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va lue, const v8::FunctionCallbackInfo<v8::Value>& info) 158 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va lue, const v8::FunctionCallbackInfo<v8::Value>& info)
159 { 159 {
160 v8::Local<v8::Object> holder = info.Holder(); 160 v8::Local<v8::Object> holder = info.Holder();
161 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedDo ubleAttribute", "TestInterface5", holder, info.GetIsolate()); 161 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedDo ubleAttribute", "TestInterface5", holder, info.GetIsolate());
162 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 162 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
163 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState); 163 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState);
164 if (exceptionState.hadException()) 164 if (exceptionState.hadException())
165 return; 165 return;
166 impl->setUnrestrictedDoubleAttribute(cppValue); 166 impl->setUnrestrictedDoubleAttribute(cppValue);
167 } 167 }
168 168
169 static void unrestrictedDoubleAttributeAttributeSetterCallback(const v8::Functio nCallbackInfo<v8::Value>& info) 169 void unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallba ckInfo<v8::Value>& info)
170 { 170 {
171 v8::Local<v8::Value> v8Value = info[0]; 171 v8::Local<v8::Value> v8Value = info[0];
172 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute Setter(v8Value, info); 172 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttribute Setter(v8Value, info);
173 } 173 }
174 174
175 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback Info<v8::Value>& info) 175 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback Info<v8::Value>& info)
176 { 176 {
177 v8::Local<v8::Object> holder = info.Holder(); 177 v8::Local<v8::Object> holder = info.Holder();
178 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 178 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
179 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); 179 v8SetReturnValue(info, impl->unrestrictedFloatAttribute());
180 } 180 }
181 181
182 static void unrestrictedFloatAttributeAttributeGetterCallback(const v8::Function CallbackInfo<v8::Value>& info) 182 void unrestrictedFloatAttributeAttributeGetterCallback(const v8::FunctionCallbac kInfo<v8::Value>& info)
183 { 183 {
184 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeG etter(info); 184 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeG etter(info);
185 } 185 }
186 186
187 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val ue, const v8::FunctionCallbackInfo<v8::Value>& info) 187 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val ue, const v8::FunctionCallbackInfo<v8::Value>& info)
188 { 188 {
189 v8::Local<v8::Object> holder = info.Holder(); 189 v8::Local<v8::Object> holder = info.Holder();
190 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedFl oatAttribute", "TestInterface5", holder, info.GetIsolate()); 190 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedFl oatAttribute", "TestInterface5", holder, info.GetIsolate());
191 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 191 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
192 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState); 192 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState);
193 if (exceptionState.hadException()) 193 if (exceptionState.hadException())
194 return; 194 return;
195 impl->setUnrestrictedFloatAttribute(cppValue); 195 impl->setUnrestrictedFloatAttribute(cppValue);
196 } 196 }
197 197
198 static void unrestrictedFloatAttributeAttributeSetterCallback(const v8::Function CallbackInfo<v8::Value>& info) 198 void unrestrictedFloatAttributeAttributeSetterCallback(const v8::FunctionCallbac kInfo<v8::Value>& info)
199 { 199 {
200 v8::Local<v8::Value> v8Value = info[0]; 200 v8::Local<v8::Value> v8Value = info[0];
201 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeS etter(v8Value, info); 201 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeS etter(v8Value, info);
202 } 202 }
203 203
204 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo< v8::Value>& info) 204 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo< v8::Value>& info)
205 { 205 {
206 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttri bute(), info.GetIsolate()); 206 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttri bute(), info.GetIsolate());
207 } 207 }
208 208
209 static void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallb ackInfo<v8::Value>& info) 209 void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo <v8::Value>& info)
210 { 210 {
211 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter (info); 211 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter (info);
212 } 212 }
213 213
214 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c onst v8::FunctionCallbackInfo<v8::Value>& info) 214 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c onst v8::FunctionCallbackInfo<v8::Value>& info)
215 { 215 {
216 V8StringResource<> cppValue = v8Value; 216 V8StringResource<> cppValue = v8Value;
217 if (!cppValue.prepare()) 217 if (!cppValue.prepare())
218 return; 218 return;
219 TestInterface5Implementation::setStaticStringAttribute(cppValue); 219 TestInterface5Implementation::setStaticStringAttribute(cppValue);
220 } 220 }
221 221
222 static void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallb ackInfo<v8::Value>& info) 222 void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo <v8::Value>& info)
223 { 223 {
224 v8::Local<v8::Value> v8Value = info[0]; 224 v8::Local<v8::Value> v8Value = info[0];
225 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter (v8Value, info); 225 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter (v8Value, info);
226 } 226 }
227 227
228 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) 228 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info)
229 { 229 {
230 v8::Local<v8::Object> holder = info.Holder(); 230 v8::Local<v8::Object> holder = info.Holder();
231 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 231 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
232 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); 232 v8SetReturnValueInt(info, impl->alwaysExposedAttribute());
233 } 233 }
234 234
235 static void alwaysExposedAttributeAttributeGetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) 235 void alwaysExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
236 { 236 {
237 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGette r(info); 237 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGette r(info);
238 } 238 }
239 239
240 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) 240 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
241 { 241 {
242 v8::Local<v8::Object> holder = info.Holder(); 242 v8::Local<v8::Object> holder = info.Holder();
243 ExceptionState exceptionState(ExceptionState::SetterContext, "alwaysExposedA ttribute", "TestInterface5", holder, info.GetIsolate()); 243 ExceptionState exceptionState(ExceptionState::SetterContext, "alwaysExposedA ttribute", "TestInterface5", holder, info.GetIsolate());
244 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 244 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
245 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState); 245 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState);
246 if (exceptionState.hadException()) 246 if (exceptionState.hadException())
247 return; 247 return;
248 impl->setAlwaysExposedAttribute(cppValue); 248 impl->setAlwaysExposedAttribute(cppValue);
249 } 249 }
250 250
251 static void alwaysExposedAttributeAttributeSetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) 251 void alwaysExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
252 { 252 {
253 v8::Local<v8::Value> v8Value = info[0]; 253 v8::Local<v8::Value> v8Value = info[0];
254 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSette r(v8Value, info); 254 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSette r(v8Value, info);
255 } 255 }
256 256
257 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) 257 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info)
258 { 258 {
259 v8::Local<v8::Object> holder = info.Holder(); 259 v8::Local<v8::Object> holder = info.Holder();
260 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 260 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
261 v8SetReturnValueInt(info, impl->workerExposedAttribute()); 261 v8SetReturnValueInt(info, impl->workerExposedAttribute());
262 } 262 }
263 263
264 static void workerExposedAttributeAttributeGetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) 264 void workerExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
265 { 265 {
266 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGette r(info); 266 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGette r(info);
267 } 267 }
268 268
269 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) 269 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
270 { 270 {
271 v8::Local<v8::Object> holder = info.Holder(); 271 v8::Local<v8::Object> holder = info.Holder();
272 ExceptionState exceptionState(ExceptionState::SetterContext, "workerExposedA ttribute", "TestInterface5", holder, info.GetIsolate()); 272 ExceptionState exceptionState(ExceptionState::SetterContext, "workerExposedA ttribute", "TestInterface5", holder, info.GetIsolate());
273 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 273 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
274 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState); 274 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState);
275 if (exceptionState.hadException()) 275 if (exceptionState.hadException())
276 return; 276 return;
277 impl->setWorkerExposedAttribute(cppValue); 277 impl->setWorkerExposedAttribute(cppValue);
278 } 278 }
279 279
280 static void workerExposedAttributeAttributeSetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) 280 void workerExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
281 { 281 {
282 v8::Local<v8::Value> v8Value = info[0]; 282 v8::Local<v8::Value> v8Value = info[0];
283 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSette r(v8Value, info); 283 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSette r(v8Value, info);
284 } 284 }
285 285
286 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) 286 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info)
287 { 287 {
288 v8::Local<v8::Object> holder = info.Holder(); 288 v8::Local<v8::Object> holder = info.Holder();
289 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 289 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
290 v8SetReturnValueInt(info, impl->windowExposedAttribute()); 290 v8SetReturnValueInt(info, impl->windowExposedAttribute());
291 } 291 }
292 292
293 static void windowExposedAttributeAttributeGetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) 293 void windowExposedAttributeAttributeGetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
294 { 294 {
295 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGette r(info); 295 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGette r(info);
296 } 296 }
297 297
298 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) 298 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
299 { 299 {
300 v8::Local<v8::Object> holder = info.Holder(); 300 v8::Local<v8::Object> holder = info.Holder();
301 ExceptionState exceptionState(ExceptionState::SetterContext, "windowExposedA ttribute", "TestInterface5", holder, info.GetIsolate()); 301 ExceptionState exceptionState(ExceptionState::SetterContext, "windowExposedA ttribute", "TestInterface5", holder, info.GetIsolate());
302 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 302 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
303 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState); 303 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti onState);
304 if (exceptionState.hadException()) 304 if (exceptionState.hadException())
305 return; 305 return;
306 impl->setWindowExposedAttribute(cppValue); 306 impl->setWindowExposedAttribute(cppValue);
307 } 307 }
308 308
309 static void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) 309 void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
310 { 310 {
311 v8::Local<v8::Value> v8Value = info[0]; 311 v8::Local<v8::Value> v8Value = info[0];
312 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSette r(v8Value, info); 312 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSette r(v8Value, info);
313 } 313 }
314 314
315 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 315 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
316 { 316 {
317 if (UNLIKELY(info.Length() < 1)) { 317 if (UNLIKELY(info.Length() < 1)) {
318 V8ThrowException::throwException(info.GetIsolate(), createMinimumArityTy peErrorForMethod(info.GetIsolate(), "voidMethodTestInterfaceEmptyArg", "TestInte rface5", 1, info.Length())); 318 V8ThrowException::throwException(info.GetIsolate(), createMinimumArityTy peErrorForMethod(info.GetIsolate(), "voidMethodTestInterfaceEmptyArg", "TestInte rface5", 1, info.Length()));
319 return; 319 return;
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 638
639 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 639 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
640 { 640 {
641 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 641 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
642 String result = impl->anonymousIndexedGetter(index); 642 String result = impl->anonymousIndexedGetter(index);
643 if (result.isNull()) 643 if (result.isNull())
644 return; 644 return;
645 v8SetReturnValueString(info, result, info.GetIsolate()); 645 v8SetReturnValueString(info, result, info.GetIsolate());
646 } 646 }
647 647
648 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info) 648 void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInf o<v8::Value>& info)
649 { 649 {
650 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); 650 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info);
651 } 651 }
652 652
653 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 653 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
654 { 654 {
655 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 655 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
656 V8StringResource<> propertyValue = v8Value; 656 V8StringResource<> propertyValue = v8Value;
657 if (!propertyValue.prepare()) 657 if (!propertyValue.prepare())
658 return; 658 return;
659 bool result = impl->anonymousIndexedSetter(index, propertyValue); 659 bool result = impl->anonymousIndexedSetter(index, propertyValue);
660 if (!result) 660 if (!result)
661 return; 661 return;
662 v8SetReturnValue(info, v8Value); 662 v8SetReturnValue(info, v8Value);
663 } 663 }
664 664
665 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 665 void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
666 { 666 {
667 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value , info); 667 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value , info);
668 } 668 }
669 669
670 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf o<v8::Boolean>& info) 670 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf o<v8::Boolean>& info)
671 { 671 {
672 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 672 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
673 DeleteResult result = impl->anonymousIndexedDeleter(index); 673 DeleteResult result = impl->anonymousIndexedDeleter(index);
674 if (result != DeleteUnknownProperty) 674 if (result != DeleteUnknownProperty)
675 return v8SetReturnValueBool(info, result == DeleteSuccess); 675 return v8SetReturnValueBool(info, result == DeleteSuccess);
676 } 676 }
677 677
678 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal lbackInfo<v8::Boolean>& info) 678 void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackIn fo<v8::Boolean>& info)
679 { 679 {
680 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); 680 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info);
681 } 681 }
682 682
683 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info) 683 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info)
684 { 684 {
685 auto nameString = name.As<v8::String>(); 685 auto nameString = name.As<v8::String>();
686 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 686 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
687 AtomicString propertyName = toCoreAtomicString(nameString); 687 AtomicString propertyName = toCoreAtomicString(nameString);
688 String result = impl->anonymousNamedGetter(propertyName); 688 String result = impl->anonymousNamedGetter(propertyName);
689 if (result.isNull()) 689 if (result.isNull())
690 return; 690 return;
691 v8SetReturnValueString(info, result, info.GetIsolate()); 691 v8SetReturnValueString(info, result, info.GetIsolate());
692 } 692 }
693 693
694 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop ertyCallbackInfo<v8::Value>& info) 694 void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCal lbackInfo<v8::Value>& info)
695 { 695 {
696 if (!name->IsString()) 696 if (!name->IsString())
697 return; 697 return;
698 TestInterface5ImplementationV8Internal::namedPropertyGetter(name, info); 698 TestInterface5ImplementationV8Internal::namedPropertyGetter(name, info);
699 } 699 }
700 700
701 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 701 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
702 { 702 {
703 auto nameString = name.As<v8::String>(); 703 auto nameString = name.As<v8::String>();
704 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 704 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
705 V8StringResource<> propertyName(nameString); 705 V8StringResource<> propertyName(nameString);
706 if (!propertyName.prepare()) 706 if (!propertyName.prepare())
707 return; 707 return;
708 V8StringResource<> propertyValue = v8Value; 708 V8StringResource<> propertyValue = v8Value;
709 if (!propertyValue.prepare()) 709 if (!propertyValue.prepare())
710 return; 710 return;
711 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); 711 bool result = impl->anonymousNamedSetter(propertyName, propertyValue);
712 if (!result) 712 if (!result)
713 return; 713 return;
714 v8SetReturnValue(info, v8Value); 714 v8SetReturnValue(info, v8Value);
715 } 715 }
716 716
717 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8:: Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 717 void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
718 { 718 {
719 if (!name->IsString()) 719 if (!name->IsString())
720 return; 720 return;
721 TestInterface5ImplementationV8Internal::namedPropertySetter(name, v8Value, i nfo); 721 TestInterface5ImplementationV8Internal::namedPropertySetter(name, v8Value, i nfo);
722 } 722 }
723 723
724 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb ackInfo<v8::Integer>& info) 724 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb ackInfo<v8::Integer>& info)
725 { 725 {
726 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 726 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
727 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); 727 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
728 v8::String::Utf8Value namedProperty(name); 728 v8::String::Utf8Value namedProperty(name);
729 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface5", info.Holder(), info.GetIsolate()); 729 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface5", info.Holder(), info.GetIsolate());
730 bool result = impl->namedPropertyQuery(propertyName, exceptionState); 730 bool result = impl->namedPropertyQuery(propertyName, exceptionState);
731 if (exceptionState.hadException()) 731 if (exceptionState.hadException())
732 return; 732 return;
733 if (!result) 733 if (!result)
734 return; 734 return;
735 v8SetReturnValueInt(info, v8::None); 735 v8SetReturnValueInt(info, v8::None);
736 } 736 }
737 737
738 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope rtyCallbackInfo<v8::Integer>& info) 738 void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Integer>& info)
739 { 739 {
740 if (!name->IsString()) 740 if (!name->IsString())
741 return; 741 return;
742 TestInterface5ImplementationV8Internal::namedPropertyQuery(name, info); 742 TestInterface5ImplementationV8Internal::namedPropertyQuery(name, info);
743 } 743 }
744 744
745 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal lbackInfo<v8::Boolean>& info) 745 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal lbackInfo<v8::Boolean>& info)
746 { 746 {
747 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 747 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
748 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); 748 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
749 DeleteResult result = impl->anonymousNamedDeleter(propertyName); 749 DeleteResult result = impl->anonymousNamedDeleter(propertyName);
750 if (result != DeleteUnknownProperty) 750 if (result != DeleteUnknownProperty)
751 return v8SetReturnValueBool(info, result == DeleteSuccess); 751 return v8SetReturnValueBool(info, result == DeleteSuccess);
752 } 752 }
753 753
754 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro pertyCallbackInfo<v8::Boolean>& info) 754 void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCa llbackInfo<v8::Boolean>& info)
755 { 755 {
756 if (!name->IsString()) 756 if (!name->IsString())
757 return; 757 return;
758 TestInterface5ImplementationV8Internal::namedPropertyDeleter(name, info); 758 TestInterface5ImplementationV8Internal::namedPropertyDeleter(name, info);
759 } 759 }
760 760
761 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) 761 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo)
762 { 762 {
763 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 763 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
764 Vector<String> names; 764 Vector<String> names;
765 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter face5", info.Holder(), info.GetIsolate()); 765 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter face5", info.Holder(), info.GetIsolate());
766 impl->namedPropertyEnumerator(names, exceptionState); 766 impl->namedPropertyEnumerator(names, exceptionState);
767 if (exceptionState.hadException()) 767 if (exceptionState.hadException())
768 return; 768 return;
769 v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size( )); 769 v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size( ));
770 for (size_t i = 0; i < names.size(); ++i) { 770 for (size_t i = 0; i < names.size(); ++i) {
771 if (!v8CallBoolean(v8names->CreateDataProperty(info.GetIsolate()->GetCur rentContext(), i, v8String(info.GetIsolate(), names[i])))) 771 if (!v8CallBoolean(v8names->CreateDataProperty(info.GetIsolate()->GetCur rentContext(), i, v8String(info.GetIsolate(), names[i]))))
772 return; 772 return;
773 } 773 }
774 v8SetReturnValue(info, v8names); 774 v8SetReturnValue(info, v8names);
775 } 775 }
776 776
777 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 777 void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
778 { 778 {
779 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info); 779 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info);
780 } 780 }
781 781
782 } // namespace TestInterface5ImplementationV8Internal 782 } // namespace TestInterface5ImplementationV8Internal
783 783
784 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc riptWrappable, const v8::Persistent<v8::Object>& wrapper) 784 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc riptWrappable, const v8::Persistent<v8::Object>& wrapper)
785 { 785 {
786 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5I mplementation>(); 786 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5I mplementation>();
787 TestInterface5Implementation* referencedName = impl->referencedName(); 787 TestInterface5Implementation* referencedName = impl->referencedName();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodM ethodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV 8Internal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; 917 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodM ethodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV 8Internal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface};
918 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>( ), prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodC onfiguration); 918 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>( ), prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodC onfiguration);
919 } 919 }
920 if (executionContext && (executionContext->isDocument() || executionContext- >isServiceWorkerGlobalScope())) { 920 if (executionContext && (executionContext->isDocument() || executionContext- >isServiceWorkerGlobalScope())) {
921 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter face5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback , 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O nPrototype}; 921 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter face5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback , 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O nPrototype};
922 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>( ), prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMet hodMethodConfiguration); 922 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>( ), prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMet hodMethodConfiguration);
923 } 923 }
924 } 924 }
925 925
926 } // namespace blink 926 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698