OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 static void readOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 100 static void readOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
101 { | 101 { |
102 TestObj* imp = V8TestObject::toNative(info.Holder()); | 102 TestObj* imp = V8TestObject::toNative(info.Holder()); |
103 v8SetReturnValueInt(info, imp->readOnlyLongAttr()); | 103 v8SetReturnValueInt(info, imp->readOnlyLongAttr()); |
104 } | 104 } |
105 | 105 |
106 static void readOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 106 static void readOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
107 { | 107 { |
108 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 108 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
109 TestObjV8Internal::readOnlyLongAttrAttributeGetter(info); | 109 TestObjV8Internal::readOnlyLongAttrAttributeGetter(info); |
110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
111 } | 111 } |
112 | 112 |
113 static void readOnlyStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8:
:Value>& info) | 113 static void readOnlyStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8:
:Value>& info) |
114 { | 114 { |
115 TestObj* imp = V8TestObject::toNative(info.Holder()); | 115 TestObj* imp = V8TestObject::toNative(info.Holder()); |
116 v8SetReturnValueString(info, imp->readOnlyStringAttr(), info.GetIsolate()); | 116 v8SetReturnValueString(info, imp->readOnlyStringAttr(), info.GetIsolate()); |
117 } | 117 } |
118 | 118 |
119 static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, con
st v8::PropertyCallbackInfo<v8::Value>& info) | 119 static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, con
st v8::PropertyCallbackInfo<v8::Value>& info) |
120 { | 120 { |
121 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 121 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
122 TestObjV8Internal::readOnlyStringAttrAttributeGetter(info); | 122 TestObjV8Internal::readOnlyStringAttrAttributeGetter(info); |
123 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 123 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
124 } | 124 } |
125 | 125 |
126 static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | 126 static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) |
127 { | 127 { |
128 TestObj* imp = V8TestObject::toNative(info.Holder()); | 128 TestObj* imp = V8TestObject::toNative(info.Holder()); |
129 RefPtr<TestObj> result = imp->readOnlyTestObjectAttr(); | 129 RefPtr<TestObj> result = imp->readOnlyTestObjectAttr(); |
130 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.Get
ReturnValue(), result.get())) | 130 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.Get
ReturnValue(), result.get())) |
131 return; | 131 return; |
132 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); | 132 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); |
133 if (!wrapper.IsEmpty()) { | 133 if (!wrapper.IsEmpty()) { |
134 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readOnlyTe
stObjectAttr", wrapper); | 134 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readOnlyTe
stObjectAttr", wrapper); |
135 v8SetReturnValue(info, wrapper); | 135 v8SetReturnValue(info, wrapper); |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 static void readOnlyTestObjectAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 139 static void readOnlyTestObjectAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
140 { | 140 { |
141 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 141 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
142 TestObjV8Internal::readOnlyTestObjectAttrAttributeGetter(info); | 142 TestObjV8Internal::readOnlyTestObjectAttrAttributeGetter(info); |
143 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 143 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
144 } | 144 } |
145 | 145 |
146 static void staticReadOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | 146 static void staticReadOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) |
147 { | 147 { |
148 v8SetReturnValueInt(info, TestObj::staticReadOnlyLongAttr()); | 148 v8SetReturnValueInt(info, TestObj::staticReadOnlyLongAttr()); |
149 } | 149 } |
150 | 150 |
151 static void staticReadOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 151 static void staticReadOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
152 { | 152 { |
153 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 153 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
154 TestObjV8Internal::staticReadOnlyLongAttrAttributeGetter(info); | 154 TestObjV8Internal::staticReadOnlyLongAttrAttributeGetter(info); |
155 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 155 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
156 } | 156 } |
157 | 157 |
158 static void staticStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 158 static void staticStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
159 { | 159 { |
160 v8SetReturnValueString(info, TestObj::staticStringAttr(), info.GetIsolate())
; | 160 v8SetReturnValueString(info, TestObj::staticStringAttr(), info.GetIsolate())
; |
161 } | 161 } |
162 | 162 |
163 static void staticStringAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 163 static void staticStringAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
164 { | 164 { |
165 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 165 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
166 TestObjV8Internal::staticStringAttrAttributeGetter(info); | 166 TestObjV8Internal::staticStringAttrAttributeGetter(info); |
167 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 167 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
168 } | 168 } |
169 | 169 |
170 static void staticStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 170 static void staticStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
171 { | 171 { |
172 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 172 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
173 TestObj::setStaticStringAttr(cppValue); | 173 TestObj::setStaticStringAttr(cppValue); |
174 } | 174 } |
175 | 175 |
176 static void staticStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 176 static void staticStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
177 { | 177 { |
178 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 178 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
179 TestObjV8Internal::staticStringAttrAttributeSetter(jsValue, info); | 179 TestObjV8Internal::staticStringAttrAttributeSetter(jsValue, info); |
180 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 180 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
181 } | 181 } |
182 | 182 |
183 static void enumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& i
nfo) | 183 static void enumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& i
nfo) |
184 { | 184 { |
185 TestObj* imp = V8TestObject::toNative(info.Holder()); | 185 TestObj* imp = V8TestObject::toNative(info.Holder()); |
186 v8SetReturnValueString(info, imp->enumAttr(), info.GetIsolate()); | 186 v8SetReturnValueString(info, imp->enumAttr(), info.GetIsolate()); |
187 } | 187 } |
188 | 188 |
189 static void enumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 189 static void enumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
190 { | 190 { |
191 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 191 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
192 TestObjV8Internal::enumAttrAttributeGetter(info); | 192 TestObjV8Internal::enumAttrAttributeGetter(info); |
193 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 193 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
194 } | 194 } |
195 | 195 |
196 static void enumAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) | 196 static void enumAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) |
197 { | 197 { |
198 TestObj* imp = V8TestObject::toNative(info.Holder()); | 198 TestObj* imp = V8TestObject::toNative(info.Holder()); |
199 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 199 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
200 String string = cppValue; | 200 String string = cppValue; |
201 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) | 201 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) |
202 return; | 202 return; |
203 imp->setEnumAttr(cppValue); | 203 imp->setEnumAttr(cppValue); |
204 } | 204 } |
205 | 205 |
206 static void enumAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 206 static void enumAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
207 { | 207 { |
208 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 208 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
209 TestObjV8Internal::enumAttrAttributeSetter(jsValue, info); | 209 TestObjV8Internal::enumAttrAttributeSetter(jsValue, info); |
210 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 210 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
211 } | 211 } |
212 | 212 |
213 static void readOnlyEnumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 213 static void readOnlyEnumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
214 { | 214 { |
215 TestObj* imp = V8TestObject::toNative(info.Holder()); | 215 TestObj* imp = V8TestObject::toNative(info.Holder()); |
216 v8SetReturnValueString(info, imp->readOnlyEnumAttr(), info.GetIsolate()); | 216 v8SetReturnValueString(info, imp->readOnlyEnumAttr(), info.GetIsolate()); |
217 } | 217 } |
218 | 218 |
219 static void readOnlyEnumAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 219 static void readOnlyEnumAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
220 { | 220 { |
221 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 221 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
222 TestObjV8Internal::readOnlyEnumAttrAttributeGetter(info); | 222 TestObjV8Internal::readOnlyEnumAttrAttributeGetter(info); |
223 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 223 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
224 } | 224 } |
225 | 225 |
226 static void byteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& i
nfo) | 226 static void byteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& i
nfo) |
227 { | 227 { |
228 TestObj* imp = V8TestObject::toNative(info.Holder()); | 228 TestObj* imp = V8TestObject::toNative(info.Holder()); |
229 v8SetReturnValueInt(info, imp->byteAttr()); | 229 v8SetReturnValueInt(info, imp->byteAttr()); |
230 } | 230 } |
231 | 231 |
232 static void byteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 232 static void byteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
233 { | 233 { |
234 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 234 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
235 TestObjV8Internal::byteAttrAttributeGetter(info); | 235 TestObjV8Internal::byteAttrAttributeGetter(info); |
236 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 236 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
237 } | 237 } |
238 | 238 |
239 static void byteAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) | 239 static void byteAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) |
240 { | 240 { |
241 ExceptionState exceptionState(ExceptionState::SetterContext, "byteAttr", "Te
stObject", info.Holder(), info.GetIsolate()); | 241 ExceptionState exceptionState(ExceptionState::SetterContext, "byteAttr", "Te
stObject", info.Holder(), info.GetIsolate()); |
242 TestObj* imp = V8TestObject::toNative(info.Holder()); | 242 TestObj* imp = V8TestObject::toNative(info.Holder()); |
243 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt8(jsValue, exceptionState), ex
ceptionState); | 243 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt8(jsValue, exceptionState), ex
ceptionState); |
244 imp->setByteAttr(cppValue); | 244 imp->setByteAttr(cppValue); |
245 } | 245 } |
246 | 246 |
247 static void byteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 247 static void byteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
248 { | 248 { |
249 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 249 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
250 TestObjV8Internal::byteAttrAttributeSetter(jsValue, info); | 250 TestObjV8Internal::byteAttrAttributeSetter(jsValue, info); |
251 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 251 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
252 } | 252 } |
253 | 253 |
254 static void octetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) | 254 static void octetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) |
255 { | 255 { |
256 TestObj* imp = V8TestObject::toNative(info.Holder()); | 256 TestObj* imp = V8TestObject::toNative(info.Holder()); |
257 v8SetReturnValueUnsigned(info, imp->octetAttr()); | 257 v8SetReturnValueUnsigned(info, imp->octetAttr()); |
258 } | 258 } |
259 | 259 |
260 static void octetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 260 static void octetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
261 { | 261 { |
262 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 262 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
263 TestObjV8Internal::octetAttrAttributeGetter(info); | 263 TestObjV8Internal::octetAttrAttributeGetter(info); |
264 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 264 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
265 } | 265 } |
266 | 266 |
267 static void octetAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pro
pertyCallbackInfo<void>& info) | 267 static void octetAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pro
pertyCallbackInfo<void>& info) |
268 { | 268 { |
269 ExceptionState exceptionState(ExceptionState::SetterContext, "octetAttr", "T
estObject", info.Holder(), info.GetIsolate()); | 269 ExceptionState exceptionState(ExceptionState::SetterContext, "octetAttr", "T
estObject", info.Holder(), info.GetIsolate()); |
270 TestObj* imp = V8TestObject::toNative(info.Holder()); | 270 TestObj* imp = V8TestObject::toNative(info.Holder()); |
271 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt8(jsValue, exceptionStat
e), exceptionState); | 271 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt8(jsValue, exceptionStat
e), exceptionState); |
272 imp->setOctetAttr(cppValue); | 272 imp->setOctetAttr(cppValue); |
273 } | 273 } |
274 | 274 |
275 static void octetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 275 static void octetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
276 { | 276 { |
277 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 277 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
278 TestObjV8Internal::octetAttrAttributeSetter(jsValue, info); | 278 TestObjV8Internal::octetAttrAttributeSetter(jsValue, info); |
279 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 279 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
280 } | 280 } |
281 | 281 |
282 static void shortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) | 282 static void shortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) |
283 { | 283 { |
284 TestObj* imp = V8TestObject::toNative(info.Holder()); | 284 TestObj* imp = V8TestObject::toNative(info.Holder()); |
285 v8SetReturnValueInt(info, imp->shortAttr()); | 285 v8SetReturnValueInt(info, imp->shortAttr()); |
286 } | 286 } |
287 | 287 |
288 static void shortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 288 static void shortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
289 { | 289 { |
290 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 290 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
291 TestObjV8Internal::shortAttrAttributeGetter(info); | 291 TestObjV8Internal::shortAttrAttributeGetter(info); |
292 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 292 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
293 } | 293 } |
294 | 294 |
295 static void shortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pro
pertyCallbackInfo<void>& info) | 295 static void shortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pro
pertyCallbackInfo<void>& info) |
296 { | 296 { |
297 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttr", "T
estObject", info.Holder(), info.GetIsolate()); | 297 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttr", "T
estObject", info.Holder(), info.GetIsolate()); |
298 TestObj* imp = V8TestObject::toNative(info.Holder()); | 298 TestObj* imp = V8TestObject::toNative(info.Holder()); |
299 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt16(jsValue, exceptionState), e
xceptionState); | 299 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt16(jsValue, exceptionState), e
xceptionState); |
300 imp->setShortAttr(cppValue); | 300 imp->setShortAttr(cppValue); |
301 } | 301 } |
302 | 302 |
303 static void shortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 303 static void shortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
304 { | 304 { |
305 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 305 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
306 TestObjV8Internal::shortAttrAttributeSetter(jsValue, info); | 306 TestObjV8Internal::shortAttrAttributeSetter(jsValue, info); |
307 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 307 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
308 } | 308 } |
309 | 309 |
310 static void unsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::
Value>& info) | 310 static void unsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::
Value>& info) |
311 { | 311 { |
312 TestObj* imp = V8TestObject::toNative(info.Holder()); | 312 TestObj* imp = V8TestObject::toNative(info.Holder()); |
313 v8SetReturnValueUnsigned(info, imp->unsignedShortAttr()); | 313 v8SetReturnValueUnsigned(info, imp->unsignedShortAttr()); |
314 } | 314 } |
315 | 315 |
316 static void unsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, cons
t v8::PropertyCallbackInfo<v8::Value>& info) | 316 static void unsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, cons
t v8::PropertyCallbackInfo<v8::Value>& info) |
317 { | 317 { |
318 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 318 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
319 TestObjV8Internal::unsignedShortAttrAttributeGetter(info); | 319 TestObjV8Internal::unsignedShortAttrAttributeGetter(info); |
320 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 320 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
321 } | 321 } |
322 | 322 |
323 static void unsignedShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 323 static void unsignedShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
324 { | 324 { |
325 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedShortA
ttr", "TestObject", info.Holder(), info.GetIsolate()); | 325 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedShortA
ttr", "TestObject", info.Holder(), info.GetIsolate()); |
326 TestObj* imp = V8TestObject::toNative(info.Holder()); | 326 TestObj* imp = V8TestObject::toNative(info.Holder()); |
327 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt16(jsValue, exceptionSta
te), exceptionState); | 327 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt16(jsValue, exceptionSta
te), exceptionState); |
328 imp->setUnsignedShortAttr(cppValue); | 328 imp->setUnsignedShortAttr(cppValue); |
329 } | 329 } |
330 | 330 |
331 static void unsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::
Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 331 static void unsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::
Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
332 { | 332 { |
333 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 333 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
334 TestObjV8Internal::unsignedShortAttrAttributeSetter(jsValue, info); | 334 TestObjV8Internal::unsignedShortAttrAttributeSetter(jsValue, info); |
335 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 335 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
336 } | 336 } |
337 | 337 |
338 static void longAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& i
nfo) | 338 static void longAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& i
nfo) |
339 { | 339 { |
340 TestObj* imp = V8TestObject::toNative(info.Holder()); | 340 TestObj* imp = V8TestObject::toNative(info.Holder()); |
341 v8SetReturnValueInt(info, imp->longAttr()); | 341 v8SetReturnValueInt(info, imp->longAttr()); |
342 } | 342 } |
343 | 343 |
344 static void longAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 344 static void longAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
345 { | 345 { |
346 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 346 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
347 TestObjV8Internal::longAttrAttributeGetter(info); | 347 TestObjV8Internal::longAttrAttributeGetter(info); |
348 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 348 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
349 } | 349 } |
350 | 350 |
351 static void longAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) | 351 static void longAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) |
352 { | 352 { |
353 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttr", "Te
stObject", info.Holder(), info.GetIsolate()); | 353 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttr", "Te
stObject", info.Holder(), info.GetIsolate()); |
354 TestObj* imp = V8TestObject::toNative(info.Holder()); | 354 TestObj* imp = V8TestObject::toNative(info.Holder()); |
355 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 355 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
356 imp->setLongAttr(cppValue); | 356 imp->setLongAttr(cppValue); |
357 } | 357 } |
358 | 358 |
359 static void longAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 359 static void longAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
360 { | 360 { |
361 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 361 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
362 TestObjV8Internal::longAttrAttributeSetter(jsValue, info); | 362 TestObjV8Internal::longAttrAttributeSetter(jsValue, info); |
363 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 363 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
364 } | 364 } |
365 | 365 |
366 static void longLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value
>& info) | 366 static void longLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value
>& info) |
367 { | 367 { |
368 TestObj* imp = V8TestObject::toNative(info.Holder()); | 368 TestObj* imp = V8TestObject::toNative(info.Holder()); |
369 v8SetReturnValue(info, static_cast<double>(imp->longLongAttr())); | 369 v8SetReturnValue(info, static_cast<double>(imp->longLongAttr())); |
370 } | 370 } |
371 | 371 |
372 static void longLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8:
:PropertyCallbackInfo<v8::Value>& info) | 372 static void longLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8:
:PropertyCallbackInfo<v8::Value>& info) |
373 { | 373 { |
374 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 374 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
375 TestObjV8Internal::longLongAttrAttributeGetter(info); | 375 TestObjV8Internal::longLongAttrAttributeGetter(info); |
376 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 376 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
377 } | 377 } |
378 | 378 |
379 static void longLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::
PropertyCallbackInfo<void>& info) | 379 static void longLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::
PropertyCallbackInfo<void>& info) |
380 { | 380 { |
381 ExceptionState exceptionState(ExceptionState::SetterContext, "longLongAttr",
"TestObject", info.Holder(), info.GetIsolate()); | 381 ExceptionState exceptionState(ExceptionState::SetterContext, "longLongAttr",
"TestObject", info.Holder(), info.GetIsolate()); |
382 TestObj* imp = V8TestObject::toNative(info.Holder()); | 382 TestObj* imp = V8TestObject::toNative(info.Holder()); |
383 V8TRYCATCH_EXCEPTION_VOID(long long, cppValue, toInt64(jsValue, exceptionSta
te), exceptionState); | 383 V8TRYCATCH_EXCEPTION_VOID(long long, cppValue, toInt64(jsValue, exceptionSta
te), exceptionState); |
384 imp->setLongLongAttr(cppValue); | 384 imp->setLongLongAttr(cppValue); |
385 } | 385 } |
386 | 386 |
387 static void longLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 387 static void longLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
388 { | 388 { |
389 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 389 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
390 TestObjV8Internal::longLongAttrAttributeSetter(jsValue, info); | 390 TestObjV8Internal::longLongAttrAttributeSetter(jsValue, info); |
391 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 391 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
392 } | 392 } |
393 | 393 |
394 static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) | 394 static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) |
395 { | 395 { |
396 TestObj* imp = V8TestObject::toNative(info.Holder()); | 396 TestObj* imp = V8TestObject::toNative(info.Holder()); |
397 v8SetReturnValue(info, static_cast<double>(imp->unsignedLongLongAttr())); | 397 v8SetReturnValue(info, static_cast<double>(imp->unsignedLongLongAttr())); |
398 } | 398 } |
399 | 399 |
400 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 400 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
401 { | 401 { |
402 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 402 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
403 TestObjV8Internal::unsignedLongLongAttrAttributeGetter(info); | 403 TestObjV8Internal::unsignedLongLongAttrAttributeGetter(info); |
404 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 404 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
405 } | 405 } |
406 | 406 |
407 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, co
nst v8::PropertyCallbackInfo<void>& info) | 407 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, co
nst v8::PropertyCallbackInfo<void>& info) |
408 { | 408 { |
409 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLo
ngAttr", "TestObject", info.Holder(), info.GetIsolate()); | 409 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLo
ngAttr", "TestObject", info.Holder(), info.GetIsolate()); |
410 TestObj* imp = V8TestObject::toNative(info.Holder()); | 410 TestObj* imp = V8TestObject::toNative(info.Holder()); |
411 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(jsValue, ex
ceptionState), exceptionState); | 411 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(jsValue, ex
ceptionState), exceptionState); |
412 imp->setUnsignedLongLongAttr(cppValue); | 412 imp->setUnsignedLongLongAttr(cppValue); |
413 } | 413 } |
414 | 414 |
415 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 415 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
416 { | 416 { |
417 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 417 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
418 TestObjV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info); | 418 TestObjV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info); |
419 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 419 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
420 } | 420 } |
421 | 421 |
422 static void stringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) | 422 static void stringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) |
423 { | 423 { |
424 TestObj* imp = V8TestObject::toNative(info.Holder()); | 424 TestObj* imp = V8TestObject::toNative(info.Holder()); |
425 v8SetReturnValueString(info, imp->stringAttr(), info.GetIsolate()); | 425 v8SetReturnValueString(info, imp->stringAttr(), info.GetIsolate()); |
426 } | 426 } |
427 | 427 |
428 static void stringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 428 static void stringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
429 { | 429 { |
430 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 430 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
431 TestObjV8Internal::stringAttrAttributeGetter(info); | 431 TestObjV8Internal::stringAttrAttributeGetter(info); |
432 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 432 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
433 } | 433 } |
434 | 434 |
435 static void stringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) | 435 static void stringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) |
436 { | 436 { |
437 TestObj* imp = V8TestObject::toNative(info.Holder()); | 437 TestObj* imp = V8TestObject::toNative(info.Holder()); |
438 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 438 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
439 imp->setStringAttr(cppValue); | 439 imp->setStringAttr(cppValue); |
440 } | 440 } |
441 | 441 |
442 static void stringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 442 static void stringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
443 { | 443 { |
444 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 444 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
445 TestObjV8Internal::stringAttrAttributeSetter(jsValue, info); | 445 TestObjV8Internal::stringAttrAttributeSetter(jsValue, info); |
446 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 446 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
447 } | 447 } |
448 | 448 |
449 static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 449 static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
450 { | 450 { |
451 TestObj* imp = V8TestObject::toNative(info.Holder()); | 451 TestObj* imp = V8TestObject::toNative(info.Holder()); |
452 EventListener* jsValue = imp->eventHandlerAttr(isolatedWorldForIsolate(info.
GetIsolate())); | 452 EventListener* jsValue = imp->eventHandlerAttr(isolatedWorldForIsolate(info.
GetIsolate())); |
453 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen
er::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8::
Value>(v8::Null(info.GetIsolate()))); | 453 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen
er::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8::
Value>(v8::Null(info.GetIsolate()))); |
454 } | 454 } |
455 | 455 |
456 static void eventHandlerAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 456 static void eventHandlerAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
457 { | 457 { |
458 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 458 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
459 TestObjV8Internal::eventHandlerAttrAttributeGetter(info); | 459 TestObjV8Internal::eventHandlerAttrAttributeGetter(info); |
460 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 460 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
461 } | 461 } |
462 | 462 |
463 static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 463 static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
464 { | 464 { |
465 TestObj* imp = V8TestObject::toNative(info.Holder()); | 465 TestObj* imp = V8TestObject::toNative(info.Holder()); |
466 transferHiddenDependency(info.Holder(), imp->eventHandlerAttr(isolatedWorldF
orIsolate(info.GetIsolate())), jsValue, V8TestObject::eventListenerCacheIndex, i
nfo.GetIsolate()); | 466 transferHiddenDependency(info.Holder(), imp->eventHandlerAttr(isolatedWorldF
orIsolate(info.GetIsolate())), jsValue, V8TestObject::eventListenerCacheIndex, i
nfo.GetIsolate()); |
467 imp->setEventHandlerAttr(V8EventListenerList::getEventListener(jsValue, true
, ListenerFindOrCreate), isolatedWorldForIsolate(info.GetIsolate())); | 467 imp->setEventHandlerAttr(V8EventListenerList::getEventListener(jsValue, true
, ListenerFindOrCreate), isolatedWorldForIsolate(info.GetIsolate())); |
468 } | 468 } |
469 | 469 |
470 static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 470 static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
471 { | 471 { |
472 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 472 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
473 TestObjV8Internal::eventHandlerAttrAttributeSetter(jsValue, info); | 473 TestObjV8Internal::eventHandlerAttrAttributeSetter(jsValue, info); |
474 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 474 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
475 } | 475 } |
476 | 476 |
477 static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>
& info) | 477 static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>
& info) |
478 { | 478 { |
479 TestObj* imp = V8TestObject::toNative(info.Holder()); | 479 TestObj* imp = V8TestObject::toNative(info.Holder()); |
480 v8SetReturnValueFast(info, imp->testObjAttr(), imp); | 480 v8SetReturnValueFast(info, imp->testObjAttr(), imp); |
481 } | 481 } |
482 | 482 |
483 static void testObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) | 483 static void testObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) |
484 { | 484 { |
485 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 485 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
486 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); | 486 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); |
487 TestObjV8Internal::testObjAttrAttributeGetter(info); | 487 TestObjV8Internal::testObjAttrAttributeGetter(info); |
488 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 488 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
489 } | 489 } |
490 | 490 |
491 static void testObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) | 491 static void testObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) |
492 { | 492 { |
493 TestObj* imp = V8TestObject::toNative(info.Holder()); | 493 TestObj* imp = V8TestObject::toNative(info.Holder()); |
494 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 494 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
495 imp->setTestObjAttr(WTF::getPtr(cppValue)); | 495 imp->setTestObjAttr(WTF::getPtr(cppValue)); |
496 } | 496 } |
497 | 497 |
498 static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 498 static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
499 { | 499 { |
500 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 500 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
501 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); | 501 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); |
502 TestObjV8Internal::testObjAttrAttributeSetter(jsValue, info); | 502 TestObjV8Internal::testObjAttrAttributeSetter(jsValue, info); |
503 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 503 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
504 } | 504 } |
505 | 505 |
506 static void attrWithJSGetterAndSetterAttributeGetter(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 506 static void attrWithJSGetterAndSetterAttributeGetter(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
507 { | 507 { |
508 TestObj* imp = V8TestObject::toNative(info.Holder()); | 508 TestObj* imp = V8TestObject::toNative(info.Holder()); |
509 v8SetReturnValueString(info, imp->attrWithJSGetterAndSetter(), info.GetIsola
te()); | 509 v8SetReturnValueString(info, imp->attrWithJSGetterAndSetter(), info.GetIsola
te()); |
510 } | 510 } |
511 | 511 |
512 static void attrWithJSGetterAndSetterAttributeGetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 512 static void attrWithJSGetterAndSetterAttributeGetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
513 { | 513 { |
514 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 514 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
515 TestObjV8Internal::attrWithJSGetterAndSetterAttributeGetter(info); | 515 TestObjV8Internal::attrWithJSGetterAndSetterAttributeGetter(info); |
516 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 516 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
517 } | 517 } |
518 | 518 |
519 static void attrWithJSGetterAndSetterAttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::FunctionCallbackInfo<v8::Value>& info) | 519 static void attrWithJSGetterAndSetterAttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::FunctionCallbackInfo<v8::Value>& info) |
520 { | 520 { |
521 TestObj* imp = V8TestObject::toNative(info.Holder()); | 521 TestObj* imp = V8TestObject::toNative(info.Holder()); |
522 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 522 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
523 imp->setAttrWithJSGetterAndSetter(cppValue); | 523 imp->setAttrWithJSGetterAndSetter(cppValue); |
524 } | 524 } |
525 | 525 |
526 static void attrWithJSGetterAndSetterAttributeSetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 526 static void attrWithJSGetterAndSetterAttributeSetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
527 { | 527 { |
528 v8::Local<v8::Value> jsValue = info[0]; | 528 v8::Local<v8::Value> jsValue = info[0]; |
529 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 529 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
530 TestObjV8Internal::attrWithJSGetterAndSetterAttributeSetter(jsValue, info); | 530 TestObjV8Internal::attrWithJSGetterAndSetterAttributeSetter(jsValue, info); |
531 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 531 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
532 } | 532 } |
533 | 533 |
534 static void XMLObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) | 534 static void XMLObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) |
535 { | 535 { |
536 TestObj* imp = V8TestObject::toNative(info.Holder()); | 536 TestObj* imp = V8TestObject::toNative(info.Holder()); |
537 v8SetReturnValueFast(info, imp->xmlObjAttr(), imp); | 537 v8SetReturnValueFast(info, imp->xmlObjAttr(), imp); |
538 } | 538 } |
539 | 539 |
540 static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 540 static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
541 { | 541 { |
542 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 542 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
543 TestObjV8Internal::XMLObjAttrAttributeGetter(info); | 543 TestObjV8Internal::XMLObjAttrAttributeGetter(info); |
544 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 544 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
545 } | 545 } |
546 | 546 |
547 static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) | 547 static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) |
548 { | 548 { |
549 TestObj* imp = V8TestObject::toNative(info.Holder()); | 549 TestObj* imp = V8TestObject::toNative(info.Holder()); |
550 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 550 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
551 imp->setXMLObjAttr(WTF::getPtr(cppValue)); | 551 imp->setXMLObjAttr(WTF::getPtr(cppValue)); |
552 } | 552 } |
553 | 553 |
554 static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 554 static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
555 { | 555 { |
556 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 556 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
557 TestObjV8Internal::XMLObjAttrAttributeSetter(jsValue, info); | 557 TestObjV8Internal::XMLObjAttrAttributeSetter(jsValue, info); |
558 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 558 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
559 } | 559 } |
560 | 560 |
561 static void createAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& inf
o) | 561 static void createAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& inf
o) |
562 { | 562 { |
563 TestObj* imp = V8TestObject::toNative(info.Holder()); | 563 TestObj* imp = V8TestObject::toNative(info.Holder()); |
564 v8SetReturnValueBool(info, imp->isCreate()); | 564 v8SetReturnValueBool(info, imp->isCreate()); |
565 } | 565 } |
566 | 566 |
567 static void createAttributeGetterCallback(v8::Local<v8::String>, const v8::Prope
rtyCallbackInfo<v8::Value>& info) | 567 static void createAttributeGetterCallback(v8::Local<v8::String>, const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
568 { | 568 { |
569 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 569 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
570 TestObjV8Internal::createAttributeGetter(info); | 570 TestObjV8Internal::createAttributeGetter(info); |
571 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 571 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
572 } | 572 } |
573 | 573 |
574 static void createAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) | 574 static void createAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) |
575 { | 575 { |
576 TestObj* imp = V8TestObject::toNative(info.Holder()); | 576 TestObj* imp = V8TestObject::toNative(info.Holder()); |
577 V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue()); | 577 V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue()); |
578 imp->setCreate(cppValue); | 578 imp->setCreate(cppValue); |
579 } | 579 } |
580 | 580 |
581 static void createAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 581 static void createAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
582 { | 582 { |
583 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 583 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
584 TestObjV8Internal::createAttributeSetter(jsValue, info); | 584 TestObjV8Internal::createAttributeSetter(jsValue, info); |
585 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 585 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
586 } | 586 } |
587 | 587 |
588 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) | 588 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) |
589 { | 589 { |
590 TestObj* imp = V8TestObject::toNative(info.Holder()); | 590 TestObj* imp = V8TestObject::toNative(info.Holder()); |
591 v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::reflectedstrin
gattrAttr), info.GetIsolate()); | 591 v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::reflectedstrin
gattrAttr), info.GetIsolate()); |
592 } | 592 } |
593 | 593 |
594 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) | 594 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) |
595 { | 595 { |
596 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 596 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
597 TestObjV8Internal::reflectedStringAttrAttributeGetter(info); | 597 TestObjV8Internal::reflectedStringAttrAttributeGetter(info); |
598 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 598 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
599 } | 599 } |
600 | 600 |
601 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) | 601 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) |
602 { | 602 { |
603 TestObj* imp = V8TestObject::toNative(info.Holder()); | 603 TestObj* imp = V8TestObject::toNative(info.Holder()); |
604 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppVal
ue, jsValue); | 604 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppVal
ue, jsValue); |
605 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 605 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
606 imp->setAttribute(HTMLNames::reflectedstringattrAttr, cppValue); | 606 imp->setAttribute(HTMLNames::reflectedstringattrAttr, cppValue); |
607 } | 607 } |
608 | 608 |
609 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 609 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
610 { | 610 { |
611 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 611 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
612 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 612 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
613 TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info); | 613 TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info); |
614 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 614 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
615 } | 615 } |
616 | 616 |
617 static void reflectedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | 617 static void reflectedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) |
618 { | 618 { |
619 TestObj* imp = V8TestObject::toNative(info.Holder()); | 619 TestObj* imp = V8TestObject::toNative(info.Holder()); |
620 v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::reflectedinte
gralattrAttr)); | 620 v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::reflectedinte
gralattrAttr)); |
621 } | 621 } |
622 | 622 |
623 static void reflectedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 623 static void reflectedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
624 { | 624 { |
625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
626 TestObjV8Internal::reflectedIntegralAttrAttributeGetter(info); | 626 TestObjV8Internal::reflectedIntegralAttrAttributeGetter(info); |
627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
628 } | 628 } |
629 | 629 |
630 static void reflectedIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) | 630 static void reflectedIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) |
631 { | 631 { |
632 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedInteg
ralAttr", "TestObject", info.Holder(), info.GetIsolate()); | 632 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedInteg
ralAttr", "TestObject", info.Holder(), info.GetIsolate()); |
633 TestObj* imp = V8TestObject::toNative(info.Holder()); | 633 TestObj* imp = V8TestObject::toNative(info.Holder()); |
634 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 634 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
635 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 635 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
636 imp->setIntegralAttribute(HTMLNames::reflectedintegralattrAttr, cppValue); | 636 imp->setIntegralAttribute(HTMLNames::reflectedintegralattrAttr, cppValue); |
637 } | 637 } |
638 | 638 |
639 static void reflectedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 639 static void reflectedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
640 { | 640 { |
641 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 641 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
642 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 642 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
643 TestObjV8Internal::reflectedIntegralAttrAttributeSetter(jsValue, info); | 643 TestObjV8Internal::reflectedIntegralAttrAttributeSetter(jsValue, info); |
644 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 644 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
645 } | 645 } |
646 | 646 |
647 static void reflectedUnsignedIntegralAttrAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) | 647 static void reflectedUnsignedIntegralAttrAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) |
648 { | 648 { |
649 TestObj* imp = V8TestObject::toNative(info.Holder()); | 649 TestObj* imp = V8TestObject::toNative(info.Holder()); |
650 v8SetReturnValueUnsigned(info, std::max(0, imp->getIntegralAttribute(HTMLNam
es::reflectedunsignedintegralattrAttr))); | 650 v8SetReturnValueUnsigned(info, std::max(0, imp->getIntegralAttribute(HTMLNam
es::reflectedunsignedintegralattrAttr))); |
651 } | 651 } |
652 | 652 |
653 static void reflectedUnsignedIntegralAttrAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 653 static void reflectedUnsignedIntegralAttrAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
654 { | 654 { |
655 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 655 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
656 TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeGetter(info); | 656 TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeGetter(info); |
657 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 657 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
658 } | 658 } |
659 | 659 |
660 static void reflectedUnsignedIntegralAttrAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 660 static void reflectedUnsignedIntegralAttrAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
661 { | 661 { |
662 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedUnsig
nedIntegralAttr", "TestObject", info.Holder(), info.GetIsolate()); | 662 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedUnsig
nedIntegralAttr", "TestObject", info.Holder(), info.GetIsolate()); |
663 TestObj* imp = V8TestObject::toNative(info.Holder()); | 663 TestObj* imp = V8TestObject::toNative(info.Holder()); |
664 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt32(jsValue, exceptionSta
te), exceptionState); | 664 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt32(jsValue, exceptionSta
te), exceptionState); |
665 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 665 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
666 imp->setUnsignedIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAt
tr, cppValue); | 666 imp->setUnsignedIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAt
tr, cppValue); |
667 } | 667 } |
668 | 668 |
669 static void reflectedUnsignedIntegralAttrAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 669 static void reflectedUnsignedIntegralAttrAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
670 { | 670 { |
671 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 671 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
672 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 672 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
673 TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeSetter(jsValue, inf
o); | 673 TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeSetter(jsValue, inf
o); |
674 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 674 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
675 } | 675 } |
676 | 676 |
677 static void reflectedBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) | 677 static void reflectedBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) |
678 { | 678 { |
679 TestObj* imp = V8TestObject::toNative(info.Holder()); | 679 TestObj* imp = V8TestObject::toNative(info.Holder()); |
680 v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::reflectedboolean
attrAttr)); | 680 v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::reflectedboolean
attrAttr)); |
681 } | 681 } |
682 | 682 |
683 static void reflectedBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 683 static void reflectedBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
684 { | 684 { |
685 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 685 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
686 TestObjV8Internal::reflectedBooleanAttrAttributeGetter(info); | 686 TestObjV8Internal::reflectedBooleanAttrAttributeGetter(info); |
687 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 687 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
688 } | 688 } |
689 | 689 |
690 static void reflectedBooleanAttrAttributeSetter(v8::Local<v8::Value> jsValue, co
nst v8::PropertyCallbackInfo<void>& info) | 690 static void reflectedBooleanAttrAttributeSetter(v8::Local<v8::Value> jsValue, co
nst v8::PropertyCallbackInfo<void>& info) |
691 { | 691 { |
692 TestObj* imp = V8TestObject::toNative(info.Holder()); | 692 TestObj* imp = V8TestObject::toNative(info.Holder()); |
693 V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue()); | 693 V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue()); |
694 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 694 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
695 imp->setBooleanAttribute(HTMLNames::reflectedbooleanattrAttr, cppValue); | 695 imp->setBooleanAttribute(HTMLNames::reflectedbooleanattrAttr, cppValue); |
696 } | 696 } |
697 | 697 |
698 static void reflectedBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 698 static void reflectedBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
699 { | 699 { |
700 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 700 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
701 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 701 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
702 TestObjV8Internal::reflectedBooleanAttrAttributeSetter(jsValue, info); | 702 TestObjV8Internal::reflectedBooleanAttrAttributeSetter(jsValue, info); |
703 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 703 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
704 } | 704 } |
705 | 705 |
706 static void reflectedURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 706 static void reflectedURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
707 { | 707 { |
708 TestObj* imp = V8TestObject::toNative(info.Holder()); | 708 TestObj* imp = V8TestObject::toNative(info.Holder()); |
709 v8SetReturnValueString(info, imp->getURLAttribute(HTMLNames::reflectedurlatt
rAttr), info.GetIsolate()); | 709 v8SetReturnValueString(info, imp->getURLAttribute(HTMLNames::reflectedurlatt
rAttr), info.GetIsolate()); |
710 } | 710 } |
711 | 711 |
712 static void reflectedURLAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 712 static void reflectedURLAttrAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
713 { | 713 { |
714 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 714 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
715 TestObjV8Internal::reflectedURLAttrAttributeGetter(info); | 715 TestObjV8Internal::reflectedURLAttrAttributeGetter(info); |
716 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 716 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
717 } | 717 } |
718 | 718 |
719 static void reflectedURLAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 719 static void reflectedURLAttrAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
720 { | 720 { |
721 TestObj* imp = V8TestObject::toNative(info.Holder()); | 721 TestObj* imp = V8TestObject::toNative(info.Holder()); |
722 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppVal
ue, jsValue); | 722 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppVal
ue, jsValue); |
723 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 723 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
724 imp->setAttribute(HTMLNames::reflectedurlattrAttr, cppValue); | 724 imp->setAttribute(HTMLNames::reflectedurlattrAttr, cppValue); |
725 } | 725 } |
726 | 726 |
727 static void reflectedURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 727 static void reflectedURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
728 { | 728 { |
729 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 729 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
730 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 730 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
731 TestObjV8Internal::reflectedURLAttrAttributeSetter(jsValue, info); | 731 TestObjV8Internal::reflectedURLAttrAttributeSetter(jsValue, info); |
732 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 732 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
733 } | 733 } |
734 | 734 |
735 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) | 735 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) |
736 { | 736 { |
737 TestObj* imp = V8TestObject::toNative(info.Holder()); | 737 TestObj* imp = V8TestObject::toNative(info.Holder()); |
738 v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::customContentS
tringAttrAttr), info.GetIsolate()); | 738 v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::customContentS
tringAttrAttr), info.GetIsolate()); |
739 } | 739 } |
740 | 740 |
741 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) | 741 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) |
742 { | 742 { |
743 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 743 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
744 TestObjV8Internal::reflectedStringAttrAttributeGetter(info); | 744 TestObjV8Internal::reflectedStringAttrAttributeGetter(info); |
745 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 745 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
746 } | 746 } |
747 | 747 |
748 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) | 748 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) |
749 { | 749 { |
750 TestObj* imp = V8TestObject::toNative(info.Holder()); | 750 TestObj* imp = V8TestObject::toNative(info.Holder()); |
751 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppVal
ue, jsValue); | 751 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppVal
ue, jsValue); |
752 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 752 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
753 imp->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue); | 753 imp->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue); |
754 } | 754 } |
755 | 755 |
756 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 756 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
757 { | 757 { |
758 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 758 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
759 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 759 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
760 TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info); | 760 TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info); |
761 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 761 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
762 } | 762 } |
763 | 763 |
764 static void reflectedCustomIntegralAttrAttributeGetter(const v8::PropertyCallbac
kInfo<v8::Value>& info) | 764 static void reflectedCustomIntegralAttrAttributeGetter(const v8::PropertyCallbac
kInfo<v8::Value>& info) |
765 { | 765 { |
766 TestObj* imp = V8TestObject::toNative(info.Holder()); | 766 TestObj* imp = V8TestObject::toNative(info.Holder()); |
767 v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::customContent
IntegralAttrAttr)); | 767 v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::customContent
IntegralAttrAttr)); |
768 } | 768 } |
769 | 769 |
770 static void reflectedCustomIntegralAttrAttributeGetterCallback(v8::Local<v8::Str
ing>, const v8::PropertyCallbackInfo<v8::Value>& info) | 770 static void reflectedCustomIntegralAttrAttributeGetterCallback(v8::Local<v8::Str
ing>, const v8::PropertyCallbackInfo<v8::Value>& info) |
771 { | 771 { |
772 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 772 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
773 TestObjV8Internal::reflectedCustomIntegralAttrAttributeGetter(info); | 773 TestObjV8Internal::reflectedCustomIntegralAttrAttributeGetter(info); |
774 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 774 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
775 } | 775 } |
776 | 776 |
777 static void reflectedCustomIntegralAttrAttributeSetter(v8::Local<v8::Value> jsVa
lue, const v8::PropertyCallbackInfo<void>& info) | 777 static void reflectedCustomIntegralAttrAttributeSetter(v8::Local<v8::Value> jsVa
lue, const v8::PropertyCallbackInfo<void>& info) |
778 { | 778 { |
779 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedCusto
mIntegralAttr", "TestObject", info.Holder(), info.GetIsolate()); | 779 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedCusto
mIntegralAttr", "TestObject", info.Holder(), info.GetIsolate()); |
780 TestObj* imp = V8TestObject::toNative(info.Holder()); | 780 TestObj* imp = V8TestObject::toNative(info.Holder()); |
781 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 781 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
782 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 782 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
783 imp->setIntegralAttribute(HTMLNames::customContentIntegralAttrAttr, cppValue
); | 783 imp->setIntegralAttribute(HTMLNames::customContentIntegralAttrAttr, cppValue
); |
784 } | 784 } |
785 | 785 |
786 static void reflectedCustomIntegralAttrAttributeSetterCallback(v8::Local<v8::Str
ing>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 786 static void reflectedCustomIntegralAttrAttributeSetterCallback(v8::Local<v8::Str
ing>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
787 { | 787 { |
788 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 788 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
789 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 789 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
790 TestObjV8Internal::reflectedCustomIntegralAttrAttributeSetter(jsValue, info)
; | 790 TestObjV8Internal::reflectedCustomIntegralAttrAttributeSetter(jsValue, info)
; |
791 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 791 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
792 } | 792 } |
793 | 793 |
794 static void reflectedCustomBooleanAttrAttributeGetter(const v8::PropertyCallback
Info<v8::Value>& info) | 794 static void reflectedCustomBooleanAttrAttributeGetter(const v8::PropertyCallback
Info<v8::Value>& info) |
795 { | 795 { |
796 TestObj* imp = V8TestObject::toNative(info.Holder()); | 796 TestObj* imp = V8TestObject::toNative(info.Holder()); |
797 v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::customContentBoo
leanAttrAttr)); | 797 v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::customContentBoo
leanAttrAttr)); |
798 } | 798 } |
799 | 799 |
800 static void reflectedCustomBooleanAttrAttributeGetterCallback(v8::Local<v8::Stri
ng>, const v8::PropertyCallbackInfo<v8::Value>& info) | 800 static void reflectedCustomBooleanAttrAttributeGetterCallback(v8::Local<v8::Stri
ng>, const v8::PropertyCallbackInfo<v8::Value>& info) |
801 { | 801 { |
802 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 802 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
803 TestObjV8Internal::reflectedCustomBooleanAttrAttributeGetter(info); | 803 TestObjV8Internal::reflectedCustomBooleanAttrAttributeGetter(info); |
804 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 804 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
805 } | 805 } |
806 | 806 |
807 static void reflectedCustomBooleanAttrAttributeSetter(v8::Local<v8::Value> jsVal
ue, const v8::PropertyCallbackInfo<void>& info) | 807 static void reflectedCustomBooleanAttrAttributeSetter(v8::Local<v8::Value> jsVal
ue, const v8::PropertyCallbackInfo<void>& info) |
808 { | 808 { |
809 TestObj* imp = V8TestObject::toNative(info.Holder()); | 809 TestObj* imp = V8TestObject::toNative(info.Holder()); |
810 V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue()); | 810 V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue()); |
811 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 811 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
812 imp->setBooleanAttribute(HTMLNames::customContentBooleanAttrAttr, cppValue); | 812 imp->setBooleanAttribute(HTMLNames::customContentBooleanAttrAttr, cppValue); |
813 } | 813 } |
814 | 814 |
815 static void reflectedCustomBooleanAttrAttributeSetterCallback(v8::Local<v8::Stri
ng>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 815 static void reflectedCustomBooleanAttrAttributeSetterCallback(v8::Local<v8::Stri
ng>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
816 { | 816 { |
817 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 817 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
818 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 818 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
819 TestObjV8Internal::reflectedCustomBooleanAttrAttributeSetter(jsValue, info); | 819 TestObjV8Internal::reflectedCustomBooleanAttrAttributeSetter(jsValue, info); |
820 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 820 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
821 } | 821 } |
822 | 822 |
823 static void reflectedCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | 823 static void reflectedCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) |
824 { | 824 { |
825 TestObj* imp = V8TestObject::toNative(info.Holder()); | 825 TestObj* imp = V8TestObject::toNative(info.Holder()); |
826 v8SetReturnValueString(info, imp->getURLAttribute(HTMLNames::customContentUR
LAttrAttr), info.GetIsolate()); | 826 v8SetReturnValueString(info, imp->getURLAttribute(HTMLNames::customContentUR
LAttrAttr), info.GetIsolate()); |
827 } | 827 } |
828 | 828 |
829 static void reflectedCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 829 static void reflectedCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
830 { | 830 { |
831 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 831 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
832 TestObjV8Internal::reflectedCustomURLAttrAttributeGetter(info); | 832 TestObjV8Internal::reflectedCustomURLAttrAttributeGetter(info); |
833 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 833 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
834 } | 834 } |
835 | 835 |
836 static void reflectedCustomURLAttrAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) | 836 static void reflectedCustomURLAttrAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) |
837 { | 837 { |
838 TestObj* imp = V8TestObject::toNative(info.Holder()); | 838 TestObj* imp = V8TestObject::toNative(info.Holder()); |
839 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppVal
ue, jsValue); | 839 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppVal
ue, jsValue); |
840 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 840 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
841 imp->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue); | 841 imp->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue); |
842 } | 842 } |
843 | 843 |
844 static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 844 static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
845 { | 845 { |
846 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 846 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
847 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 847 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
848 TestObjV8Internal::reflectedCustomURLAttrAttributeSetter(jsValue, info); | 848 TestObjV8Internal::reflectedCustomURLAttrAttributeSetter(jsValue, info); |
849 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 849 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
850 } | 850 } |
851 | 851 |
852 static void limitedToOnlyOneAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 852 static void limitedToOnlyOneAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
853 { | 853 { |
854 TestObj* imp = V8TestObject::toNative(info.Holder()); | 854 TestObj* imp = V8TestObject::toNative(info.Holder()); |
855 String resultValue = imp->fastGetAttribute(HTMLNames::limitedtoonlyoneattrib
uteAttr); | 855 String resultValue = imp->fastGetAttribute(HTMLNames::limitedtoonlyoneattrib
uteAttr); |
856 if (resultValue.isEmpty()) { | 856 if (resultValue.isEmpty()) { |
857 ; | 857 ; |
858 } else if (equalIgnoringCase(resultValue, "unique")) { | 858 } else if (equalIgnoringCase(resultValue, "unique")) { |
859 resultValue = "unique"; | 859 resultValue = "unique"; |
860 } else { | 860 } else { |
861 resultValue = ""; | 861 resultValue = ""; |
862 } | 862 } |
863 v8SetReturnValueString(info, resultValue, info.GetIsolate()); | 863 v8SetReturnValueString(info, resultValue, info.GetIsolate()); |
864 } | 864 } |
865 | 865 |
866 static void limitedToOnlyOneAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 866 static void limitedToOnlyOneAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
867 { | 867 { |
868 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 868 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
869 TestObjV8Internal::limitedToOnlyOneAttributeAttributeGetter(info); | 869 TestObjV8Internal::limitedToOnlyOneAttributeAttributeGetter(info); |
870 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 870 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
871 } | 871 } |
872 | 872 |
873 static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) | 873 static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) |
874 { | 874 { |
875 TestObj* imp = V8TestObject::toNative(info.Holder()); | 875 TestObj* imp = V8TestObject::toNative(info.Holder()); |
876 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 876 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
877 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 877 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
878 imp->setAttribute(HTMLNames::limitedtoonlyoneattributeAttr, cppValue); | 878 imp->setAttribute(HTMLNames::limitedtoonlyoneattributeAttr, cppValue); |
879 } | 879 } |
880 | 880 |
881 static void limitedToOnlyOneAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 881 static void limitedToOnlyOneAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
882 { | 882 { |
883 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 883 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
884 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 884 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
885 TestObjV8Internal::limitedToOnlyOneAttributeAttributeSetter(jsValue, info); | 885 TestObjV8Internal::limitedToOnlyOneAttributeAttributeSetter(jsValue, info); |
886 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 886 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
887 } | 887 } |
888 | 888 |
889 static void limitedToOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | 889 static void limitedToOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) |
890 { | 890 { |
891 TestObj* imp = V8TestObject::toNative(info.Holder()); | 891 TestObj* imp = V8TestObject::toNative(info.Holder()); |
892 String resultValue = imp->fastGetAttribute(HTMLNames::limitedtoonlyattribute
Attr); | 892 String resultValue = imp->fastGetAttribute(HTMLNames::limitedtoonlyattribute
Attr); |
893 if (resultValue.isEmpty()) { | 893 if (resultValue.isEmpty()) { |
894 ; | 894 ; |
895 } else if (equalIgnoringCase(resultValue, "Per")) { | 895 } else if (equalIgnoringCase(resultValue, "Per")) { |
896 resultValue = "Per"; | 896 resultValue = "Per"; |
897 } else if (equalIgnoringCase(resultValue, "Paal")) { | 897 } else if (equalIgnoringCase(resultValue, "Paal")) { |
898 resultValue = "Paal"; | 898 resultValue = "Paal"; |
899 } else if (equalIgnoringCase(resultValue, "Espen")) { | 899 } else if (equalIgnoringCase(resultValue, "Espen")) { |
900 resultValue = "Espen"; | 900 resultValue = "Espen"; |
901 } else { | 901 } else { |
902 resultValue = ""; | 902 resultValue = ""; |
903 } | 903 } |
904 v8SetReturnValueString(info, resultValue, info.GetIsolate()); | 904 v8SetReturnValueString(info, resultValue, info.GetIsolate()); |
905 } | 905 } |
906 | 906 |
907 static void limitedToOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 907 static void limitedToOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
908 { | 908 { |
909 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 909 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
910 TestObjV8Internal::limitedToOnlyAttributeAttributeGetter(info); | 910 TestObjV8Internal::limitedToOnlyAttributeAttributeGetter(info); |
911 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 911 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
912 } | 912 } |
913 | 913 |
914 static void limitedToOnlyAttributeAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) | 914 static void limitedToOnlyAttributeAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) |
915 { | 915 { |
916 TestObj* imp = V8TestObject::toNative(info.Holder()); | 916 TestObj* imp = V8TestObject::toNative(info.Holder()); |
917 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 917 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
918 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 918 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
919 imp->setAttribute(HTMLNames::limitedtoonlyattributeAttr, cppValue); | 919 imp->setAttribute(HTMLNames::limitedtoonlyattributeAttr, cppValue); |
920 } | 920 } |
921 | 921 |
922 static void limitedToOnlyAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 922 static void limitedToOnlyAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
923 { | 923 { |
924 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 924 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
925 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 925 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
926 TestObjV8Internal::limitedToOnlyAttributeAttributeSetter(jsValue, info); | 926 TestObjV8Internal::limitedToOnlyAttributeAttributeSetter(jsValue, info); |
927 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 927 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
928 } | 928 } |
929 | 929 |
930 static void limitedToOnlyOtherAttributeAttributeGetter(const v8::PropertyCallbac
kInfo<v8::Value>& info) | 930 static void limitedToOnlyOtherAttributeAttributeGetter(const v8::PropertyCallbac
kInfo<v8::Value>& info) |
931 { | 931 { |
932 TestObj* imp = V8TestObject::toNative(info.Holder()); | 932 TestObj* imp = V8TestObject::toNative(info.Holder()); |
933 String resultValue = imp->fastGetAttribute(HTMLNames::OtherAttr); | 933 String resultValue = imp->fastGetAttribute(HTMLNames::OtherAttr); |
934 if (resultValue.isEmpty()) { | 934 if (resultValue.isEmpty()) { |
935 ; | 935 ; |
936 } else if (equalIgnoringCase(resultValue, "Value1")) { | 936 } else if (equalIgnoringCase(resultValue, "Value1")) { |
937 resultValue = "Value1"; | 937 resultValue = "Value1"; |
938 } else if (equalIgnoringCase(resultValue, "Value2")) { | 938 } else if (equalIgnoringCase(resultValue, "Value2")) { |
939 resultValue = "Value2"; | 939 resultValue = "Value2"; |
940 } else { | 940 } else { |
941 resultValue = ""; | 941 resultValue = ""; |
942 } | 942 } |
943 v8SetReturnValueString(info, resultValue, info.GetIsolate()); | 943 v8SetReturnValueString(info, resultValue, info.GetIsolate()); |
944 } | 944 } |
945 | 945 |
946 static void limitedToOnlyOtherAttributeAttributeGetterCallback(v8::Local<v8::Str
ing>, const v8::PropertyCallbackInfo<v8::Value>& info) | 946 static void limitedToOnlyOtherAttributeAttributeGetterCallback(v8::Local<v8::Str
ing>, const v8::PropertyCallbackInfo<v8::Value>& info) |
947 { | 947 { |
948 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 948 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
949 TestObjV8Internal::limitedToOnlyOtherAttributeAttributeGetter(info); | 949 TestObjV8Internal::limitedToOnlyOtherAttributeAttributeGetter(info); |
950 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 950 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
951 } | 951 } |
952 | 952 |
953 static void limitedToOnlyOtherAttributeAttributeSetter(v8::Local<v8::Value> jsVa
lue, const v8::PropertyCallbackInfo<void>& info) | 953 static void limitedToOnlyOtherAttributeAttributeSetter(v8::Local<v8::Value> jsVa
lue, const v8::PropertyCallbackInfo<void>& info) |
954 { | 954 { |
955 TestObj* imp = V8TestObject::toNative(info.Holder()); | 955 TestObj* imp = V8TestObject::toNative(info.Holder()); |
956 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 956 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
957 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 957 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
958 imp->setAttribute(HTMLNames::OtherAttr, cppValue); | 958 imp->setAttribute(HTMLNames::OtherAttr, cppValue); |
959 } | 959 } |
960 | 960 |
961 static void limitedToOnlyOtherAttributeAttributeSetterCallback(v8::Local<v8::Str
ing>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 961 static void limitedToOnlyOtherAttributeAttributeSetterCallback(v8::Local<v8::Str
ing>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
962 { | 962 { |
963 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 963 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
964 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 964 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
965 TestObjV8Internal::limitedToOnlyOtherAttributeAttributeSetter(jsValue, info)
; | 965 TestObjV8Internal::limitedToOnlyOtherAttributeAttributeSetter(jsValue, info)
; |
966 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 966 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
967 } | 967 } |
968 | 968 |
969 static void limitedWithMissingDefaultAttributeAttributeGetter(const v8::Property
CallbackInfo<v8::Value>& info) | 969 static void limitedWithMissingDefaultAttributeAttributeGetter(const v8::Property
CallbackInfo<v8::Value>& info) |
970 { | 970 { |
971 TestObj* imp = V8TestObject::toNative(info.Holder()); | 971 TestObj* imp = V8TestObject::toNative(info.Holder()); |
972 String resultValue = imp->fastGetAttribute(HTMLNames::limitedwithmissingdefa
ultattributeAttr); | 972 String resultValue = imp->fastGetAttribute(HTMLNames::limitedwithmissingdefa
ultattributeAttr); |
973 if (resultValue.isEmpty()) { | 973 if (resultValue.isEmpty()) { |
974 resultValue = "rsa"; | 974 resultValue = "rsa"; |
975 } else if (equalIgnoringCase(resultValue, "rsa")) { | 975 } else if (equalIgnoringCase(resultValue, "rsa")) { |
976 resultValue = "rsa"; | 976 resultValue = "rsa"; |
977 } else if (equalIgnoringCase(resultValue, "dsa")) { | 977 } else if (equalIgnoringCase(resultValue, "dsa")) { |
978 resultValue = "dsa"; | 978 resultValue = "dsa"; |
979 } else { | 979 } else { |
980 resultValue = ""; | 980 resultValue = ""; |
981 } | 981 } |
982 v8SetReturnValueString(info, resultValue, info.GetIsolate()); | 982 v8SetReturnValueString(info, resultValue, info.GetIsolate()); |
983 } | 983 } |
984 | 984 |
985 static void limitedWithMissingDefaultAttributeAttributeGetterCallback(v8::Local<
v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 985 static void limitedWithMissingDefaultAttributeAttributeGetterCallback(v8::Local<
v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
986 { | 986 { |
987 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 987 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
988 TestObjV8Internal::limitedWithMissingDefaultAttributeAttributeGetter(info); | 988 TestObjV8Internal::limitedWithMissingDefaultAttributeAttributeGetter(info); |
989 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 989 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
990 } | 990 } |
991 | 991 |
992 static void limitedWithMissingDefaultAttributeAttributeSetter(v8::Local<v8::Valu
e> jsValue, const v8::PropertyCallbackInfo<void>& info) | 992 static void limitedWithMissingDefaultAttributeAttributeSetter(v8::Local<v8::Valu
e> jsValue, const v8::PropertyCallbackInfo<void>& info) |
993 { | 993 { |
994 TestObj* imp = V8TestObject::toNative(info.Holder()); | 994 TestObj* imp = V8TestObject::toNative(info.Holder()); |
995 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 995 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
996 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 996 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
997 imp->setAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr, cppValu
e); | 997 imp->setAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr, cppValu
e); |
998 } | 998 } |
999 | 999 |
1000 static void limitedWithMissingDefaultAttributeAttributeSetterCallback(v8::Local<
v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>&
info) | 1000 static void limitedWithMissingDefaultAttributeAttributeSetterCallback(v8::Local<
v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>&
info) |
1001 { | 1001 { |
1002 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1002 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1003 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 1003 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
1004 TestObjV8Internal::limitedWithMissingDefaultAttributeAttributeSetter(jsValue
, info); | 1004 TestObjV8Internal::limitedWithMissingDefaultAttributeAttributeSetter(jsValue
, info); |
1005 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1005 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1006 } | 1006 } |
1007 | 1007 |
1008 static void limitedWithInvalidMissingDefaultAttributeAttributeGetter(const v8::P
ropertyCallbackInfo<v8::Value>& info) | 1008 static void limitedWithInvalidMissingDefaultAttributeAttributeGetter(const v8::P
ropertyCallbackInfo<v8::Value>& info) |
1009 { | 1009 { |
1010 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1010 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1011 String resultValue = imp->fastGetAttribute(HTMLNames::limitedwithinvalidmiss
ingdefaultattributeAttr); | 1011 String resultValue = imp->fastGetAttribute(HTMLNames::limitedwithinvalidmiss
ingdefaultattributeAttr); |
1012 if (resultValue.isEmpty()) { | 1012 if (resultValue.isEmpty()) { |
1013 resultValue = "auto"; | 1013 resultValue = "auto"; |
1014 } else if (equalIgnoringCase(resultValue, "ltr")) { | 1014 } else if (equalIgnoringCase(resultValue, "ltr")) { |
1015 resultValue = "ltr"; | 1015 resultValue = "ltr"; |
1016 } else if (equalIgnoringCase(resultValue, "rtl")) { | 1016 } else if (equalIgnoringCase(resultValue, "rtl")) { |
1017 resultValue = "rtl"; | 1017 resultValue = "rtl"; |
1018 } else if (equalIgnoringCase(resultValue, "auto")) { | 1018 } else if (equalIgnoringCase(resultValue, "auto")) { |
1019 resultValue = "auto"; | 1019 resultValue = "auto"; |
1020 } else { | 1020 } else { |
1021 resultValue = "ltr"; | 1021 resultValue = "ltr"; |
1022 } | 1022 } |
1023 v8SetReturnValueString(info, resultValue, info.GetIsolate()); | 1023 v8SetReturnValueString(info, resultValue, info.GetIsolate()); |
1024 } | 1024 } |
1025 | 1025 |
1026 static void limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback(v8:
:Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1026 static void limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback(v8:
:Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1027 { | 1027 { |
1028 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1028 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1029 TestObjV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetter(
info); | 1029 TestObjV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetter(
info); |
1030 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1030 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1031 } | 1031 } |
1032 | 1032 |
1033 static void limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1033 static void limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1034 { | 1034 { |
1035 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1035 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1036 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 1036 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
1037 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 1037 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
1038 imp->setAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr,
cppValue); | 1038 imp->setAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr,
cppValue); |
1039 } | 1039 } |
1040 | 1040 |
1041 static void limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback(v8:
:Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo
<void>& info) | 1041 static void limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback(v8:
:Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo
<void>& info) |
1042 { | 1042 { |
1043 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1043 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1044 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 1044 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
1045 TestObjV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetter(
jsValue, info); | 1045 TestObjV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetter(
jsValue, info); |
1046 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1046 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1047 } | 1047 } |
1048 | 1048 |
1049 static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetter(const v8
::PropertyCallbackInfo<v8::Value>& info) | 1049 static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetter(const v8
::PropertyCallbackInfo<v8::Value>& info) |
1050 { | 1050 { |
1051 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1051 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1052 String resultValue = imp->fastGetAttribute(HTMLNames::limitedwithinvalidandm
issingdefaultattributeAttr); | 1052 String resultValue = imp->fastGetAttribute(HTMLNames::limitedwithinvalidandm
issingdefaultattributeAttr); |
1053 if (resultValue.isEmpty()) { | 1053 if (resultValue.isEmpty()) { |
1054 resultValue = "left"; | 1054 resultValue = "left"; |
1055 } else if (equalIgnoringCase(resultValue, "left")) { | 1055 } else if (equalIgnoringCase(resultValue, "left")) { |
1056 resultValue = "left"; | 1056 resultValue = "left"; |
1057 } else if (equalIgnoringCase(resultValue, "right")) { | 1057 } else if (equalIgnoringCase(resultValue, "right")) { |
1058 resultValue = "right"; | 1058 resultValue = "right"; |
1059 } else { | 1059 } else { |
1060 resultValue = "left"; | 1060 resultValue = "left"; |
1061 } | 1061 } |
1062 v8SetReturnValueString(info, resultValue, info.GetIsolate()); | 1062 v8SetReturnValueString(info, resultValue, info.GetIsolate()); |
1063 } | 1063 } |
1064 | 1064 |
1065 static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetterCallback(
v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1065 static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetterCallback(
v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1066 { | 1066 { |
1067 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1067 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1068 TestObjV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeGett
er(info); | 1068 TestObjV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeGett
er(info); |
1069 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1069 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1070 } | 1070 } |
1071 | 1071 |
1072 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetter(v8::Loca
l<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1072 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetter(v8::Loca
l<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1073 { | 1073 { |
1074 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1074 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1075 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 1075 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
1076 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 1076 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
1077 imp->setAttribute(HTMLNames::limitedwithinvalidandmissingdefaultattributeAtt
r, cppValue); | 1077 imp->setAttribute(HTMLNames::limitedwithinvalidandmissingdefaultattributeAtt
r, cppValue); |
1078 } | 1078 } |
1079 | 1079 |
1080 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback(
v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackI
nfo<void>& info) | 1080 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback(
v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackI
nfo<void>& info) |
1081 { | 1081 { |
1082 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1082 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1083 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 1083 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
1084 TestObjV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeSett
er(jsValue, info); | 1084 TestObjV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeSett
er(jsValue, info); |
1085 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1085 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1086 } | 1086 } |
1087 | 1087 |
1088 static void corsSettingAttributeAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) | 1088 static void corsSettingAttributeAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) |
1089 { | 1089 { |
1090 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1090 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1091 String resultValue = imp->fastGetAttribute(HTMLNames::corssettingattributeAt
tr); | 1091 String resultValue = imp->fastGetAttribute(HTMLNames::corssettingattributeAt
tr); |
1092 if (resultValue.isNull()) { | 1092 if (resultValue.isNull()) { |
1093 ; | 1093 ; |
1094 } else if (resultValue.isEmpty()) { | 1094 } else if (resultValue.isEmpty()) { |
1095 resultValue = "anonymous"; | 1095 resultValue = "anonymous"; |
1096 } else if (equalIgnoringCase(resultValue, "anonymous")) { | 1096 } else if (equalIgnoringCase(resultValue, "anonymous")) { |
1097 resultValue = "anonymous"; | 1097 resultValue = "anonymous"; |
1098 } else if (equalIgnoringCase(resultValue, "use-credentials")) { | 1098 } else if (equalIgnoringCase(resultValue, "use-credentials")) { |
1099 resultValue = "use-credentials"; | 1099 resultValue = "use-credentials"; |
1100 } else { | 1100 } else { |
1101 resultValue = "anonymous"; | 1101 resultValue = "anonymous"; |
1102 } | 1102 } |
1103 v8SetReturnValueString(info, resultValue, info.GetIsolate()); | 1103 v8SetReturnValueString(info, resultValue, info.GetIsolate()); |
1104 } | 1104 } |
1105 | 1105 |
1106 static void corsSettingAttributeAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 1106 static void corsSettingAttributeAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
1107 { | 1107 { |
1108 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1108 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1109 TestObjV8Internal::corsSettingAttributeAttributeGetter(info); | 1109 TestObjV8Internal::corsSettingAttributeAttributeGetter(info); |
1110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1111 } | 1111 } |
1112 | 1112 |
1113 static void limitedWithEmptyMissingInvalidAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 1113 static void limitedWithEmptyMissingInvalidAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
1114 { | 1114 { |
1115 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1115 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1116 String resultValue = imp->fastGetAttribute(HTMLNames::limitedwithemptymissin
ginvalidattributeAttr); | 1116 String resultValue = imp->fastGetAttribute(HTMLNames::limitedwithemptymissin
ginvalidattributeAttr); |
1117 if (resultValue.isNull()) { | 1117 if (resultValue.isNull()) { |
1118 resultValue = "missing"; | 1118 resultValue = "missing"; |
1119 } else if (resultValue.isEmpty()) { | 1119 } else if (resultValue.isEmpty()) { |
1120 resultValue = "empty"; | 1120 resultValue = "empty"; |
1121 } else if (equalIgnoringCase(resultValue, "empty")) { | 1121 } else if (equalIgnoringCase(resultValue, "empty")) { |
1122 resultValue = "empty"; | 1122 resultValue = "empty"; |
1123 } else if (equalIgnoringCase(resultValue, "missing")) { | 1123 } else if (equalIgnoringCase(resultValue, "missing")) { |
1124 resultValue = "missing"; | 1124 resultValue = "missing"; |
1125 } else if (equalIgnoringCase(resultValue, "invalid")) { | 1125 } else if (equalIgnoringCase(resultValue, "invalid")) { |
1126 resultValue = "invalid"; | 1126 resultValue = "invalid"; |
1127 } else if (equalIgnoringCase(resultValue, "a-normal")) { | 1127 } else if (equalIgnoringCase(resultValue, "a-normal")) { |
1128 resultValue = "a-normal"; | 1128 resultValue = "a-normal"; |
1129 } else { | 1129 } else { |
1130 resultValue = "invalid"; | 1130 resultValue = "invalid"; |
1131 } | 1131 } |
1132 v8SetReturnValueString(info, resultValue, info.GetIsolate()); | 1132 v8SetReturnValueString(info, resultValue, info.GetIsolate()); |
1133 } | 1133 } |
1134 | 1134 |
1135 static void limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(v8::L
ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1135 static void limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(v8::L
ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1136 { | 1136 { |
1137 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1137 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1138 TestObjV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(in
fo); | 1138 TestObjV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(in
fo); |
1139 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1139 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1140 } | 1140 } |
1141 | 1141 |
1142 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 1142 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) |
1143 { | 1143 { |
1144 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1144 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1145 v8SetReturnValueFast(info, imp->typedArrayAttr(), imp); | 1145 v8SetReturnValueFast(info, imp->typedArrayAttr(), imp); |
1146 } | 1146 } |
1147 | 1147 |
1148 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 1148 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) |
1149 { | 1149 { |
1150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1151 TestObjV8Internal::typedArrayAttrAttributeGetter(info); | 1151 TestObjV8Internal::typedArrayAttrAttributeGetter(info); |
1152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1153 } | 1153 } |
1154 | 1154 |
1155 static void typedArrayAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) | 1155 static void typedArrayAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) |
1156 { | 1156 { |
1157 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1157 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1158 V8TRYCATCH_VOID(Float32Array*, cppValue, jsValue->IsFloat32Array() ? V8Float
32Array::toNative(v8::Handle<v8::Float32Array>::Cast(jsValue)) : 0); | 1158 V8TRYCATCH_VOID(Float32Array*, cppValue, jsValue->IsFloat32Array() ? V8Float
32Array::toNative(v8::Handle<v8::Float32Array>::Cast(jsValue)) : 0); |
1159 imp->setTypedArrayAttr(WTF::getPtr(cppValue)); | 1159 imp->setTypedArrayAttr(WTF::getPtr(cppValue)); |
1160 } | 1160 } |
1161 | 1161 |
1162 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1162 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1163 { | 1163 { |
1164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1165 TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info); | 1165 TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info); |
1166 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1166 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1167 } | 1167 } |
1168 | 1168 |
1169 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) | 1169 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) |
1170 { | 1170 { |
1171 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1171 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1172 ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetter
Exception", "TestObject", info.Holder(), info.GetIsolate()); | 1172 ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetter
Exception", "TestObject", info.Holder(), info.GetIsolate()); |
1173 int jsValue = imp->attrWithGetterException(exceptionState); | 1173 int jsValue = imp->attrWithGetterException(exceptionState); |
1174 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1174 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1175 return; | 1175 return; |
1176 v8SetReturnValueInt(info, jsValue); | 1176 v8SetReturnValueInt(info, jsValue); |
1177 } | 1177 } |
1178 | 1178 |
1179 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) | 1179 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
1180 { | 1180 { |
1181 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1181 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1182 TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info); | 1182 TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info); |
1183 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1183 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1184 } | 1184 } |
1185 | 1185 |
1186 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) | 1186 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) |
1187 { | 1187 { |
1188 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithGetter
Exception", "TestObject", info.Holder(), info.GetIsolate()); | 1188 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithGetter
Exception", "TestObject", info.Holder(), info.GetIsolate()); |
1189 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1189 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1190 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 1190 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
1191 imp->setAttrWithGetterException(cppValue); | 1191 imp->setAttrWithGetterException(cppValue); |
1192 } | 1192 } |
1193 | 1193 |
1194 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1194 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1195 { | 1195 { |
1196 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1196 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1197 TestObjV8Internal::attrWithGetterExceptionAttributeSetter(jsValue, info); | 1197 TestObjV8Internal::attrWithGetterExceptionAttributeSetter(jsValue, info); |
1198 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1198 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1199 } | 1199 } |
1200 | 1200 |
1201 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) | 1201 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) |
1202 { | 1202 { |
1203 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1203 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1204 v8SetReturnValueInt(info, imp->attrWithSetterException()); | 1204 v8SetReturnValueInt(info, imp->attrWithSetterException()); |
1205 } | 1205 } |
1206 | 1206 |
1207 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) | 1207 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
1208 { | 1208 { |
1209 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1209 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1210 TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info); | 1210 TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info); |
1211 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1211 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1212 } | 1212 } |
1213 | 1213 |
1214 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) | 1214 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) |
1215 { | 1215 { |
1216 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetter
Exception", "TestObject", info.Holder(), info.GetIsolate()); | 1216 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetter
Exception", "TestObject", info.Holder(), info.GetIsolate()); |
1217 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1217 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1218 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 1218 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
1219 imp->setAttrWithSetterException(cppValue, exceptionState); | 1219 imp->setAttrWithSetterException(cppValue, exceptionState); |
1220 exceptionState.throwIfNeeded(); | 1220 exceptionState.throwIfNeeded(); |
1221 } | 1221 } |
1222 | 1222 |
1223 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1223 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1224 { | 1224 { |
1225 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1225 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1226 TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info); | 1226 TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info); |
1227 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1227 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1228 } | 1228 } |
1229 | 1229 |
1230 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) | 1230 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) |
1231 { | 1231 { |
1232 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1232 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1233 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWith
GetterException", "TestObject", info.Holder(), info.GetIsolate()); | 1233 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWith
GetterException", "TestObject", info.Holder(), info.GetIsolate()); |
1234 String jsValue = imp->stringAttrWithGetterException(exceptionState); | 1234 String jsValue = imp->stringAttrWithGetterException(exceptionState); |
1235 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1235 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1236 return; | 1236 return; |
1237 v8SetReturnValueString(info, jsValue, info.GetIsolate()); | 1237 v8SetReturnValueString(info, jsValue, info.GetIsolate()); |
1238 } | 1238 } |
1239 | 1239 |
1240 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1240 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1241 { | 1241 { |
1242 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1242 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1243 TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info); | 1243 TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info); |
1244 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1244 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1245 } | 1245 } |
1246 | 1246 |
1247 static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 1247 static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
1248 { | 1248 { |
1249 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1249 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1250 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 1250 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
1251 imp->setStringAttrWithGetterException(cppValue); | 1251 imp->setStringAttrWithGetterException(cppValue); |
1252 } | 1252 } |
1253 | 1253 |
1254 static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 1254 static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
1255 { | 1255 { |
1256 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1256 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1257 TestObjV8Internal::stringAttrWithGetterExceptionAttributeSetter(jsValue, inf
o); | 1257 TestObjV8Internal::stringAttrWithGetterExceptionAttributeSetter(jsValue, inf
o); |
1258 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1258 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1259 } | 1259 } |
1260 | 1260 |
1261 static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) | 1261 static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) |
1262 { | 1262 { |
1263 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1263 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1264 v8SetReturnValueString(info, imp->stringAttrWithSetterException(), info.GetI
solate()); | 1264 v8SetReturnValueString(info, imp->stringAttrWithSetterException(), info.GetI
solate()); |
1265 } | 1265 } |
1266 | 1266 |
1267 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1267 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1268 { | 1268 { |
1269 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1269 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1270 TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info); | 1270 TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info); |
1271 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1271 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1272 } | 1272 } |
1273 | 1273 |
1274 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 1274 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
1275 { | 1275 { |
1276 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWith
SetterException", "TestObject", info.Holder(), info.GetIsolate()); | 1276 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWith
SetterException", "TestObject", info.Holder(), info.GetIsolate()); |
1277 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1277 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1278 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 1278 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
1279 imp->setStringAttrWithSetterException(cppValue, exceptionState); | 1279 imp->setStringAttrWithSetterException(cppValue, exceptionState); |
1280 exceptionState.throwIfNeeded(); | 1280 exceptionState.throwIfNeeded(); |
1281 } | 1281 } |
1282 | 1282 |
1283 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 1283 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
1284 { | 1284 { |
1285 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1285 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1286 TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, inf
o); | 1286 TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, inf
o); |
1287 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1287 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1288 } | 1288 } |
1289 | 1289 |
1290 static void customAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 1290 static void customAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
1291 { | 1291 { |
1292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1293 V8TestObject::customAttrAttributeGetterCustom(info); | 1293 V8TestObject::customAttrAttributeGetterCustom(info); |
1294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1295 } | 1295 } |
1296 | 1296 |
1297 static void customAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1297 static void customAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1298 { | 1298 { |
1299 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1299 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1300 V8TestObject::customAttrAttributeSetterCustom(jsValue, info); | 1300 V8TestObject::customAttrAttributeSetterCustom(jsValue, info); |
1301 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1301 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1302 } | 1302 } |
1303 | 1303 |
1304 static void withScriptStateAttributeAttributeGetter(const v8::PropertyCallbackIn
fo<v8::Value>& info) | 1304 static void withScriptStateAttributeAttributeGetter(const v8::PropertyCallbackIn
fo<v8::Value>& info) |
1305 { | 1305 { |
1306 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1306 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1307 ScriptState* currentState = ScriptState::current(); | 1307 ScriptState* currentState = ScriptState::current(); |
1308 if (!currentState) | 1308 if (!currentState) |
1309 return v8Undefined(); | 1309 return v8Undefined(); |
1310 ScriptState& state = *currentState; | 1310 ScriptState& state = *currentState; |
1311 v8SetReturnValueInt(info, imp->withScriptStateAttribute(&state)); | 1311 v8SetReturnValueInt(info, imp->withScriptStateAttribute(&state)); |
1312 } | 1312 } |
1313 | 1313 |
1314 static void withScriptStateAttributeAttributeGetterCallback(v8::Local<v8::String
>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1314 static void withScriptStateAttributeAttributeGetterCallback(v8::Local<v8::String
>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1315 { | 1315 { |
1316 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1316 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1317 TestObjV8Internal::withScriptStateAttributeAttributeGetter(info); | 1317 TestObjV8Internal::withScriptStateAttributeAttributeGetter(info); |
1318 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1318 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1319 } | 1319 } |
1320 | 1320 |
1321 static void withScriptStateAttributeAttributeSetter(v8::Local<v8::Value> jsValue
, const v8::PropertyCallbackInfo<void>& info) | 1321 static void withScriptStateAttributeAttributeSetter(v8::Local<v8::Value> jsValue
, const v8::PropertyCallbackInfo<void>& info) |
1322 { | 1322 { |
1323 ExceptionState exceptionState(ExceptionState::SetterContext, "withScriptStat
eAttribute", "TestObject", info.Holder(), info.GetIsolate()); | 1323 ExceptionState exceptionState(ExceptionState::SetterContext, "withScriptStat
eAttribute", "TestObject", info.Holder(), info.GetIsolate()); |
1324 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1324 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1325 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 1325 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
1326 ScriptState* currentState = ScriptState::current(); | 1326 ScriptState* currentState = ScriptState::current(); |
1327 if (!currentState) | 1327 if (!currentState) |
1328 return; | 1328 return; |
1329 ScriptState& state = *currentState; | 1329 ScriptState& state = *currentState; |
1330 imp->setWithScriptStateAttribute(&state, cppValue); | 1330 imp->setWithScriptStateAttribute(&state, cppValue); |
1331 if (state.hadException()) | 1331 if (state.hadException()) |
1332 throwError(state.exception(), info.GetIsolate()); | 1332 throwError(state.exception(), info.GetIsolate()); |
1333 } | 1333 } |
1334 | 1334 |
1335 static void withScriptStateAttributeAttributeSetterCallback(v8::Local<v8::String
>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1335 static void withScriptStateAttributeAttributeSetterCallback(v8::Local<v8::String
>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1336 { | 1336 { |
1337 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1337 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1338 TestObjV8Internal::withScriptStateAttributeAttributeSetter(jsValue, info); | 1338 TestObjV8Internal::withScriptStateAttributeAttributeSetter(jsValue, info); |
1339 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1339 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1340 } | 1340 } |
1341 | 1341 |
1342 static void withExecutionContextAttributeAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) | 1342 static void withExecutionContextAttributeAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) |
1343 { | 1343 { |
1344 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1344 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1345 ExecutionContext* scriptContext = getExecutionContext(); | 1345 ExecutionContext* scriptContext = getExecutionContext(); |
1346 v8SetReturnValueFast(info, imp->withExecutionContextAttribute(scriptContext)
, imp); | 1346 v8SetReturnValueFast(info, imp->withExecutionContextAttribute(scriptContext)
, imp); |
1347 } | 1347 } |
1348 | 1348 |
1349 static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1349 static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1350 { | 1350 { |
1351 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1351 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1352 TestObjV8Internal::withExecutionContextAttributeAttributeGetter(info); | 1352 TestObjV8Internal::withExecutionContextAttributeAttributeGetter(info); |
1353 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1353 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1354 } | 1354 } |
1355 | 1355 |
1356 static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 1356 static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
1357 { | 1357 { |
1358 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1358 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1359 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1359 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
1360 ExecutionContext* scriptContext = getExecutionContext(); | 1360 ExecutionContext* scriptContext = getExecutionContext(); |
1361 imp->setWithExecutionContextAttribute(scriptContext, WTF::getPtr(cppValue)); | 1361 imp->setWithExecutionContextAttribute(scriptContext, WTF::getPtr(cppValue)); |
1362 } | 1362 } |
1363 | 1363 |
1364 static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 1364 static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
1365 { | 1365 { |
1366 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1366 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1367 TestObjV8Internal::withExecutionContextAttributeAttributeSetter(jsValue, inf
o); | 1367 TestObjV8Internal::withExecutionContextAttributeAttributeSetter(jsValue, inf
o); |
1368 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1368 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1369 } | 1369 } |
1370 | 1370 |
1371 static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 1371 static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
1372 { | 1372 { |
1373 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1373 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1374 v8SetReturnValueFast(info, imp->withActiveWindowAndFirstWindowAttribute(), i
mp); | 1374 v8SetReturnValueFast(info, imp->withActiveWindowAndFirstWindowAttribute(), i
mp); |
1375 } | 1375 } |
1376 | 1376 |
1377 static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::L
ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1377 static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::L
ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1378 { | 1378 { |
1379 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1379 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1380 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(in
fo); | 1380 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(in
fo); |
1381 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1381 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1382 } | 1382 } |
1383 | 1383 |
1384 static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1384 static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1385 { | 1385 { |
1386 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1386 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1387 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1387 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
1388 imp->setWithActiveWindowAndFirstWindowAttribute(activeDOMWindow(), firstDOMW
indow(), WTF::getPtr(cppValue)); | 1388 imp->setWithActiveWindowAndFirstWindowAttribute(activeDOMWindow(), firstDOMW
indow(), WTF::getPtr(cppValue)); |
1389 } | 1389 } |
1390 | 1390 |
1391 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L
ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) | 1391 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L
ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) |
1392 { | 1392 { |
1393 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1393 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1394 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js
Value, info); | 1394 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js
Value, info); |
1395 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1395 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1396 } | 1396 } |
1397 | 1397 |
1398 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | 1398 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) |
1399 { | 1399 { |
1400 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1400 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1401 ExceptionState exceptionState(ExceptionState::GetterContext, "withScriptStat
eAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); | 1401 ExceptionState exceptionState(ExceptionState::GetterContext, "withScriptStat
eAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); |
1402 ScriptState* currentState = ScriptState::current(); | 1402 ScriptState* currentState = ScriptState::current(); |
1403 if (!currentState) | 1403 if (!currentState) |
1404 return v8Undefined(); | 1404 return v8Undefined(); |
1405 ScriptState& state = *currentState; | 1405 ScriptState& state = *currentState; |
1406 RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, except
ionState); | 1406 RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, except
ionState); |
1407 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1407 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1408 return; | 1408 return; |
1409 if (state.hadException()) { | 1409 if (state.hadException()) { |
1410 throwError(state.exception(), info.GetIsolate()); | 1410 throwError(state.exception(), info.GetIsolate()); |
1411 return; | 1411 return; |
1412 } | 1412 } |
1413 v8SetReturnValueFast(info, jsValue.release(), imp); | 1413 v8SetReturnValueFast(info, jsValue.release(), imp); |
1414 } | 1414 } |
1415 | 1415 |
1416 static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1416 static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1417 { | 1417 { |
1418 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1418 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1419 TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetter(info); | 1419 TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetter(info); |
1420 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1420 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1421 } | 1421 } |
1422 | 1422 |
1423 static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<void>& info) | 1423 static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<void>& info) |
1424 { | 1424 { |
1425 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1425 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1426 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1426 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
1427 ScriptState* currentState = ScriptState::current(); | 1427 ScriptState* currentState = ScriptState::current(); |
1428 if (!currentState) | 1428 if (!currentState) |
1429 return; | 1429 return; |
1430 ScriptState& state = *currentState; | 1430 ScriptState& state = *currentState; |
1431 imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(cppValue)); | 1431 imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(cppValue)); |
1432 if (state.hadException()) | 1432 if (state.hadException()) |
1433 throwError(state.exception(), info.GetIsolate()); | 1433 throwError(state.exception(), info.GetIsolate()); |
1434 } | 1434 } |
1435 | 1435 |
1436 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::
String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) | 1436 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::
String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) |
1437 { | 1437 { |
1438 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1438 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1439 TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, in
fo); | 1439 TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, in
fo); |
1440 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1440 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1441 } | 1441 } |
1442 | 1442 |
1443 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::Propert
yCallbackInfo<v8::Value>& info) | 1443 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::Propert
yCallbackInfo<v8::Value>& info) |
1444 { | 1444 { |
1445 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1445 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1446 ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionC
ontextAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); | 1446 ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionC
ontextAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); |
1447 ExecutionContext* scriptContext = getExecutionContext(); | 1447 ExecutionContext* scriptContext = getExecutionContext(); |
1448 RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptCon
text, exceptionState); | 1448 RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptCon
text, exceptionState); |
1449 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1449 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1450 return; | 1450 return; |
1451 v8SetReturnValueFast(info, jsValue.release(), imp); | 1451 v8SetReturnValueFast(info, jsValue.release(), imp); |
1452 } | 1452 } |
1453 | 1453 |
1454 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1454 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1455 { | 1455 { |
1456 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1456 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1457 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetter(info); | 1457 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetter(info); |
1458 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1458 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1459 } | 1459 } |
1460 | 1460 |
1461 static void withExecutionContextAttributeRaisesAttributeSetter(v8::Local<v8::Val
ue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1461 static void withExecutionContextAttributeRaisesAttributeSetter(v8::Local<v8::Val
ue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1462 { | 1462 { |
1463 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1463 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1464 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1464 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
1465 ExecutionContext* scriptContext = getExecutionContext(); | 1465 ExecutionContext* scriptContext = getExecutionContext(); |
1466 imp->setWithExecutionContextAttributeRaises(scriptContext, WTF::getPtr(cppVa
lue)); | 1466 imp->setWithExecutionContextAttributeRaises(scriptContext, WTF::getPtr(cppVa
lue)); |
1467 } | 1467 } |
1468 | 1468 |
1469 static void withExecutionContextAttributeRaisesAttributeSetterCallback(v8::Local
<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>
& info) | 1469 static void withExecutionContextAttributeRaisesAttributeSetterCallback(v8::Local
<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>
& info) |
1470 { | 1470 { |
1471 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1471 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1472 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetter(jsValu
e, info); | 1472 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetter(jsValu
e, info); |
1473 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1473 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1474 } | 1474 } |
1475 | 1475 |
1476 static void withExecutionContextAndScriptStateAttributeAttributeGetter(const v8:
:PropertyCallbackInfo<v8::Value>& info) | 1476 static void withExecutionContextAndScriptStateAttributeAttributeGetter(const v8:
:PropertyCallbackInfo<v8::Value>& info) |
1477 { | 1477 { |
1478 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1478 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1479 ScriptState* currentState = ScriptState::current(); | 1479 ScriptState* currentState = ScriptState::current(); |
1480 if (!currentState) | 1480 if (!currentState) |
1481 return v8Undefined(); | 1481 return v8Undefined(); |
1482 ScriptState& state = *currentState; | 1482 ScriptState& state = *currentState; |
1483 ExecutionContext* scriptContext = getExecutionContext(); | 1483 ExecutionContext* scriptContext = getExecutionContext(); |
1484 v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateAttribute(
&state, scriptContext), imp); | 1484 v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateAttribute(
&state, scriptContext), imp); |
1485 } | 1485 } |
1486 | 1486 |
1487 static void withExecutionContextAndScriptStateAttributeAttributeGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1487 static void withExecutionContextAndScriptStateAttributeAttributeGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1488 { | 1488 { |
1489 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1489 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1490 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGette
r(info); | 1490 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGette
r(info); |
1491 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1491 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1492 } | 1492 } |
1493 | 1493 |
1494 static void withExecutionContextAndScriptStateAttributeAttributeSetter(v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1494 static void withExecutionContextAndScriptStateAttributeAttributeSetter(v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1495 { | 1495 { |
1496 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1496 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1497 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1497 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
1498 ScriptState* currentState = ScriptState::current(); | 1498 ScriptState* currentState = ScriptState::current(); |
1499 if (!currentState) | 1499 if (!currentState) |
1500 return; | 1500 return; |
1501 ScriptState& state = *currentState; | 1501 ScriptState& state = *currentState; |
1502 ExecutionContext* scriptContext = getExecutionContext(); | 1502 ExecutionContext* scriptContext = getExecutionContext(); |
1503 imp->setWithExecutionContextAndScriptStateAttribute(&state, scriptContext, W
TF::getPtr(cppValue)); | 1503 imp->setWithExecutionContextAndScriptStateAttribute(&state, scriptContext, W
TF::getPtr(cppValue)); |
1504 if (state.hadException()) | 1504 if (state.hadException()) |
1505 throwError(state.exception(), info.GetIsolate()); | 1505 throwError(state.exception(), info.GetIsolate()); |
1506 } | 1506 } |
1507 | 1507 |
1508 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v
8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackIn
fo<void>& info) | 1508 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v
8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackIn
fo<void>& info) |
1509 { | 1509 { |
1510 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1510 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1511 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSette
r(jsValue, info); | 1511 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSette
r(jsValue, info); |
1512 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1512 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1513 } | 1513 } |
1514 | 1514 |
1515 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(con
st v8::PropertyCallbackInfo<v8::Value>& info) | 1515 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(con
st v8::PropertyCallbackInfo<v8::Value>& info) |
1516 { | 1516 { |
1517 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1517 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1518 ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionC
ontextAndScriptStateAttributeRaises", "TestObject", info.Holder(), info.GetIsola
te()); | 1518 ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionC
ontextAndScriptStateAttributeRaises", "TestObject", info.Holder(), info.GetIsola
te()); |
1519 ScriptState* currentState = ScriptState::current(); | 1519 ScriptState* currentState = ScriptState::current(); |
1520 if (!currentState) | 1520 if (!currentState) |
1521 return v8Undefined(); | 1521 return v8Undefined(); |
1522 ScriptState& state = *currentState; | 1522 ScriptState& state = *currentState; |
1523 ExecutionContext* scriptContext = getExecutionContext(); | 1523 ExecutionContext* scriptContext = getExecutionContext(); |
1524 RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRa
ises(&state, scriptContext, exceptionState); | 1524 RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRa
ises(&state, scriptContext, exceptionState); |
1525 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1525 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1526 return; | 1526 return; |
1527 if (state.hadException()) { | 1527 if (state.hadException()) { |
1528 throwError(state.exception(), info.GetIsolate()); | 1528 throwError(state.exception(), info.GetIsolate()); |
1529 return; | 1529 return; |
1530 } | 1530 } |
1531 v8SetReturnValueFast(info, jsValue.release(), imp); | 1531 v8SetReturnValueFast(info, jsValue.release(), imp); |
1532 } | 1532 } |
1533 | 1533 |
1534 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCall
back(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1534 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCall
back(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1535 { | 1535 { |
1536 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1536 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1537 TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttribut
eGetter(info); | 1537 TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttribut
eGetter(info); |
1538 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1538 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1539 } | 1539 } |
1540 | 1540 |
1541 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(v8:
:Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1541 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(v8:
:Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1542 { | 1542 { |
1543 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1543 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1544 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1544 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
1545 ScriptState* currentState = ScriptState::current(); | 1545 ScriptState* currentState = ScriptState::current(); |
1546 if (!currentState) | 1546 if (!currentState) |
1547 return; | 1547 return; |
1548 ScriptState& state = *currentState; | 1548 ScriptState& state = *currentState; |
1549 ExecutionContext* scriptContext = getExecutionContext(); | 1549 ExecutionContext* scriptContext = getExecutionContext(); |
1550 imp->setWithExecutionContextAndScriptStateAttributeRaises(&state, scriptCont
ext, WTF::getPtr(cppValue)); | 1550 imp->setWithExecutionContextAndScriptStateAttributeRaises(&state, scriptCont
ext, WTF::getPtr(cppValue)); |
1551 if (state.hadException()) | 1551 if (state.hadException()) |
1552 throwError(state.exception(), info.GetIsolate()); | 1552 throwError(state.exception(), info.GetIsolate()); |
1553 } | 1553 } |
1554 | 1554 |
1555 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetterCall
back(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCall
backInfo<void>& info) | 1555 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetterCall
back(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCall
backInfo<void>& info) |
1556 { | 1556 { |
1557 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1557 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1558 TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttribut
eSetter(jsValue, info); | 1558 TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttribut
eSetter(jsValue, info); |
1559 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1559 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1560 } | 1560 } |
1561 | 1561 |
1562 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter
(const v8::PropertyCallbackInfo<v8::Value>& info) | 1562 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter
(const v8::PropertyCallbackInfo<v8::Value>& info) |
1563 { | 1563 { |
1564 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1564 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1565 ScriptState* currentState = ScriptState::current(); | 1565 ScriptState* currentState = ScriptState::current(); |
1566 if (!currentState) | 1566 if (!currentState) |
1567 return v8Undefined(); | 1567 return v8Undefined(); |
1568 ScriptState& state = *currentState; | 1568 ScriptState& state = *currentState; |
1569 ExecutionContext* scriptContext = getExecutionContext(); | 1569 ExecutionContext* scriptContext = getExecutionContext(); |
1570 v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateWithSpaces
Attribute(&state, scriptContext), imp); | 1570 v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateWithSpaces
Attribute(&state, scriptContext), imp); |
1571 } | 1571 } |
1572 | 1572 |
1573 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter
Callback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1573 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter
Callback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1574 { | 1574 { |
1575 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1575 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1576 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttr
ibuteGetter(info); | 1576 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttr
ibuteGetter(info); |
1577 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1577 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1578 } | 1578 } |
1579 | 1579 |
1580 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter
(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1580 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter
(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1581 { | 1581 { |
1582 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1582 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1583 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1583 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
1584 ScriptState* currentState = ScriptState::current(); | 1584 ScriptState* currentState = ScriptState::current(); |
1585 if (!currentState) | 1585 if (!currentState) |
1586 return; | 1586 return; |
1587 ScriptState& state = *currentState; | 1587 ScriptState& state = *currentState; |
1588 ExecutionContext* scriptContext = getExecutionContext(); | 1588 ExecutionContext* scriptContext = getExecutionContext(); |
1589 imp->setWithExecutionContextAndScriptStateWithSpacesAttribute(&state, script
Context, WTF::getPtr(cppValue)); | 1589 imp->setWithExecutionContextAndScriptStateWithSpacesAttribute(&state, script
Context, WTF::getPtr(cppValue)); |
1590 if (state.hadException()) | 1590 if (state.hadException()) |
1591 throwError(state.exception(), info.GetIsolate()); | 1591 throwError(state.exception(), info.GetIsolate()); |
1592 } | 1592 } |
1593 | 1593 |
1594 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter
Callback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::Property
CallbackInfo<void>& info) | 1594 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter
Callback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::Property
CallbackInfo<void>& info) |
1595 { | 1595 { |
1596 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1596 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1597 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttr
ibuteSetter(jsValue, info); | 1597 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttr
ibuteSetter(jsValue, info); |
1598 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1598 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1599 } | 1599 } |
1600 | 1600 |
1601 static void enforcedRangeByteAttrAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | 1601 static void enforcedRangeByteAttrAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) |
1602 { | 1602 { |
1603 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1603 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1604 v8SetReturnValueInt(info, imp->enforcedRangeByteAttr()); | 1604 v8SetReturnValueInt(info, imp->enforcedRangeByteAttr()); |
1605 } | 1605 } |
1606 | 1606 |
1607 static void enforcedRangeByteAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 1607 static void enforcedRangeByteAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
1608 { | 1608 { |
1609 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1609 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1610 TestObjV8Internal::enforcedRangeByteAttrAttributeGetter(info); | 1610 TestObjV8Internal::enforcedRangeByteAttrAttributeGetter(info); |
1611 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1611 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1612 } | 1612 } |
1613 | 1613 |
1614 static void enforcedRangeByteAttrAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) | 1614 static void enforcedRangeByteAttrAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) |
1615 { | 1615 { |
1616 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeB
yteAttr", "TestObject", info.Holder(), info.GetIsolate()); | 1616 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeB
yteAttr", "TestObject", info.Holder(), info.GetIsolate()); |
1617 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1617 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1618 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt8(jsValue, EnforceRange, excep
tionState), exceptionState); | 1618 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt8(jsValue, EnforceRange, excep
tionState), exceptionState); |
1619 imp->setEnforcedRangeByteAttr(cppValue); | 1619 imp->setEnforcedRangeByteAttr(cppValue); |
1620 } | 1620 } |
1621 | 1621 |
1622 static void enforcedRangeByteAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1622 static void enforcedRangeByteAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1623 { | 1623 { |
1624 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1624 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1625 TestObjV8Internal::enforcedRangeByteAttrAttributeSetter(jsValue, info); | 1625 TestObjV8Internal::enforcedRangeByteAttrAttributeSetter(jsValue, info); |
1626 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1626 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1627 } | 1627 } |
1628 | 1628 |
1629 static void enforcedRangeOctetAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | 1629 static void enforcedRangeOctetAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) |
1630 { | 1630 { |
1631 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1631 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1632 v8SetReturnValueUnsigned(info, imp->enforcedRangeOctetAttr()); | 1632 v8SetReturnValueUnsigned(info, imp->enforcedRangeOctetAttr()); |
1633 } | 1633 } |
1634 | 1634 |
1635 static void enforcedRangeOctetAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 1635 static void enforcedRangeOctetAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
1636 { | 1636 { |
1637 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1637 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1638 TestObjV8Internal::enforcedRangeOctetAttrAttributeGetter(info); | 1638 TestObjV8Internal::enforcedRangeOctetAttrAttributeGetter(info); |
1639 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1639 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1640 } | 1640 } |
1641 | 1641 |
1642 static void enforcedRangeOctetAttrAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) | 1642 static void enforcedRangeOctetAttrAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) |
1643 { | 1643 { |
1644 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeO
ctetAttr", "TestObject", info.Holder(), info.GetIsolate()); | 1644 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeO
ctetAttr", "TestObject", info.Holder(), info.GetIsolate()); |
1645 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1645 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1646 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt8(jsValue, EnforceRange,
exceptionState), exceptionState); | 1646 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt8(jsValue, EnforceRange,
exceptionState), exceptionState); |
1647 imp->setEnforcedRangeOctetAttr(cppValue); | 1647 imp->setEnforcedRangeOctetAttr(cppValue); |
1648 } | 1648 } |
1649 | 1649 |
1650 static void enforcedRangeOctetAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1650 static void enforcedRangeOctetAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1651 { | 1651 { |
1652 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1652 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1653 TestObjV8Internal::enforcedRangeOctetAttrAttributeSetter(jsValue, info); | 1653 TestObjV8Internal::enforcedRangeOctetAttrAttributeSetter(jsValue, info); |
1654 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1654 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1655 } | 1655 } |
1656 | 1656 |
1657 static void enforcedRangeShortAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | 1657 static void enforcedRangeShortAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) |
1658 { | 1658 { |
1659 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1659 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1660 v8SetReturnValueInt(info, imp->enforcedRangeShortAttr()); | 1660 v8SetReturnValueInt(info, imp->enforcedRangeShortAttr()); |
1661 } | 1661 } |
1662 | 1662 |
1663 static void enforcedRangeShortAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 1663 static void enforcedRangeShortAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
1664 { | 1664 { |
1665 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1665 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1666 TestObjV8Internal::enforcedRangeShortAttrAttributeGetter(info); | 1666 TestObjV8Internal::enforcedRangeShortAttrAttributeGetter(info); |
1667 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1667 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1668 } | 1668 } |
1669 | 1669 |
1670 static void enforcedRangeShortAttrAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) | 1670 static void enforcedRangeShortAttrAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) |
1671 { | 1671 { |
1672 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeS
hortAttr", "TestObject", info.Holder(), info.GetIsolate()); | 1672 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeS
hortAttr", "TestObject", info.Holder(), info.GetIsolate()); |
1673 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1673 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1674 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt16(jsValue, EnforceRange, exce
ptionState), exceptionState); | 1674 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt16(jsValue, EnforceRange, exce
ptionState), exceptionState); |
1675 imp->setEnforcedRangeShortAttr(cppValue); | 1675 imp->setEnforcedRangeShortAttr(cppValue); |
1676 } | 1676 } |
1677 | 1677 |
1678 static void enforcedRangeShortAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1678 static void enforcedRangeShortAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1679 { | 1679 { |
1680 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1680 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1681 TestObjV8Internal::enforcedRangeShortAttrAttributeSetter(jsValue, info); | 1681 TestObjV8Internal::enforcedRangeShortAttrAttributeSetter(jsValue, info); |
1682 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1682 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1683 } | 1683 } |
1684 | 1684 |
1685 static void enforcedRangeUnsignedShortAttrAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | 1685 static void enforcedRangeUnsignedShortAttrAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) |
1686 { | 1686 { |
1687 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1687 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1688 v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedShortAttr()); | 1688 v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedShortAttr()); |
1689 } | 1689 } |
1690 | 1690 |
1691 static void enforcedRangeUnsignedShortAttrAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1691 static void enforcedRangeUnsignedShortAttrAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1692 { | 1692 { |
1693 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1693 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1694 TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeGetter(info); | 1694 TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeGetter(info); |
1695 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1695 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1696 } | 1696 } |
1697 | 1697 |
1698 static void enforcedRangeUnsignedShortAttrAttributeSetter(v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<void>& info) | 1698 static void enforcedRangeUnsignedShortAttrAttributeSetter(v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<void>& info) |
1699 { | 1699 { |
1700 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeU
nsignedShortAttr", "TestObject", info.Holder(), info.GetIsolate()); | 1700 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeU
nsignedShortAttr", "TestObject", info.Holder(), info.GetIsolate()); |
1701 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1701 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1702 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt16(jsValue, EnforceRange
, exceptionState), exceptionState); | 1702 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt16(jsValue, EnforceRange
, exceptionState), exceptionState); |
1703 imp->setEnforcedRangeUnsignedShortAttr(cppValue); | 1703 imp->setEnforcedRangeUnsignedShortAttr(cppValue); |
1704 } | 1704 } |
1705 | 1705 |
1706 static void enforcedRangeUnsignedShortAttrAttributeSetterCallback(v8::Local<v8::
String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) | 1706 static void enforcedRangeUnsignedShortAttrAttributeSetterCallback(v8::Local<v8::
String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) |
1707 { | 1707 { |
1708 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1708 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1709 TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeSetter(jsValue, in
fo); | 1709 TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeSetter(jsValue, in
fo); |
1710 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1710 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1711 } | 1711 } |
1712 | 1712 |
1713 static void enforcedRangeLongAttrAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | 1713 static void enforcedRangeLongAttrAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) |
1714 { | 1714 { |
1715 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1715 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1716 v8SetReturnValueInt(info, imp->enforcedRangeLongAttr()); | 1716 v8SetReturnValueInt(info, imp->enforcedRangeLongAttr()); |
1717 } | 1717 } |
1718 | 1718 |
1719 static void enforcedRangeLongAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 1719 static void enforcedRangeLongAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
1720 { | 1720 { |
1721 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1721 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1722 TestObjV8Internal::enforcedRangeLongAttrAttributeGetter(info); | 1722 TestObjV8Internal::enforcedRangeLongAttrAttributeGetter(info); |
1723 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1723 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1724 } | 1724 } |
1725 | 1725 |
1726 static void enforcedRangeLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) | 1726 static void enforcedRangeLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) |
1727 { | 1727 { |
1728 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeL
ongAttr", "TestObject", info.Holder(), info.GetIsolate()); | 1728 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeL
ongAttr", "TestObject", info.Holder(), info.GetIsolate()); |
1729 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1729 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1730 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, EnforceRange, exce
ptionState), exceptionState); | 1730 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, EnforceRange, exce
ptionState), exceptionState); |
1731 imp->setEnforcedRangeLongAttr(cppValue); | 1731 imp->setEnforcedRangeLongAttr(cppValue); |
1732 } | 1732 } |
1733 | 1733 |
1734 static void enforcedRangeLongAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1734 static void enforcedRangeLongAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1735 { | 1735 { |
1736 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1736 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1737 TestObjV8Internal::enforcedRangeLongAttrAttributeSetter(jsValue, info); | 1737 TestObjV8Internal::enforcedRangeLongAttrAttributeSetter(jsValue, info); |
1738 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1738 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1739 } | 1739 } |
1740 | 1740 |
1741 static void enforcedRangeUnsignedLongAttrAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) | 1741 static void enforcedRangeUnsignedLongAttrAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) |
1742 { | 1742 { |
1743 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1743 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1744 v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedLongAttr()); | 1744 v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedLongAttr()); |
1745 } | 1745 } |
1746 | 1746 |
1747 static void enforcedRangeUnsignedLongAttrAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1747 static void enforcedRangeUnsignedLongAttrAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1748 { | 1748 { |
1749 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1749 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1750 TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeGetter(info); | 1750 TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeGetter(info); |
1751 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1751 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1752 } | 1752 } |
1753 | 1753 |
1754 static void enforcedRangeUnsignedLongAttrAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 1754 static void enforcedRangeUnsignedLongAttrAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
1755 { | 1755 { |
1756 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeU
nsignedLongAttr", "TestObject", info.Holder(), info.GetIsolate()); | 1756 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeU
nsignedLongAttr", "TestObject", info.Holder(), info.GetIsolate()); |
1757 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1757 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1758 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt32(jsValue, EnforceRange
, exceptionState), exceptionState); | 1758 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt32(jsValue, EnforceRange
, exceptionState), exceptionState); |
1759 imp->setEnforcedRangeUnsignedLongAttr(cppValue); | 1759 imp->setEnforcedRangeUnsignedLongAttr(cppValue); |
1760 } | 1760 } |
1761 | 1761 |
1762 static void enforcedRangeUnsignedLongAttrAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 1762 static void enforcedRangeUnsignedLongAttrAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
1763 { | 1763 { |
1764 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1764 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1765 TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeSetter(jsValue, inf
o); | 1765 TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeSetter(jsValue, inf
o); |
1766 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1766 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1767 } | 1767 } |
1768 | 1768 |
1769 static void enforcedRangeLongLongAttrAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 1769 static void enforcedRangeLongLongAttrAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
1770 { | 1770 { |
1771 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1771 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1772 v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeLongLongAttr())
); | 1772 v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeLongLongAttr())
); |
1773 } | 1773 } |
1774 | 1774 |
1775 static void enforcedRangeLongLongAttrAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1775 static void enforcedRangeLongLongAttrAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1776 { | 1776 { |
1777 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1777 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1778 TestObjV8Internal::enforcedRangeLongLongAttrAttributeGetter(info); | 1778 TestObjV8Internal::enforcedRangeLongLongAttrAttributeGetter(info); |
1779 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1779 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1780 } | 1780 } |
1781 | 1781 |
1782 static void enforcedRangeLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) | 1782 static void enforcedRangeLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) |
1783 { | 1783 { |
1784 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeL
ongLongAttr", "TestObject", info.Holder(), info.GetIsolate()); | 1784 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeL
ongLongAttr", "TestObject", info.Holder(), info.GetIsolate()); |
1785 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1785 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1786 V8TRYCATCH_EXCEPTION_VOID(long long, cppValue, toInt64(jsValue, EnforceRange
, exceptionState), exceptionState); | 1786 V8TRYCATCH_EXCEPTION_VOID(long long, cppValue, toInt64(jsValue, EnforceRange
, exceptionState), exceptionState); |
1787 imp->setEnforcedRangeLongLongAttr(cppValue); | 1787 imp->setEnforcedRangeLongLongAttr(cppValue); |
1788 } | 1788 } |
1789 | 1789 |
1790 static void enforcedRangeLongLongAttrAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1790 static void enforcedRangeLongLongAttrAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1791 { | 1791 { |
1792 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1792 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1793 TestObjV8Internal::enforcedRangeLongLongAttrAttributeSetter(jsValue, info); | 1793 TestObjV8Internal::enforcedRangeLongLongAttrAttributeSetter(jsValue, info); |
1794 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1794 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1795 } | 1795 } |
1796 | 1796 |
1797 static void enforcedRangeUnsignedLongLongAttrAttributeGetter(const v8::PropertyC
allbackInfo<v8::Value>& info) | 1797 static void enforcedRangeUnsignedLongLongAttrAttributeGetter(const v8::PropertyC
allbackInfo<v8::Value>& info) |
1798 { | 1798 { |
1799 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1799 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1800 v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeUnsignedLongLon
gAttr())); | 1800 v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeUnsignedLongLon
gAttr())); |
1801 } | 1801 } |
1802 | 1802 |
1803 static void enforcedRangeUnsignedLongLongAttrAttributeGetterCallback(v8::Local<v
8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1803 static void enforcedRangeUnsignedLongLongAttrAttributeGetterCallback(v8::Local<v
8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1804 { | 1804 { |
1805 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1805 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1806 TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetter(info); | 1806 TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetter(info); |
1807 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1807 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1808 } | 1808 } |
1809 | 1809 |
1810 static void enforcedRangeUnsignedLongLongAttrAttributeSetter(v8::Local<v8::Value
> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1810 static void enforcedRangeUnsignedLongLongAttrAttributeSetter(v8::Local<v8::Value
> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1811 { | 1811 { |
1812 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeU
nsignedLongLongAttr", "TestObject", info.Holder(), info.GetIsolate()); | 1812 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeU
nsignedLongLongAttr", "TestObject", info.Holder(), info.GetIsolate()); |
1813 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1813 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1814 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(jsValue, En
forceRange, exceptionState), exceptionState); | 1814 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(jsValue, En
forceRange, exceptionState), exceptionState); |
1815 imp->setEnforcedRangeUnsignedLongLongAttr(cppValue); | 1815 imp->setEnforcedRangeUnsignedLongLongAttr(cppValue); |
1816 } | 1816 } |
1817 | 1817 |
1818 static void enforcedRangeUnsignedLongLongAttrAttributeSetterCallback(v8::Local<v
8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>&
info) | 1818 static void enforcedRangeUnsignedLongLongAttrAttributeSetterCallback(v8::Local<v
8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>&
info) |
1819 { | 1819 { |
1820 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1820 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1821 TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetter(jsValue,
info); | 1821 TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetter(jsValue,
info); |
1822 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1822 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1823 } | 1823 } |
1824 | 1824 |
1825 #if ENABLE(Condition1) | 1825 #if ENABLE(Condition1) |
1826 static void conditionalAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 1826 static void conditionalAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
1827 { | 1827 { |
1828 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1828 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1829 v8SetReturnValueInt(info, imp->conditionalAttr1()); | 1829 v8SetReturnValueInt(info, imp->conditionalAttr1()); |
1830 } | 1830 } |
1831 #endif // ENABLE(Condition1) | 1831 #endif // ENABLE(Condition1) |
1832 | 1832 |
1833 #if ENABLE(Condition1) | 1833 #if ENABLE(Condition1) |
1834 static void conditionalAttr1AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 1834 static void conditionalAttr1AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
1835 { | 1835 { |
1836 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1836 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1837 TestObjV8Internal::conditionalAttr1AttributeGetter(info); | 1837 TestObjV8Internal::conditionalAttr1AttributeGetter(info); |
1838 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1838 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1839 } | 1839 } |
1840 #endif // ENABLE(Condition1) | 1840 #endif // ENABLE(Condition1) |
1841 | 1841 |
1842 #if ENABLE(Condition1) | 1842 #if ENABLE(Condition1) |
1843 static void conditionalAttr1AttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 1843 static void conditionalAttr1AttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
1844 { | 1844 { |
1845 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAtt
r1", "TestObject", info.Holder(), info.GetIsolate()); | 1845 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAtt
r1", "TestObject", info.Holder(), info.GetIsolate()); |
1846 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1846 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1847 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 1847 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
1848 imp->setConditionalAttr1(cppValue); | 1848 imp->setConditionalAttr1(cppValue); |
1849 } | 1849 } |
1850 #endif // ENABLE(Condition1) | 1850 #endif // ENABLE(Condition1) |
1851 | 1851 |
1852 #if ENABLE(Condition1) | 1852 #if ENABLE(Condition1) |
1853 static void conditionalAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1853 static void conditionalAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1854 { | 1854 { |
1855 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1855 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1856 TestObjV8Internal::conditionalAttr1AttributeSetter(jsValue, info); | 1856 TestObjV8Internal::conditionalAttr1AttributeSetter(jsValue, info); |
1857 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1857 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1858 } | 1858 } |
1859 #endif // ENABLE(Condition1) | 1859 #endif // ENABLE(Condition1) |
1860 | 1860 |
1861 #if ENABLE(Condition1) && ENABLE(Condition2) | 1861 #if ENABLE(Condition1) && ENABLE(Condition2) |
1862 static void conditionalAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 1862 static void conditionalAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
1863 { | 1863 { |
1864 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1864 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1865 v8SetReturnValueInt(info, imp->conditionalAttr2()); | 1865 v8SetReturnValueInt(info, imp->conditionalAttr2()); |
1866 } | 1866 } |
1867 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 1867 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
1868 | 1868 |
1869 #if ENABLE(Condition1) && ENABLE(Condition2) | 1869 #if ENABLE(Condition1) && ENABLE(Condition2) |
1870 static void conditionalAttr2AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 1870 static void conditionalAttr2AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
1871 { | 1871 { |
1872 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1872 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1873 TestObjV8Internal::conditionalAttr2AttributeGetter(info); | 1873 TestObjV8Internal::conditionalAttr2AttributeGetter(info); |
1874 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1874 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1875 } | 1875 } |
1876 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 1876 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
1877 | 1877 |
1878 #if ENABLE(Condition1) && ENABLE(Condition2) | 1878 #if ENABLE(Condition1) && ENABLE(Condition2) |
1879 static void conditionalAttr2AttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 1879 static void conditionalAttr2AttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
1880 { | 1880 { |
1881 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAtt
r2", "TestObject", info.Holder(), info.GetIsolate()); | 1881 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAtt
r2", "TestObject", info.Holder(), info.GetIsolate()); |
1882 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1882 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1883 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 1883 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
1884 imp->setConditionalAttr2(cppValue); | 1884 imp->setConditionalAttr2(cppValue); |
1885 } | 1885 } |
1886 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 1886 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
1887 | 1887 |
1888 #if ENABLE(Condition1) && ENABLE(Condition2) | 1888 #if ENABLE(Condition1) && ENABLE(Condition2) |
1889 static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1889 static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1890 { | 1890 { |
1891 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1891 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1892 TestObjV8Internal::conditionalAttr2AttributeSetter(jsValue, info); | 1892 TestObjV8Internal::conditionalAttr2AttributeSetter(jsValue, info); |
1893 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1893 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1894 } | 1894 } |
1895 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 1895 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
1896 | 1896 |
1897 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) | 1897 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1898 static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 1898 static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
1899 { | 1899 { |
1900 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1900 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1901 v8SetReturnValueInt(info, imp->conditionalAttr3()); | 1901 v8SetReturnValueInt(info, imp->conditionalAttr3()); |
1902 } | 1902 } |
1903 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) | 1903 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1904 | 1904 |
1905 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) | 1905 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1906 static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 1906 static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
1907 { | 1907 { |
1908 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1908 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1909 TestObjV8Internal::conditionalAttr3AttributeGetter(info); | 1909 TestObjV8Internal::conditionalAttr3AttributeGetter(info); |
1910 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1910 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1911 } | 1911 } |
1912 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) | 1912 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1913 | 1913 |
1914 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) | 1914 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1915 static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 1915 static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
1916 { | 1916 { |
1917 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAtt
r3", "TestObject", info.Holder(), info.GetIsolate()); | 1917 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAtt
r3", "TestObject", info.Holder(), info.GetIsolate()); |
1918 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1918 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1919 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 1919 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
1920 imp->setConditionalAttr3(cppValue); | 1920 imp->setConditionalAttr3(cppValue); |
1921 } | 1921 } |
1922 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) | 1922 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1923 | 1923 |
1924 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) | 1924 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1925 static void conditionalAttr3AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1925 static void conditionalAttr3AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1926 { | 1926 { |
1927 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1927 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1928 TestObjV8Internal::conditionalAttr3AttributeSetter(jsValue, info); | 1928 TestObjV8Internal::conditionalAttr3AttributeSetter(jsValue, info); |
1929 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1929 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1930 } | 1930 } |
1931 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) | 1931 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1932 | 1932 |
1933 static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 1933 static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
1934 { | 1934 { |
1935 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1935 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1936 v8SetReturnValue(info, imp->cachedAttribute1().v8Value()); | 1936 v8SetReturnValue(info, imp->cachedAttribute1().v8Value()); |
1937 } | 1937 } |
1938 | 1938 |
1939 static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 1939 static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
1940 { | 1940 { |
1941 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1941 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1942 TestObjV8Internal::cachedAttribute1AttributeGetter(info); | 1942 TestObjV8Internal::cachedAttribute1AttributeGetter(info); |
1943 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1943 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1944 } | 1944 } |
1945 | 1945 |
1946 static void cachedAttribute2AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 1946 static void cachedAttribute2AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
1947 { | 1947 { |
1948 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1948 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1949 v8SetReturnValue(info, imp->cachedAttribute2().v8Value()); | 1949 v8SetReturnValue(info, imp->cachedAttribute2().v8Value()); |
1950 } | 1950 } |
1951 | 1951 |
1952 static void cachedAttribute2AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 1952 static void cachedAttribute2AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
1953 { | 1953 { |
1954 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1954 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1955 TestObjV8Internal::cachedAttribute2AttributeGetter(info); | 1955 TestObjV8Internal::cachedAttribute2AttributeGetter(info); |
1956 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1956 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1957 } | 1957 } |
1958 | 1958 |
1959 static void cachedDirtyableAttributeAttributeGetter(const v8::PropertyCallbackIn
fo<v8::Value>& info) | 1959 static void cachedDirtyableAttributeAttributeGetter(const v8::PropertyCallbackIn
fo<v8::Value>& info) |
1960 { | 1960 { |
1961 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac
hedDirtyableAttribute"); | 1961 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac
hedDirtyableAttribute"); |
1962 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1962 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1963 if (!imp->isValueDirty()) { | 1963 if (!imp->isValueDirty()) { |
1964 v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyNa
me); | 1964 v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyNa
me); |
1965 if (!jsValue.IsEmpty()) { | 1965 if (!jsValue.IsEmpty()) { |
1966 v8SetReturnValue(info, jsValue); | 1966 v8SetReturnValue(info, jsValue); |
1967 return; | 1967 return; |
1968 } | 1968 } |
1969 } | 1969 } |
1970 ScriptValue jsValue = imp->cachedDirtyableAttribute(); | 1970 ScriptValue jsValue = imp->cachedDirtyableAttribute(); |
1971 info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); | 1971 info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); |
1972 v8SetReturnValue(info, jsValue.v8Value()); | 1972 v8SetReturnValue(info, jsValue.v8Value()); |
1973 } | 1973 } |
1974 | 1974 |
1975 static void cachedDirtyableAttributeAttributeGetterCallback(v8::Local<v8::String
>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1975 static void cachedDirtyableAttributeAttributeGetterCallback(v8::Local<v8::String
>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1976 { | 1976 { |
1977 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1977 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1978 TestObjV8Internal::cachedDirtyableAttributeAttributeGetter(info); | 1978 TestObjV8Internal::cachedDirtyableAttributeAttributeGetter(info); |
1979 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1979 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1980 } | 1980 } |
1981 | 1981 |
1982 static void cachedDirtyableAttributeRaisesAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | 1982 static void cachedDirtyableAttributeRaisesAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) |
1983 { | 1983 { |
1984 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac
hedDirtyableAttributeRaises"); | 1984 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac
hedDirtyableAttributeRaises"); |
1985 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1985 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1986 if (!imp->isValueDirty()) { | 1986 if (!imp->isValueDirty()) { |
1987 v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyNa
me); | 1987 v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyNa
me); |
1988 if (!jsValue.IsEmpty()) { | 1988 if (!jsValue.IsEmpty()) { |
1989 v8SetReturnValue(info, jsValue); | 1989 v8SetReturnValue(info, jsValue); |
1990 return; | 1990 return; |
1991 } | 1991 } |
1992 } | 1992 } |
1993 ExceptionState exceptionState(ExceptionState::GetterContext, "cachedDirtyabl
eAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); | 1993 ExceptionState exceptionState(ExceptionState::GetterContext, "cachedDirtyabl
eAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); |
1994 ScriptValue jsValue = imp->cachedDirtyableAttributeRaises(exceptionState); | 1994 ScriptValue jsValue = imp->cachedDirtyableAttributeRaises(exceptionState); |
1995 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1995 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1996 return; | 1996 return; |
1997 info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); | 1997 info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); |
1998 v8SetReturnValue(info, jsValue.v8Value()); | 1998 v8SetReturnValue(info, jsValue.v8Value()); |
1999 } | 1999 } |
2000 | 2000 |
2001 static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2001 static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2002 { | 2002 { |
2003 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2003 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2004 TestObjV8Internal::cachedDirtyableAttributeRaisesAttributeGetter(info); | 2004 TestObjV8Internal::cachedDirtyableAttributeRaisesAttributeGetter(info); |
2005 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2005 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2006 } | 2006 } |
2007 | 2007 |
2008 static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value
>& info) | 2008 static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value
>& info) |
2009 { | 2009 { |
2010 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2010 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2011 v8SetReturnValue(info, imp->anyAttribute().v8Value()); | 2011 v8SetReturnValue(info, imp->anyAttribute().v8Value()); |
2012 } | 2012 } |
2013 | 2013 |
2014 static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8:
:PropertyCallbackInfo<v8::Value>& info) | 2014 static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8:
:PropertyCallbackInfo<v8::Value>& info) |
2015 { | 2015 { |
2016 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2016 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2017 TestObjV8Internal::anyAttributeAttributeGetter(info); | 2017 TestObjV8Internal::anyAttributeAttributeGetter(info); |
2018 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2018 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2019 } | 2019 } |
2020 | 2020 |
2021 static void anyAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::
PropertyCallbackInfo<void>& info) | 2021 static void anyAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::
PropertyCallbackInfo<void>& info) |
2022 { | 2022 { |
2023 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2023 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2024 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate(
))); | 2024 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate(
))); |
2025 imp->setAnyAttribute(cppValue); | 2025 imp->setAnyAttribute(cppValue); |
2026 } | 2026 } |
2027 | 2027 |
2028 static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2028 static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2029 { | 2029 { |
2030 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2030 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2031 TestObjV8Internal::anyAttributeAttributeSetter(jsValue, info); | 2031 TestObjV8Internal::anyAttributeAttributeSetter(jsValue, info); |
2032 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2032 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2033 } | 2033 } |
2034 | 2034 |
2035 static void callbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 2035 static void callbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
2036 { | 2036 { |
2037 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2037 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2038 v8SetReturnValue(info, imp->callbackFunctionAttribute().v8Value()); | 2038 v8SetReturnValue(info, imp->callbackFunctionAttribute().v8Value()); |
2039 } | 2039 } |
2040 | 2040 |
2041 static void callbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2041 static void callbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2042 { | 2042 { |
2043 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2043 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2044 TestObjV8Internal::callbackFunctionAttributeAttributeGetter(info); | 2044 TestObjV8Internal::callbackFunctionAttributeAttributeGetter(info); |
2045 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2045 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2046 } | 2046 } |
2047 | 2047 |
2048 static void callbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) | 2048 static void callbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) |
2049 { | 2049 { |
2050 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2050 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2051 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate(
))); | 2051 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate(
))); |
2052 imp->setCallbackFunctionAttribute(cppValue); | 2052 imp->setCallbackFunctionAttribute(cppValue); |
2053 } | 2053 } |
2054 | 2054 |
2055 static void callbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2055 static void callbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2056 { | 2056 { |
2057 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2057 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2058 TestObjV8Internal::callbackFunctionAttributeAttributeSetter(jsValue, info); | 2058 TestObjV8Internal::callbackFunctionAttributeAttributeSetter(jsValue, info); |
2059 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2059 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2060 } | 2060 } |
2061 | 2061 |
2062 static void enabledAtRuntimeAttrAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) | 2062 static void enabledAtRuntimeAttrAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) |
2063 { | 2063 { |
2064 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2064 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2065 v8SetReturnValueInt(info, imp->enabledAtRuntimeAttr()); | 2065 v8SetReturnValueInt(info, imp->enabledAtRuntimeAttr()); |
2066 } | 2066 } |
2067 | 2067 |
2068 static void enabledAtRuntimeAttrAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 2068 static void enabledAtRuntimeAttrAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
2069 { | 2069 { |
2070 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2070 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2071 TestObjV8Internal::enabledAtRuntimeAttrAttributeGetter(info); | 2071 TestObjV8Internal::enabledAtRuntimeAttrAttributeGetter(info); |
2072 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2072 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2073 } | 2073 } |
2074 | 2074 |
2075 static void enabledAtRuntimeAttrAttributeSetter(v8::Local<v8::Value> jsValue, co
nst v8::PropertyCallbackInfo<void>& info) | 2075 static void enabledAtRuntimeAttrAttributeSetter(v8::Local<v8::Value> jsValue, co
nst v8::PropertyCallbackInfo<void>& info) |
2076 { | 2076 { |
2077 ExceptionState exceptionState(ExceptionState::SetterContext, "enabledAtRunti
meAttr", "TestObject", info.Holder(), info.GetIsolate()); | 2077 ExceptionState exceptionState(ExceptionState::SetterContext, "enabledAtRunti
meAttr", "TestObject", info.Holder(), info.GetIsolate()); |
2078 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2078 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2079 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2079 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2080 imp->setEnabledAtRuntimeAttr(cppValue); | 2080 imp->setEnabledAtRuntimeAttr(cppValue); |
2081 } | 2081 } |
2082 | 2082 |
2083 static void enabledAtRuntimeAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2083 static void enabledAtRuntimeAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2084 { | 2084 { |
2085 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2085 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2086 TestObjV8Internal::enabledAtRuntimeAttrAttributeSetter(jsValue, info); | 2086 TestObjV8Internal::enabledAtRuntimeAttrAttributeSetter(jsValue, info); |
2087 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2087 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2088 } | 2088 } |
2089 | 2089 |
2090 static void enabledPerContextAttrAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | 2090 static void enabledPerContextAttrAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) |
2091 { | 2091 { |
2092 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2092 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2093 v8SetReturnValueInt(info, imp->enabledPerContextAttr()); | 2093 v8SetReturnValueInt(info, imp->enabledPerContextAttr()); |
2094 } | 2094 } |
2095 | 2095 |
2096 static void enabledPerContextAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 2096 static void enabledPerContextAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
2097 { | 2097 { |
2098 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2098 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2099 TestObjV8Internal::enabledPerContextAttrAttributeGetter(info); | 2099 TestObjV8Internal::enabledPerContextAttrAttributeGetter(info); |
2100 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2100 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2101 } | 2101 } |
2102 | 2102 |
2103 static void enabledPerContextAttrAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) | 2103 static void enabledPerContextAttrAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) |
2104 { | 2104 { |
2105 ExceptionState exceptionState(ExceptionState::SetterContext, "enabledPerCont
extAttr", "TestObject", info.Holder(), info.GetIsolate()); | 2105 ExceptionState exceptionState(ExceptionState::SetterContext, "enabledPerCont
extAttr", "TestObject", info.Holder(), info.GetIsolate()); |
2106 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2106 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2107 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2107 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2108 imp->setEnabledPerContextAttr(cppValue); | 2108 imp->setEnabledPerContextAttr(cppValue); |
2109 } | 2109 } |
2110 | 2110 |
2111 static void enabledPerContextAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2111 static void enabledPerContextAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2112 { | 2112 { |
2113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2114 TestObjV8Internal::enabledPerContextAttrAttributeSetter(jsValue, info); | 2114 TestObjV8Internal::enabledPerContextAttrAttributeSetter(jsValue, info); |
2115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2116 } | 2116 } |
2117 | 2117 |
2118 static void floatArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) | 2118 static void floatArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) |
2119 { | 2119 { |
2120 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2120 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2121 v8SetReturnValue(info, v8Array(imp->floatArray(), info.GetIsolate())); | 2121 v8SetReturnValue(info, v8Array(imp->floatArray(), info.GetIsolate())); |
2122 } | 2122 } |
2123 | 2123 |
2124 static void floatArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 2124 static void floatArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
2125 { | 2125 { |
2126 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2126 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2127 TestObjV8Internal::floatArrayAttributeGetter(info); | 2127 TestObjV8Internal::floatArrayAttributeGetter(info); |
2128 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2128 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2129 } | 2129 } |
2130 | 2130 |
2131 static void floatArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) | 2131 static void floatArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) |
2132 { | 2132 { |
2133 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2133 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2134 V8TRYCATCH_VOID(Vector<float>, cppValue, toNativeArray<float>(jsValue, 0, in
fo.GetIsolate())); | 2134 V8TRYCATCH_VOID(Vector<float>, cppValue, toNativeArray<float>(jsValue, 0, in
fo.GetIsolate())); |
2135 imp->setFloatArray(cppValue); | 2135 imp->setFloatArray(cppValue); |
2136 } | 2136 } |
2137 | 2137 |
2138 static void floatArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2138 static void floatArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2139 { | 2139 { |
2140 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2140 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2141 TestObjV8Internal::floatArrayAttributeSetter(jsValue, info); | 2141 TestObjV8Internal::floatArrayAttributeSetter(jsValue, info); |
2142 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2142 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2143 } | 2143 } |
2144 | 2144 |
2145 static void doubleArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>
& info) | 2145 static void doubleArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>
& info) |
2146 { | 2146 { |
2147 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2147 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2148 v8SetReturnValue(info, v8Array(imp->doubleArray(), info.GetIsolate())); | 2148 v8SetReturnValue(info, v8Array(imp->doubleArray(), info.GetIsolate())); |
2149 } | 2149 } |
2150 | 2150 |
2151 static void doubleArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) | 2151 static void doubleArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) |
2152 { | 2152 { |
2153 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2153 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2154 TestObjV8Internal::doubleArrayAttributeGetter(info); | 2154 TestObjV8Internal::doubleArrayAttributeGetter(info); |
2155 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2155 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2156 } | 2156 } |
2157 | 2157 |
2158 static void doubleArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) | 2158 static void doubleArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) |
2159 { | 2159 { |
2160 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2160 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2161 V8TRYCATCH_VOID(Vector<double>, cppValue, toNativeArray<double>(jsValue, 0,
info.GetIsolate())); | 2161 V8TRYCATCH_VOID(Vector<double>, cppValue, toNativeArray<double>(jsValue, 0,
info.GetIsolate())); |
2162 imp->setDoubleArray(cppValue); | 2162 imp->setDoubleArray(cppValue); |
2163 } | 2163 } |
2164 | 2164 |
2165 static void doubleArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2165 static void doubleArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2166 { | 2166 { |
2167 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2167 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2168 TestObjV8Internal::doubleArrayAttributeSetter(jsValue, info); | 2168 TestObjV8Internal::doubleArrayAttributeSetter(jsValue, info); |
2169 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2169 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2170 } | 2170 } |
2171 | 2171 |
2172 static void messagePortArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 2172 static void messagePortArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
2173 { | 2173 { |
2174 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2174 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2175 v8SetReturnValue(info, v8Array(imp->messagePortArray(), info.GetIsolate())); | 2175 v8SetReturnValue(info, v8Array(imp->messagePortArray(), info.GetIsolate())); |
2176 } | 2176 } |
2177 | 2177 |
2178 static void messagePortArrayAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 2178 static void messagePortArrayAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
2179 { | 2179 { |
2180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2181 TestObjV8Internal::messagePortArrayAttributeGetter(info); | 2181 TestObjV8Internal::messagePortArrayAttributeGetter(info); |
2182 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2182 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2183 } | 2183 } |
2184 | 2184 |
2185 static void messagePortArrayAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 2185 static void messagePortArrayAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
2186 { | 2186 { |
2187 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2187 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2188 V8TRYCATCH_VOID(Vector<RefPtr<MessagePort> >, cppValue, (toRefPtrNativeArray
<MessagePort, V8MessagePort>(jsValue, 0, info.GetIsolate()))); | 2188 V8TRYCATCH_VOID(Vector<RefPtr<MessagePort> >, cppValue, (toRefPtrNativeArray
<MessagePort, V8MessagePort>(jsValue, 0, info.GetIsolate()))); |
2189 imp->setMessagePortArray(cppValue); | 2189 imp->setMessagePortArray(cppValue); |
2190 } | 2190 } |
2191 | 2191 |
2192 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2192 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2193 { | 2193 { |
2194 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2194 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2195 TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info); | 2195 TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info); |
2196 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2196 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2197 } | 2197 } |
2198 | 2198 |
2199 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Va
lue>& info) | 2199 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Va
lue>& info) |
2200 { | 2200 { |
2201 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2201 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2202 ExceptionState exceptionState(ExceptionState::GetterContext, "contentDocumen
t", "TestObject", info.Holder(), info.GetIsolate()); | 2202 ExceptionState exceptionState(ExceptionState::GetterContext, "contentDocumen
t", "TestObject", info.Holder(), info.GetIsolate()); |
2203 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), except
ionState)) { | 2203 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), except
ionState)) { |
2204 v8SetReturnValueNull(info); | 2204 v8SetReturnValueNull(info); |
2205 exceptionState.throwIfNeeded(); | 2205 exceptionState.throwIfNeeded(); |
2206 return; | 2206 return; |
2207 } | 2207 } |
2208 v8SetReturnValueFast(info, imp->contentDocument(), imp); | 2208 v8SetReturnValueFast(info, imp->contentDocument(), imp); |
2209 } | 2209 } |
2210 | 2210 |
2211 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 2211 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
2212 { | 2212 { |
2213 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2213 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2214 TestObjV8Internal::contentDocumentAttributeGetter(info); | 2214 TestObjV8Internal::contentDocumentAttributeGetter(info); |
2215 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2215 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2216 } | 2216 } |
2217 | 2217 |
2218 static void strawberryAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) | 2218 static void strawberryAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) |
2219 { | 2219 { |
2220 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2220 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2221 v8SetReturnValueInt(info, imp->blueberry()); | 2221 v8SetReturnValueInt(info, imp->blueberry()); |
2222 } | 2222 } |
2223 | 2223 |
2224 static void strawberryAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 2224 static void strawberryAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
2225 { | 2225 { |
2226 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2226 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2227 TestObjV8Internal::strawberryAttributeGetter(info); | 2227 TestObjV8Internal::strawberryAttributeGetter(info); |
2228 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2228 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2229 } | 2229 } |
2230 | 2230 |
2231 static void strawberryAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) | 2231 static void strawberryAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) |
2232 { | 2232 { |
2233 ExceptionState exceptionState(ExceptionState::SetterContext, "strawberry", "
TestObject", info.Holder(), info.GetIsolate()); | 2233 ExceptionState exceptionState(ExceptionState::SetterContext, "strawberry", "
TestObject", info.Holder(), info.GetIsolate()); |
2234 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2234 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2235 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2235 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2236 imp->setBlueberry(cppValue); | 2236 imp->setBlueberry(cppValue); |
2237 } | 2237 } |
2238 | 2238 |
2239 static void strawberryAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2239 static void strawberryAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2240 { | 2240 { |
2241 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2241 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2242 TestObjV8Internal::strawberryAttributeSetter(jsValue, info); | 2242 TestObjV8Internal::strawberryAttributeSetter(jsValue, info); |
2243 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2243 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2244 } | 2244 } |
2245 | 2245 |
2246 static void strictFloatAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>
& info) | 2246 static void strictFloatAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>
& info) |
2247 { | 2247 { |
2248 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2248 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2249 v8SetReturnValue(info, imp->strictFloat()); | 2249 v8SetReturnValue(info, imp->strictFloat()); |
2250 } | 2250 } |
2251 | 2251 |
2252 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) | 2252 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) |
2253 { | 2253 { |
2254 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2254 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2255 TestObjV8Internal::strictFloatAttributeGetter(info); | 2255 TestObjV8Internal::strictFloatAttributeGetter(info); |
2256 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2256 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2257 } | 2257 } |
2258 | 2258 |
2259 static void strictFloatAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) | 2259 static void strictFloatAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) |
2260 { | 2260 { |
2261 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2261 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2262 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue()))
; | 2262 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue()))
; |
2263 imp->setStrictFloat(cppValue); | 2263 imp->setStrictFloat(cppValue); |
2264 } | 2264 } |
2265 | 2265 |
2266 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2266 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2267 { | 2267 { |
2268 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2268 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2269 TestObjV8Internal::strictFloatAttributeSetter(jsValue, info); | 2269 TestObjV8Internal::strictFloatAttributeSetter(jsValue, info); |
2270 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2270 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2271 } | 2271 } |
2272 | 2272 |
2273 static void replaceableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) | 2273 static void replaceableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) |
2274 { | 2274 { |
2275 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2275 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2276 v8SetReturnValueInt(info, imp->replaceableAttribute()); | 2276 v8SetReturnValueInt(info, imp->replaceableAttribute()); |
2277 } | 2277 } |
2278 | 2278 |
2279 static void replaceableAttributeAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 2279 static void replaceableAttributeAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
2280 { | 2280 { |
2281 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2281 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2282 TestObjV8Internal::replaceableAttributeAttributeGetter(info); | 2282 TestObjV8Internal::replaceableAttributeAttributeGetter(info); |
2283 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2283 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2284 } | 2284 } |
2285 | 2285 |
2286 static void nullableDoubleAttributeAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) | 2286 static void nullableDoubleAttributeAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) |
2287 { | 2287 { |
2288 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2288 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2289 bool isNull = false; | 2289 bool isNull = false; |
2290 double jsValue = imp->nullableDoubleAttribute(isNull); | 2290 double jsValue = imp->nullableDoubleAttribute(isNull); |
2291 if (isNull) { | 2291 if (isNull) { |
2292 v8SetReturnValueNull(info); | 2292 v8SetReturnValueNull(info); |
2293 return; | 2293 return; |
2294 } | 2294 } |
2295 v8SetReturnValue(info, jsValue); | 2295 v8SetReturnValue(info, jsValue); |
2296 } | 2296 } |
2297 | 2297 |
2298 static void nullableDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) | 2298 static void nullableDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
2299 { | 2299 { |
2300 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2300 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2301 TestObjV8Internal::nullableDoubleAttributeAttributeGetter(info); | 2301 TestObjV8Internal::nullableDoubleAttributeAttributeGetter(info); |
2302 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2302 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2303 } | 2303 } |
2304 | 2304 |
2305 static void nullableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | 2305 static void nullableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) |
2306 { | 2306 { |
2307 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2307 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2308 bool isNull = false; | 2308 bool isNull = false; |
2309 int jsValue = imp->nullableLongAttribute(isNull); | 2309 int jsValue = imp->nullableLongAttribute(isNull); |
2310 if (isNull) { | 2310 if (isNull) { |
2311 v8SetReturnValueNull(info); | 2311 v8SetReturnValueNull(info); |
2312 return; | 2312 return; |
2313 } | 2313 } |
2314 v8SetReturnValueInt(info, jsValue); | 2314 v8SetReturnValueInt(info, jsValue); |
2315 } | 2315 } |
2316 | 2316 |
2317 static void nullableLongAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 2317 static void nullableLongAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
2318 { | 2318 { |
2319 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2319 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2320 TestObjV8Internal::nullableLongAttributeAttributeGetter(info); | 2320 TestObjV8Internal::nullableLongAttributeAttributeGetter(info); |
2321 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2321 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2322 } | 2322 } |
2323 | 2323 |
2324 static void nullableBooleanAttributeAttributeGetter(const v8::PropertyCallbackIn
fo<v8::Value>& info) | 2324 static void nullableBooleanAttributeAttributeGetter(const v8::PropertyCallbackIn
fo<v8::Value>& info) |
2325 { | 2325 { |
2326 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2326 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2327 bool isNull = false; | 2327 bool isNull = false; |
2328 bool jsValue = imp->nullableBooleanAttribute(isNull); | 2328 bool jsValue = imp->nullableBooleanAttribute(isNull); |
2329 if (isNull) { | 2329 if (isNull) { |
2330 v8SetReturnValueNull(info); | 2330 v8SetReturnValueNull(info); |
2331 return; | 2331 return; |
2332 } | 2332 } |
2333 v8SetReturnValueBool(info, jsValue); | 2333 v8SetReturnValueBool(info, jsValue); |
2334 } | 2334 } |
2335 | 2335 |
2336 static void nullableBooleanAttributeAttributeGetterCallback(v8::Local<v8::String
>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2336 static void nullableBooleanAttributeAttributeGetterCallback(v8::Local<v8::String
>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2337 { | 2337 { |
2338 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2338 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2339 TestObjV8Internal::nullableBooleanAttributeAttributeGetter(info); | 2339 TestObjV8Internal::nullableBooleanAttributeAttributeGetter(info); |
2340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2341 } | 2341 } |
2342 | 2342 |
2343 static void nullableStringAttributeAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) | 2343 static void nullableStringAttributeAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) |
2344 { | 2344 { |
2345 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2345 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2346 bool isNull = false; | 2346 bool isNull = false; |
2347 String jsValue = imp->nullableStringAttribute(isNull); | 2347 String jsValue = imp->nullableStringAttribute(isNull); |
2348 if (isNull) { | 2348 if (isNull) { |
2349 v8SetReturnValueNull(info); | 2349 v8SetReturnValueNull(info); |
2350 return; | 2350 return; |
2351 } | 2351 } |
2352 v8SetReturnValueString(info, jsValue, info.GetIsolate()); | 2352 v8SetReturnValueString(info, jsValue, info.GetIsolate()); |
2353 } | 2353 } |
2354 | 2354 |
2355 static void nullableStringAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) | 2355 static void nullableStringAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
2356 { | 2356 { |
2357 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2357 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2358 TestObjV8Internal::nullableStringAttributeAttributeGetter(info); | 2358 TestObjV8Internal::nullableStringAttributeAttributeGetter(info); |
2359 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2359 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2360 } | 2360 } |
2361 | 2361 |
2362 static void nullableLongSettableAttributeAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) | 2362 static void nullableLongSettableAttributeAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) |
2363 { | 2363 { |
2364 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2364 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2365 bool isNull = false; | 2365 bool isNull = false; |
2366 int jsValue = imp->nullableLongSettableAttribute(isNull); | 2366 int jsValue = imp->nullableLongSettableAttribute(isNull); |
2367 if (isNull) { | 2367 if (isNull) { |
2368 v8SetReturnValueNull(info); | 2368 v8SetReturnValueNull(info); |
2369 return; | 2369 return; |
2370 } | 2370 } |
2371 v8SetReturnValueInt(info, jsValue); | 2371 v8SetReturnValueInt(info, jsValue); |
2372 } | 2372 } |
2373 | 2373 |
2374 static void nullableLongSettableAttributeAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2374 static void nullableLongSettableAttributeAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2375 { | 2375 { |
2376 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2376 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2377 TestObjV8Internal::nullableLongSettableAttributeAttributeGetter(info); | 2377 TestObjV8Internal::nullableLongSettableAttributeAttributeGetter(info); |
2378 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2378 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2379 } | 2379 } |
2380 | 2380 |
2381 static void nullableLongSettableAttributeAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 2381 static void nullableLongSettableAttributeAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
2382 { | 2382 { |
2383 ExceptionState exceptionState(ExceptionState::SetterContext, "nullableLongSe
ttableAttribute", "TestObject", info.Holder(), info.GetIsolate()); | 2383 ExceptionState exceptionState(ExceptionState::SetterContext, "nullableLongSe
ttableAttribute", "TestObject", info.Holder(), info.GetIsolate()); |
2384 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2384 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2385 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2385 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2386 imp->setNullableLongSettableAttribute(cppValue); | 2386 imp->setNullableLongSettableAttribute(cppValue); |
2387 } | 2387 } |
2388 | 2388 |
2389 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 2389 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
2390 { | 2390 { |
2391 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2391 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2392 TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, inf
o); | 2392 TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, inf
o); |
2393 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2393 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2394 } | 2394 } |
2395 | 2395 |
2396 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) | 2396 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) |
2397 { | 2397 { |
2398 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2398 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2399 ExceptionState exceptionState(ExceptionState::GetterContext, "nullableString
Value", "TestObject", info.Holder(), info.GetIsolate()); | 2399 ExceptionState exceptionState(ExceptionState::GetterContext, "nullableString
Value", "TestObject", info.Holder(), info.GetIsolate()); |
2400 bool isNull = false; | 2400 bool isNull = false; |
2401 int jsValue = imp->nullableStringValue(isNull, exceptionState); | 2401 int jsValue = imp->nullableStringValue(isNull, exceptionState); |
2402 if (isNull) { | 2402 if (isNull) { |
2403 v8SetReturnValueNull(info); | 2403 v8SetReturnValueNull(info); |
2404 return; | 2404 return; |
2405 } | 2405 } |
2406 if (UNLIKELY(exceptionState.throwIfNeeded())) | 2406 if (UNLIKELY(exceptionState.throwIfNeeded())) |
2407 return; | 2407 return; |
2408 v8SetReturnValueInt(info, jsValue); | 2408 v8SetReturnValueInt(info, jsValue); |
2409 } | 2409 } |
2410 | 2410 |
2411 static void nullableStringValueAttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) | 2411 static void nullableStringValueAttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) |
2412 { | 2412 { |
2413 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2413 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2414 TestObjV8Internal::nullableStringValueAttributeGetter(info); | 2414 TestObjV8Internal::nullableStringValueAttributeGetter(info); |
2415 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2415 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2416 } | 2416 } |
2417 | 2417 |
2418 static void nullableStringValueAttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) | 2418 static void nullableStringValueAttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) |
2419 { | 2419 { |
2420 ExceptionState exceptionState(ExceptionState::SetterContext, "nullableString
Value", "TestObject", info.Holder(), info.GetIsolate()); | 2420 ExceptionState exceptionState(ExceptionState::SetterContext, "nullableString
Value", "TestObject", info.Holder(), info.GetIsolate()); |
2421 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2421 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2422 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2422 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2423 imp->setNullableStringValue(cppValue); | 2423 imp->setNullableStringValue(cppValue); |
2424 } | 2424 } |
2425 | 2425 |
2426 static void nullableStringValueAttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2426 static void nullableStringValueAttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2427 { | 2427 { |
2428 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2428 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2429 TestObjV8Internal::nullableStringValueAttributeSetter(jsValue, info); | 2429 TestObjV8Internal::nullableStringValueAttributeSetter(jsValue, info); |
2430 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2430 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2431 } | 2431 } |
2432 | 2432 |
2433 static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 2433 static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
2434 { | 2434 { |
2435 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2435 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2436 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); | 2436 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); |
2437 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.Get
ReturnValue(), result.get())) | 2437 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.Get
ReturnValue(), result.get())) |
2438 return; | 2438 return; |
2439 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); | 2439 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); |
2440 if (!wrapper.IsEmpty()) { | 2440 if (!wrapper.IsEmpty()) { |
2441 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWorldRe
adOnlyAttribute", wrapper); | 2441 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWorldRe
adOnlyAttribute", wrapper); |
2442 v8SetReturnValue(info, wrapper); | 2442 v8SetReturnValue(info, wrapper); |
2443 } | 2443 } |
2444 } | 2444 } |
2445 | 2445 |
2446 static void perWorldReadOnlyAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2446 static void perWorldReadOnlyAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2447 { | 2447 { |
2448 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2448 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2449 TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetter(info); | 2449 TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetter(info); |
2450 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2450 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2451 } | 2451 } |
2452 | 2452 |
2453 static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::Prope
rtyCallbackInfo<v8::Value>& info) | 2453 static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
2454 { | 2454 { |
2455 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2455 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2456 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); | 2456 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); |
2457 if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObje
ct>(info.GetReturnValue(), result.get())) | 2457 if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObje
ct>(info.GetReturnValue(), result.get())) |
2458 return; | 2458 return; |
2459 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); | 2459 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); |
2460 if (!wrapper.IsEmpty()) { | 2460 if (!wrapper.IsEmpty()) { |
2461 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWorldRe
adOnlyAttribute", wrapper); | 2461 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWorldRe
adOnlyAttribute", wrapper); |
2462 v8SetReturnValue(info, wrapper); | 2462 v8SetReturnValue(info, wrapper); |
2463 } | 2463 } |
2464 } | 2464 } |
2465 | 2465 |
2466 static void perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2466 static void perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2467 { | 2467 { |
2468 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2468 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2469 TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterForMainWorld(info
); | 2469 TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterForMainWorld(info
); |
2470 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2470 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2471 } | 2471 } |
2472 | 2472 |
2473 static void perWorldAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::
Value>& info) | 2473 static void perWorldAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::
Value>& info) |
2474 { | 2474 { |
2475 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2475 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2476 v8SetReturnValueFast(info, imp->perWorldAttribute(), imp); | 2476 v8SetReturnValueFast(info, imp->perWorldAttribute(), imp); |
2477 } | 2477 } |
2478 | 2478 |
2479 static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, cons
t v8::PropertyCallbackInfo<v8::Value>& info) | 2479 static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, cons
t v8::PropertyCallbackInfo<v8::Value>& info) |
2480 { | 2480 { |
2481 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2481 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2482 TestObjV8Internal::perWorldAttributeAttributeGetter(info); | 2482 TestObjV8Internal::perWorldAttributeAttributeGetter(info); |
2483 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2483 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2484 } | 2484 } |
2485 | 2485 |
2486 static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 2486 static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
2487 { | 2487 { |
2488 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2488 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2489 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 2489 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
2490 imp->setPerWorldAttribute(WTF::getPtr(cppValue)); | 2490 imp->setPerWorldAttribute(WTF::getPtr(cppValue)); |
2491 } | 2491 } |
2492 | 2492 |
2493 static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::
Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2493 static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::
Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2494 { | 2494 { |
2495 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2495 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2496 TestObjV8Internal::perWorldAttributeAttributeSetter(jsValue, info); | 2496 TestObjV8Internal::perWorldAttributeAttributeSetter(jsValue, info); |
2497 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2497 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2498 } | 2498 } |
2499 | 2499 |
2500 static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallb
ackInfo<v8::Value>& info) | 2500 static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallb
ackInfo<v8::Value>& info) |
2501 { | 2501 { |
2502 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2502 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2503 v8SetReturnValueForMainWorld(info, imp->perWorldAttribute()); | 2503 v8SetReturnValueForMainWorld(info, imp->perWorldAttribute()); |
2504 } | 2504 } |
2505 | 2505 |
2506 static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2506 static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2507 { | 2507 { |
2508 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2508 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2509 TestObjV8Internal::perWorldAttributeAttributeGetterForMainWorld(info); | 2509 TestObjV8Internal::perWorldAttributeAttributeGetterForMainWorld(info); |
2510 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2510 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2511 } | 2511 } |
2512 | 2512 |
2513 static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 2513 static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
2514 { | 2514 { |
2515 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2515 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2516 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 2516 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); |
2517 imp->setPerWorldAttribute(WTF::getPtr(cppValue)); | 2517 imp->setPerWorldAttribute(WTF::getPtr(cppValue)); |
2518 } | 2518 } |
2519 | 2519 |
2520 static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 2520 static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
2521 { | 2521 { |
2522 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2522 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2523 TestObjV8Internal::perWorldAttributeAttributeSetterForMainWorld(jsValue, inf
o); | 2523 TestObjV8Internal::perWorldAttributeAttributeSetterForMainWorld(jsValue, inf
o); |
2524 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2524 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2525 } | 2525 } |
2526 | 2526 |
2527 static void activityLoggedAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) | 2527 static void activityLoggedAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) |
2528 { | 2528 { |
2529 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2529 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2530 v8SetReturnValueInt(info, imp->activityLoggedAttr1()); | 2530 v8SetReturnValueInt(info, imp->activityLoggedAttr1()); |
2531 } | 2531 } |
2532 | 2532 |
2533 static void activityLoggedAttr1AttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) | 2533 static void activityLoggedAttr1AttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) |
2534 { | 2534 { |
2535 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2535 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2536 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2536 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2537 if (contextData && contextData->activityLogger()) | 2537 if (contextData && contextData->activityLogger()) |
2538 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 0,
0, "Getter"); | 2538 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 0,
0, "Getter"); |
2539 TestObjV8Internal::activityLoggedAttr1AttributeGetter(info); | 2539 TestObjV8Internal::activityLoggedAttr1AttributeGetter(info); |
2540 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2540 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2541 } | 2541 } |
2542 | 2542 |
2543 static void activityLoggedAttr1AttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) | 2543 static void activityLoggedAttr1AttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) |
2544 { | 2544 { |
2545 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
Attr1", "TestObject", info.Holder(), info.GetIsolate()); | 2545 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
Attr1", "TestObject", info.Holder(), info.GetIsolate()); |
2546 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2546 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2547 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2547 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2548 imp->setActivityLoggedAttr1(cppValue); | 2548 imp->setActivityLoggedAttr1(cppValue); |
2549 } | 2549 } |
2550 | 2550 |
2551 static void activityLoggedAttr1AttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2551 static void activityLoggedAttr1AttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2552 { | 2552 { |
2553 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2553 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2554 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2554 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2555 if (contextData && contextData->activityLogger()) { | 2555 if (contextData && contextData->activityLogger()) { |
2556 v8::Handle<v8::Value> loggerArg[] = { jsValue }; | 2556 v8::Handle<v8::Value> loggerArg[] = { jsValue }; |
2557 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 1,
&loggerArg[0], "Setter"); | 2557 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 1,
&loggerArg[0], "Setter"); |
2558 } | 2558 } |
2559 TestObjV8Internal::activityLoggedAttr1AttributeSetter(jsValue, info); | 2559 TestObjV8Internal::activityLoggedAttr1AttributeSetter(jsValue, info); |
2560 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2560 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2561 } | 2561 } |
2562 | 2562 |
2563 static void activityLoggedAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) | 2563 static void activityLoggedAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) |
2564 { | 2564 { |
2565 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2565 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2566 v8SetReturnValueInt(info, imp->activityLoggedAttr2()); | 2566 v8SetReturnValueInt(info, imp->activityLoggedAttr2()); |
2567 } | 2567 } |
2568 | 2568 |
2569 static void activityLoggedAttr2AttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) | 2569 static void activityLoggedAttr2AttributeGetterCallback(v8::Local<v8::String>, co
nst v8::PropertyCallbackInfo<v8::Value>& info) |
2570 { | 2570 { |
2571 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2571 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2572 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2572 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2573 if (contextData && contextData->activityLogger()) | 2573 if (contextData && contextData->activityLogger()) |
2574 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0,
0, "Getter"); | 2574 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0,
0, "Getter"); |
2575 TestObjV8Internal::activityLoggedAttr2AttributeGetter(info); | 2575 TestObjV8Internal::activityLoggedAttr2AttributeGetter(info); |
2576 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2576 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2577 } | 2577 } |
2578 | 2578 |
2579 static void activityLoggedAttr2AttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) | 2579 static void activityLoggedAttr2AttributeSetter(v8::Local<v8::Value> jsValue, con
st v8::PropertyCallbackInfo<void>& info) |
2580 { | 2580 { |
2581 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
Attr2", "TestObject", info.Holder(), info.GetIsolate()); | 2581 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
Attr2", "TestObject", info.Holder(), info.GetIsolate()); |
2582 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2582 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2583 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2583 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2584 imp->setActivityLoggedAttr2(cppValue); | 2584 imp->setActivityLoggedAttr2(cppValue); |
2585 } | 2585 } |
2586 | 2586 |
2587 static void activityLoggedAttr2AttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2587 static void activityLoggedAttr2AttributeSetterCallback(v8::Local<v8::String>, v8
::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2588 { | 2588 { |
2589 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2589 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2590 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2590 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2591 if (contextData && contextData->activityLogger()) { | 2591 if (contextData && contextData->activityLogger()) { |
2592 v8::Handle<v8::Value> loggerArg[] = { jsValue }; | 2592 v8::Handle<v8::Value> loggerArg[] = { jsValue }; |
2593 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1,
&loggerArg[0], "Setter"); | 2593 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1,
&loggerArg[0], "Setter"); |
2594 } | 2594 } |
2595 TestObjV8Internal::activityLoggedAttr2AttributeSetter(jsValue, info); | 2595 TestObjV8Internal::activityLoggedAttr2AttributeSetter(jsValue, info); |
2596 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2596 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2597 } | 2597 } |
2598 | 2598 |
2599 static void activityLoggedAttr2AttributeGetterForMainWorld(const v8::PropertyCal
lbackInfo<v8::Value>& info) | 2599 static void activityLoggedAttr2AttributeGetterForMainWorld(const v8::PropertyCal
lbackInfo<v8::Value>& info) |
2600 { | 2600 { |
2601 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2601 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2602 v8SetReturnValueInt(info, imp->activityLoggedAttr2()); | 2602 v8SetReturnValueInt(info, imp->activityLoggedAttr2()); |
2603 } | 2603 } |
2604 | 2604 |
2605 static void activityLoggedAttr2AttributeGetterCallbackForMainWorld(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2605 static void activityLoggedAttr2AttributeGetterCallbackForMainWorld(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2606 { | 2606 { |
2607 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2607 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2608 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2608 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2609 if (contextData && contextData->activityLogger()) | 2609 if (contextData && contextData->activityLogger()) |
2610 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0,
0, "Getter"); | 2610 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0,
0, "Getter"); |
2611 TestObjV8Internal::activityLoggedAttr2AttributeGetterForMainWorld(info); | 2611 TestObjV8Internal::activityLoggedAttr2AttributeGetterForMainWorld(info); |
2612 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2612 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2613 } | 2613 } |
2614 | 2614 |
2615 static void activityLoggedAttr2AttributeSetterForMainWorld(v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<void>& info) | 2615 static void activityLoggedAttr2AttributeSetterForMainWorld(v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<void>& info) |
2616 { | 2616 { |
2617 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
Attr2", "TestObject", info.Holder(), info.GetIsolate()); | 2617 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
Attr2", "TestObject", info.Holder(), info.GetIsolate()); |
2618 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2618 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2619 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2619 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2620 imp->setActivityLoggedAttr2(cppValue); | 2620 imp->setActivityLoggedAttr2(cppValue); |
2621 } | 2621 } |
2622 | 2622 |
2623 static void activityLoggedAttr2AttributeSetterCallbackForMainWorld(v8::Local<v8:
:String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in
fo) | 2623 static void activityLoggedAttr2AttributeSetterCallbackForMainWorld(v8::Local<v8:
:String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in
fo) |
2624 { | 2624 { |
2625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2626 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2626 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2627 if (contextData && contextData->activityLogger()) { | 2627 if (contextData && contextData->activityLogger()) { |
2628 v8::Handle<v8::Value> loggerArg[] = { jsValue }; | 2628 v8::Handle<v8::Value> loggerArg[] = { jsValue }; |
2629 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1,
&loggerArg[0], "Setter"); | 2629 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1,
&loggerArg[0], "Setter"); |
2630 } | 2630 } |
2631 TestObjV8Internal::activityLoggedAttr2AttributeSetterForMainWorld(jsValue, i
nfo); | 2631 TestObjV8Internal::activityLoggedAttr2AttributeSetterForMainWorld(jsValue, i
nfo); |
2632 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2632 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2633 } | 2633 } |
2634 | 2634 |
2635 static void activityLoggedInIsolatedWorldsAttrAttributeGetter(const v8::Property
CallbackInfo<v8::Value>& info) | 2635 static void activityLoggedInIsolatedWorldsAttrAttributeGetter(const v8::Property
CallbackInfo<v8::Value>& info) |
2636 { | 2636 { |
2637 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2637 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2638 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttr()); | 2638 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttr()); |
2639 } | 2639 } |
2640 | 2640 |
2641 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallback(v8::Local<
v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2641 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallback(v8::Local<
v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2642 { | 2642 { |
2643 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2643 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2644 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2644 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2645 if (contextData && contextData->activityLogger()) | 2645 if (contextData && contextData->activityLogger()) |
2646 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttr", 0, 0, "Getter"); | 2646 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttr", 0, 0, "Getter"); |
2647 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetter(info); | 2647 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetter(info); |
2648 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2648 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2649 } | 2649 } |
2650 | 2650 |
2651 static void activityLoggedInIsolatedWorldsAttrAttributeSetter(v8::Local<v8::Valu
e> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2651 static void activityLoggedInIsolatedWorldsAttrAttributeSetter(v8::Local<v8::Valu
e> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2652 { | 2652 { |
2653 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttr", "TestObject", info.Holder(), info.GetIsolate()); | 2653 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttr", "TestObject", info.Holder(), info.GetIsolate()); |
2654 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2654 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2655 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2655 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2656 imp->setActivityLoggedInIsolatedWorldsAttr(cppValue); | 2656 imp->setActivityLoggedInIsolatedWorldsAttr(cppValue); |
2657 } | 2657 } |
2658 | 2658 |
2659 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallback(v8::Local<
v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>&
info) | 2659 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallback(v8::Local<
v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>&
info) |
2660 { | 2660 { |
2661 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2661 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2662 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2662 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2663 if (contextData && contextData->activityLogger()) { | 2663 if (contextData && contextData->activityLogger()) { |
2664 v8::Handle<v8::Value> loggerArg[] = { jsValue }; | 2664 v8::Handle<v8::Value> loggerArg[] = { jsValue }; |
2665 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttr", 1, &loggerArg[0], "Setter"); | 2665 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttr", 1, &loggerArg[0], "Setter"); |
2666 } | 2666 } |
2667 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetter(jsValue
, info); | 2667 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetter(jsValue
, info); |
2668 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2668 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2669 } | 2669 } |
2670 | 2670 |
2671 static void activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(const
v8::PropertyCallbackInfo<v8::Value>& info) | 2671 static void activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(const
v8::PropertyCallbackInfo<v8::Value>& info) |
2672 { | 2672 { |
2673 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2673 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2674 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttr()); | 2674 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttr()); |
2675 } | 2675 } |
2676 | 2676 |
2677 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorl
d(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2677 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorl
d(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2678 { | 2678 { |
2679 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2679 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2680 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterForMainW
orld(info); | 2680 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterForMainW
orld(info); |
2681 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2681 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2682 } | 2682 } |
2683 | 2683 |
2684 static void activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8::Lo
cal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2684 static void activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8::Lo
cal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2685 { | 2685 { |
2686 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttr", "TestObject", info.Holder(), info.GetIsolate()); | 2686 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttr", "TestObject", info.Holder(), info.GetIsolate()); |
2687 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2687 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2688 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2688 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2689 imp->setActivityLoggedInIsolatedWorldsAttr(cppValue); | 2689 imp->setActivityLoggedInIsolatedWorldsAttr(cppValue); |
2690 } | 2690 } |
2691 | 2691 |
2692 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorl
d(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbac
kInfo<void>& info) | 2692 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorl
d(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbac
kInfo<void>& info) |
2693 { | 2693 { |
2694 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2694 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2695 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterForMainW
orld(jsValue, info); | 2695 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterForMainW
orld(jsValue, info); |
2696 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2696 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2697 } | 2697 } |
2698 | 2698 |
2699 static void activityLoggedAttrSetter1AttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 2699 static void activityLoggedAttrSetter1AttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
2700 { | 2700 { |
2701 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2701 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2702 v8SetReturnValueInt(info, imp->activityLoggedAttrSetter1()); | 2702 v8SetReturnValueInt(info, imp->activityLoggedAttrSetter1()); |
2703 } | 2703 } |
2704 | 2704 |
2705 static void activityLoggedAttrSetter1AttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2705 static void activityLoggedAttrSetter1AttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2706 { | 2706 { |
2707 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2707 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2708 TestObjV8Internal::activityLoggedAttrSetter1AttributeGetter(info); | 2708 TestObjV8Internal::activityLoggedAttrSetter1AttributeGetter(info); |
2709 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2709 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2710 } | 2710 } |
2711 | 2711 |
2712 static void activityLoggedAttrSetter1AttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) | 2712 static void activityLoggedAttrSetter1AttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) |
2713 { | 2713 { |
2714 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrSetter1", "TestObject", info.Holder(), info.GetIsolate()); | 2714 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrSetter1", "TestObject", info.Holder(), info.GetIsolate()); |
2715 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2715 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2716 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2716 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2717 imp->setActivityLoggedAttrSetter1(cppValue); | 2717 imp->setActivityLoggedAttrSetter1(cppValue); |
2718 } | 2718 } |
2719 | 2719 |
2720 static void activityLoggedAttrSetter1AttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2720 static void activityLoggedAttrSetter1AttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2721 { | 2721 { |
2722 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2722 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2723 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2723 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2724 if (contextData && contextData->activityLogger()) { | 2724 if (contextData && contextData->activityLogger()) { |
2725 v8::Handle<v8::Value> loggerArg[] = { jsValue }; | 2725 v8::Handle<v8::Value> loggerArg[] = { jsValue }; |
2726 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter1
", 1, &loggerArg[0], "Setter"); | 2726 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter1
", 1, &loggerArg[0], "Setter"); |
2727 } | 2727 } |
2728 TestObjV8Internal::activityLoggedAttrSetter1AttributeSetter(jsValue, info); | 2728 TestObjV8Internal::activityLoggedAttrSetter1AttributeSetter(jsValue, info); |
2729 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2729 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2730 } | 2730 } |
2731 | 2731 |
2732 static void activityLoggedAttrSetter2AttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 2732 static void activityLoggedAttrSetter2AttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
2733 { | 2733 { |
2734 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2734 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2735 v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2()); | 2735 v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2()); |
2736 } | 2736 } |
2737 | 2737 |
2738 static void activityLoggedAttrSetter2AttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2738 static void activityLoggedAttrSetter2AttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2739 { | 2739 { |
2740 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2740 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2741 TestObjV8Internal::activityLoggedAttrSetter2AttributeGetter(info); | 2741 TestObjV8Internal::activityLoggedAttrSetter2AttributeGetter(info); |
2742 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2742 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2743 } | 2743 } |
2744 | 2744 |
2745 static void activityLoggedAttrSetter2AttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) | 2745 static void activityLoggedAttrSetter2AttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) |
2746 { | 2746 { |
2747 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrSetter2", "TestObject", info.Holder(), info.GetIsolate()); | 2747 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrSetter2", "TestObject", info.Holder(), info.GetIsolate()); |
2748 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2748 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2749 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2749 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2750 imp->setActivityLoggedAttrSetter2(cppValue); | 2750 imp->setActivityLoggedAttrSetter2(cppValue); |
2751 } | 2751 } |
2752 | 2752 |
2753 static void activityLoggedAttrSetter2AttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2753 static void activityLoggedAttrSetter2AttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2754 { | 2754 { |
2755 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2755 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2756 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2756 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2757 if (contextData && contextData->activityLogger()) { | 2757 if (contextData && contextData->activityLogger()) { |
2758 v8::Handle<v8::Value> loggerArg[] = { jsValue }; | 2758 v8::Handle<v8::Value> loggerArg[] = { jsValue }; |
2759 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2
", 1, &loggerArg[0], "Setter"); | 2759 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2
", 1, &loggerArg[0], "Setter"); |
2760 } | 2760 } |
2761 TestObjV8Internal::activityLoggedAttrSetter2AttributeSetter(jsValue, info); | 2761 TestObjV8Internal::activityLoggedAttrSetter2AttributeSetter(jsValue, info); |
2762 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2762 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2763 } | 2763 } |
2764 | 2764 |
2765 static void activityLoggedAttrSetter2AttributeGetterForMainWorld(const v8::Prope
rtyCallbackInfo<v8::Value>& info) | 2765 static void activityLoggedAttrSetter2AttributeGetterForMainWorld(const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
2766 { | 2766 { |
2767 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2767 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2768 v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2()); | 2768 v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2()); |
2769 } | 2769 } |
2770 | 2770 |
2771 static void activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2771 static void activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2772 { | 2772 { |
2773 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2773 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2774 TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterForMainWorld(info
); | 2774 TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterForMainWorld(info
); |
2775 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2775 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2776 } | 2776 } |
2777 | 2777 |
2778 static void activityLoggedAttrSetter2AttributeSetterForMainWorld(v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2778 static void activityLoggedAttrSetter2AttributeSetterForMainWorld(v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2779 { | 2779 { |
2780 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrSetter2", "TestObject", info.Holder(), info.GetIsolate()); | 2780 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrSetter2", "TestObject", info.Holder(), info.GetIsolate()); |
2781 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2781 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2782 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2782 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2783 imp->setActivityLoggedAttrSetter2(cppValue); | 2783 imp->setActivityLoggedAttrSetter2(cppValue); |
2784 } | 2784 } |
2785 | 2785 |
2786 static void activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld(v8::Loc
al<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<voi
d>& info) | 2786 static void activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld(v8::Loc
al<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<voi
d>& info) |
2787 { | 2787 { |
2788 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2788 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2789 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2789 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2790 if (contextData && contextData->activityLogger()) { | 2790 if (contextData && contextData->activityLogger()) { |
2791 v8::Handle<v8::Value> loggerArg[] = { jsValue }; | 2791 v8::Handle<v8::Value> loggerArg[] = { jsValue }; |
2792 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2
", 1, &loggerArg[0], "Setter"); | 2792 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2
", 1, &loggerArg[0], "Setter"); |
2793 } | 2793 } |
2794 TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterForMainWorld(jsVa
lue, info); | 2794 TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterForMainWorld(jsVa
lue, info); |
2795 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2795 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2796 } | 2796 } |
2797 | 2797 |
2798 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 2798 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
2799 { | 2799 { |
2800 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2800 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2801 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter()); | 2801 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter()); |
2802 } | 2802 } |
2803 | 2803 |
2804 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback(v8::
Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2804 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback(v8::
Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2805 { | 2805 { |
2806 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2806 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2807 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(i
nfo); | 2807 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(i
nfo); |
2808 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2808 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2809 } | 2809 } |
2810 | 2810 |
2811 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2811 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2812 { | 2812 { |
2813 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttrSetter", "TestObject", info.Holder(), info.GetIsolate()); | 2813 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttrSetter", "TestObject", info.Holder(), info.GetIsolate()); |
2814 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2814 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2815 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2815 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2816 imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue); | 2816 imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue); |
2817 } | 2817 } |
2818 | 2818 |
2819 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback(v8::
Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<
void>& info) | 2819 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback(v8::
Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<
void>& info) |
2820 { | 2820 { |
2821 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2821 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2822 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2822 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2823 if (contextData && contextData->activityLogger()) { | 2823 if (contextData && contextData->activityLogger()) { |
2824 v8::Handle<v8::Value> loggerArg[] = { jsValue }; | 2824 v8::Handle<v8::Value> loggerArg[] = { jsValue }; |
2825 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttrSetter", 1, &loggerArg[0], "Setter"); | 2825 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttrSetter", 1, &loggerArg[0], "Setter"); |
2826 } | 2826 } |
2827 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(j
sValue, info); | 2827 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(j
sValue, info); |
2828 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2828 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2829 } | 2829 } |
2830 | 2830 |
2831 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(
const v8::PropertyCallbackInfo<v8::Value>& info) | 2831 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(
const v8::PropertyCallbackInfo<v8::Value>& info) |
2832 { | 2832 { |
2833 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2833 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2834 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter()); | 2834 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter()); |
2835 } | 2835 } |
2836 | 2836 |
2837 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMa
inWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2837 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMa
inWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2838 { | 2838 { |
2839 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2839 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2840 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterFo
rMainWorld(info); | 2840 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterFo
rMainWorld(info); |
2841 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2841 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2842 } | 2842 } |
2843 | 2843 |
2844 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2844 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2845 { | 2845 { |
2846 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttrSetter", "TestObject", info.Holder(), info.GetIsolate()); | 2846 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttrSetter", "TestObject", info.Holder(), info.GetIsolate()); |
2847 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2847 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2848 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2848 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2849 imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue); | 2849 imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue); |
2850 } | 2850 } |
2851 | 2851 |
2852 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMa
inWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyC
allbackInfo<void>& info) | 2852 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMa
inWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyC
allbackInfo<void>& info) |
2853 { | 2853 { |
2854 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2854 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2855 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterFo
rMainWorld(jsValue, info); | 2855 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterFo
rMainWorld(jsValue, info); |
2856 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2856 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2857 } | 2857 } |
2858 | 2858 |
2859 static void activityLoggedAttrGetter1AttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 2859 static void activityLoggedAttrGetter1AttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
2860 { | 2860 { |
2861 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2861 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2862 v8SetReturnValueInt(info, imp->activityLoggedAttrGetter1()); | 2862 v8SetReturnValueInt(info, imp->activityLoggedAttrGetter1()); |
2863 } | 2863 } |
2864 | 2864 |
2865 static void activityLoggedAttrGetter1AttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2865 static void activityLoggedAttrGetter1AttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2866 { | 2866 { |
2867 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2867 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2868 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2868 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2869 if (contextData && contextData->activityLogger()) | 2869 if (contextData && contextData->activityLogger()) |
2870 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter1
", 0, 0, "Getter"); | 2870 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter1
", 0, 0, "Getter"); |
2871 TestObjV8Internal::activityLoggedAttrGetter1AttributeGetter(info); | 2871 TestObjV8Internal::activityLoggedAttrGetter1AttributeGetter(info); |
2872 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2872 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2873 } | 2873 } |
2874 | 2874 |
2875 static void activityLoggedAttrGetter1AttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) | 2875 static void activityLoggedAttrGetter1AttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) |
2876 { | 2876 { |
2877 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrGetter1", "TestObject", info.Holder(), info.GetIsolate()); | 2877 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrGetter1", "TestObject", info.Holder(), info.GetIsolate()); |
2878 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2878 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2879 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2879 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2880 imp->setActivityLoggedAttrGetter1(cppValue); | 2880 imp->setActivityLoggedAttrGetter1(cppValue); |
2881 } | 2881 } |
2882 | 2882 |
2883 static void activityLoggedAttrGetter1AttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2883 static void activityLoggedAttrGetter1AttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2884 { | 2884 { |
2885 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2885 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2886 TestObjV8Internal::activityLoggedAttrGetter1AttributeSetter(jsValue, info); | 2886 TestObjV8Internal::activityLoggedAttrGetter1AttributeSetter(jsValue, info); |
2887 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2887 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2888 } | 2888 } |
2889 | 2889 |
2890 static void activityLoggedAttrGetter2AttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 2890 static void activityLoggedAttrGetter2AttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
2891 { | 2891 { |
2892 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2892 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2893 v8SetReturnValueInt(info, imp->activityLoggedAttrGetter2()); | 2893 v8SetReturnValueInt(info, imp->activityLoggedAttrGetter2()); |
2894 } | 2894 } |
2895 | 2895 |
2896 static void activityLoggedAttrGetter2AttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2896 static void activityLoggedAttrGetter2AttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2897 { | 2897 { |
2898 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2898 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2899 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2899 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2900 if (contextData && contextData->activityLogger()) | 2900 if (contextData && contextData->activityLogger()) |
2901 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2
", 0, 0, "Getter"); | 2901 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2
", 0, 0, "Getter"); |
2902 TestObjV8Internal::activityLoggedAttrGetter2AttributeGetter(info); | 2902 TestObjV8Internal::activityLoggedAttrGetter2AttributeGetter(info); |
2903 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2903 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2904 } | 2904 } |
2905 | 2905 |
2906 static void activityLoggedAttrGetter2AttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) | 2906 static void activityLoggedAttrGetter2AttributeSetter(v8::Local<v8::Value> jsValu
e, const v8::PropertyCallbackInfo<void>& info) |
2907 { | 2907 { |
2908 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrGetter2", "TestObject", info.Holder(), info.GetIsolate()); | 2908 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrGetter2", "TestObject", info.Holder(), info.GetIsolate()); |
2909 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2909 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2910 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2910 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2911 imp->setActivityLoggedAttrGetter2(cppValue); | 2911 imp->setActivityLoggedAttrGetter2(cppValue); |
2912 } | 2912 } |
2913 | 2913 |
2914 static void activityLoggedAttrGetter2AttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2914 static void activityLoggedAttrGetter2AttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2915 { | 2915 { |
2916 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2916 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2917 TestObjV8Internal::activityLoggedAttrGetter2AttributeSetter(jsValue, info); | 2917 TestObjV8Internal::activityLoggedAttrGetter2AttributeSetter(jsValue, info); |
2918 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2918 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2919 } | 2919 } |
2920 | 2920 |
2921 static void activityLoggedAttrGetter2AttributeGetterForMainWorld(const v8::Prope
rtyCallbackInfo<v8::Value>& info) | 2921 static void activityLoggedAttrGetter2AttributeGetterForMainWorld(const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
2922 { | 2922 { |
2923 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2923 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2924 v8SetReturnValueInt(info, imp->activityLoggedAttrGetter2()); | 2924 v8SetReturnValueInt(info, imp->activityLoggedAttrGetter2()); |
2925 } | 2925 } |
2926 | 2926 |
2927 static void activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2927 static void activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2928 { | 2928 { |
2929 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2929 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2930 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2930 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2931 if (contextData && contextData->activityLogger()) | 2931 if (contextData && contextData->activityLogger()) |
2932 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2
", 0, 0, "Getter"); | 2932 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2
", 0, 0, "Getter"); |
2933 TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterForMainWorld(info
); | 2933 TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterForMainWorld(info
); |
2934 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2934 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2935 } | 2935 } |
2936 | 2936 |
2937 static void activityLoggedAttrGetter2AttributeSetterForMainWorld(v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2937 static void activityLoggedAttrGetter2AttributeSetterForMainWorld(v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2938 { | 2938 { |
2939 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrGetter2", "TestObject", info.Holder(), info.GetIsolate()); | 2939 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
AttrGetter2", "TestObject", info.Holder(), info.GetIsolate()); |
2940 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2940 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2941 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2941 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2942 imp->setActivityLoggedAttrGetter2(cppValue); | 2942 imp->setActivityLoggedAttrGetter2(cppValue); |
2943 } | 2943 } |
2944 | 2944 |
2945 static void activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld(v8::Loc
al<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<voi
d>& info) | 2945 static void activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld(v8::Loc
al<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<voi
d>& info) |
2946 { | 2946 { |
2947 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2947 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2948 TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterForMainWorld(jsVa
lue, info); | 2948 TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterForMainWorld(jsVa
lue, info); |
2949 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2949 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2950 } | 2950 } |
2951 | 2951 |
2952 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 2952 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
2953 { | 2953 { |
2954 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2954 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2955 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrGetter()); | 2955 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrGetter()); |
2956 } | 2956 } |
2957 | 2957 |
2958 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback(v8::
Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2958 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback(v8::
Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2959 { | 2959 { |
2960 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2960 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2961 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 2961 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
2962 if (contextData && contextData->activityLogger()) | 2962 if (contextData && contextData->activityLogger()) |
2963 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttrGetter", 0, 0, "Getter"); | 2963 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttrGetter", 0, 0, "Getter"); |
2964 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(i
nfo); | 2964 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(i
nfo); |
2965 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2965 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2966 } | 2966 } |
2967 | 2967 |
2968 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2968 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2969 { | 2969 { |
2970 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttrGetter", "TestObject", info.Holder(), info.GetIsolate()); | 2970 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttrGetter", "TestObject", info.Holder(), info.GetIsolate()); |
2971 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2971 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2972 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 2972 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
2973 imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue); | 2973 imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue); |
2974 } | 2974 } |
2975 | 2975 |
2976 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback(v8::
Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<
void>& info) | 2976 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback(v8::
Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<
void>& info) |
2977 { | 2977 { |
2978 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2978 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2979 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(j
sValue, info); | 2979 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(j
sValue, info); |
2980 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2980 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2981 } | 2981 } |
2982 | 2982 |
2983 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(
const v8::PropertyCallbackInfo<v8::Value>& info) | 2983 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(
const v8::PropertyCallbackInfo<v8::Value>& info) |
2984 { | 2984 { |
2985 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2985 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2986 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrGetter()); | 2986 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrGetter()); |
2987 } | 2987 } |
2988 | 2988 |
2989 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMa
inWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2989 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMa
inWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2990 { | 2990 { |
2991 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2991 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2992 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterFo
rMainWorld(info); | 2992 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterFo
rMainWorld(info); |
2993 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2993 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2994 } | 2994 } |
2995 | 2995 |
2996 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2996 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2997 { | 2997 { |
2998 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttrGetter", "TestObject", info.Holder(), info.GetIsolate()); | 2998 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLogged
InIsolatedWorldsAttrGetter", "TestObject", info.Holder(), info.GetIsolate()); |
2999 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2999 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3000 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 3000 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
3001 imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue); | 3001 imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue); |
3002 } | 3002 } |
3003 | 3003 |
3004 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMa
inWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyC
allbackInfo<void>& info) | 3004 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMa
inWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyC
allbackInfo<void>& info) |
3005 { | 3005 { |
3006 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 3006 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
3007 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterFo
rMainWorld(jsValue, info); | 3007 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterFo
rMainWorld(jsValue, info); |
3008 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3008 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3009 } | 3009 } |
3010 | 3010 |
3011 static void deprecatedStaticReadOnlyAttrAttributeGetter(const v8::PropertyCallba
ckInfo<v8::Value>& info) | 3011 static void deprecatedStaticReadOnlyAttrAttributeGetter(const v8::PropertyCallba
ckInfo<v8::Value>& info) |
3012 { | 3012 { |
3013 v8SetReturnValueInt(info, TestObj::deprecatedStaticReadOnlyAttr()); | 3013 v8SetReturnValueInt(info, TestObj::deprecatedStaticReadOnlyAttr()); |
3014 } | 3014 } |
3015 | 3015 |
3016 static void deprecatedStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::St
ring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 3016 static void deprecatedStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::St
ring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
3017 { | 3017 { |
3018 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 3018 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
3019 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticRea
donlyAttribute); | 3019 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticRea
donlyAttribute); |
3020 TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetter(info); | 3020 TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetter(info); |
3021 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3021 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3022 } | 3022 } |
3023 | 3023 |
3024 static void deprecatedStaticAttrAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) | 3024 static void deprecatedStaticAttrAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) |
3025 { | 3025 { |
3026 v8SetReturnValueInt(info, TestObj::deprecatedStaticAttr()); | 3026 v8SetReturnValueInt(info, TestObj::deprecatedStaticAttr()); |
3027 } | 3027 } |
3028 | 3028 |
3029 static void deprecatedStaticAttrAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 3029 static void deprecatedStaticAttrAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
3030 { | 3030 { |
3031 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 3031 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
3032 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAtt
ribute); | 3032 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAtt
ribute); |
3033 TestObjV8Internal::deprecatedStaticAttrAttributeGetter(info); | 3033 TestObjV8Internal::deprecatedStaticAttrAttributeGetter(info); |
3034 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3034 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3035 } | 3035 } |
3036 | 3036 |
3037 static void deprecatedStaticAttrAttributeSetter(v8::Local<v8::Value> jsValue, co
nst v8::PropertyCallbackInfo<void>& info) | 3037 static void deprecatedStaticAttrAttributeSetter(v8::Local<v8::Value> jsValue, co
nst v8::PropertyCallbackInfo<void>& info) |
3038 { | 3038 { |
3039 ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedStat
icAttr", "TestObject", info.Holder(), info.GetIsolate()); | 3039 ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedStat
icAttr", "TestObject", info.Holder(), info.GetIsolate()); |
3040 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 3040 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
3041 TestObj::setDeprecatedStaticAttr(cppValue); | 3041 TestObj::setDeprecatedStaticAttr(cppValue); |
3042 } | 3042 } |
3043 | 3043 |
3044 static void deprecatedStaticAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 3044 static void deprecatedStaticAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
3045 { | 3045 { |
3046 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 3046 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
3047 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAtt
ribute); | 3047 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAtt
ribute); |
3048 TestObjV8Internal::deprecatedStaticAttrAttributeSetter(jsValue, info); | 3048 TestObjV8Internal::deprecatedStaticAttrAttributeSetter(jsValue, info); |
3049 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3049 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3050 } | 3050 } |
3051 | 3051 |
3052 static void deprecatedReadonlyAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | 3052 static void deprecatedReadonlyAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) |
3053 { | 3053 { |
3054 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3054 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3055 v8SetReturnValueInt(info, imp->deprecatedReadonlyAttr()); | 3055 v8SetReturnValueInt(info, imp->deprecatedReadonlyAttr()); |
3056 } | 3056 } |
3057 | 3057 |
3058 static void deprecatedReadonlyAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 3058 static void deprecatedReadonlyAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
3059 { | 3059 { |
3060 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 3060 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
3061 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::ReadonlyA
ttribute); | 3061 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::ReadonlyA
ttribute); |
3062 TestObjV8Internal::deprecatedReadonlyAttrAttributeGetter(info); | 3062 TestObjV8Internal::deprecatedReadonlyAttrAttributeGetter(info); |
3063 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3063 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3064 } | 3064 } |
3065 | 3065 |
3066 static void deprecatedAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 3066 static void deprecatedAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) |
3067 { | 3067 { |
3068 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3068 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3069 v8SetReturnValueInt(info, imp->deprecatedAttr()); | 3069 v8SetReturnValueInt(info, imp->deprecatedAttr()); |
3070 } | 3070 } |
3071 | 3071 |
3072 static void deprecatedAttrAttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 3072 static void deprecatedAttrAttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) |
3073 { | 3073 { |
3074 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 3074 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
3075 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute
); | 3075 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute
); |
3076 TestObjV8Internal::deprecatedAttrAttributeGetter(info); | 3076 TestObjV8Internal::deprecatedAttrAttributeGetter(info); |
3077 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3077 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3078 } | 3078 } |
3079 | 3079 |
3080 static void deprecatedAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) | 3080 static void deprecatedAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) |
3081 { | 3081 { |
3082 ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedAttr
", "TestObject", info.Holder(), info.GetIsolate()); | 3082 ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedAttr
", "TestObject", info.Holder(), info.GetIsolate()); |
3083 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3083 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3084 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); | 3084 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e
xceptionState); |
3085 imp->setDeprecatedAttr(cppValue); | 3085 imp->setDeprecatedAttr(cppValue); |
3086 } | 3086 } |
3087 | 3087 |
3088 static void deprecatedAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 3088 static void deprecatedAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
3089 { | 3089 { |
3090 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 3090 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
3091 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute
); | 3091 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute
); |
3092 TestObjV8Internal::deprecatedAttrAttributeSetter(jsValue, info); | 3092 TestObjV8Internal::deprecatedAttrAttributeSetter(jsValue, info); |
3093 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3093 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3094 } | 3094 } |
3095 | 3095 |
3096 static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& i
nfo) | 3096 static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& i
nfo) |
3097 { | 3097 { |
3098 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3098 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3099 v8SetReturnValueFast(info, imp->location(), imp); | 3099 v8SetReturnValueFast(info, imp->location(), imp); |
3100 } | 3100 } |
3101 | 3101 |
3102 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 3102 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
3103 { | 3103 { |
3104 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 3104 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
3105 TestObjV8Internal::locationAttributeGetter(info); | 3105 TestObjV8Internal::locationAttributeGetter(info); |
3106 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3106 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3107 } | 3107 } |
3108 | 3108 |
3109 static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) | 3109 static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) |
3110 { | 3110 { |
3111 TestObj* proxyImp = V8TestObject::toNative(info.Holder()); | 3111 TestObj* proxyImp = V8TestObject::toNative(info.Holder()); |
3112 TestNode* imp = proxyImp->location(); | 3112 TestNode* imp = proxyImp->location(); |
3113 if (!imp) | 3113 if (!imp) |
3114 return; | 3114 return; |
3115 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 3115 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
3116 imp->setHref(cppValue); | 3116 imp->setHref(cppValue); |
3117 } | 3117 } |
3118 | 3118 |
3119 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 3119 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
3120 { | 3120 { |
3121 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 3121 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
3122 TestObjV8Internal::locationAttributeSetter(jsValue, info); | 3122 TestObjV8Internal::locationAttributeSetter(jsValue, info); |
3123 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3123 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3124 } | 3124 } |
3125 | 3125 |
3126 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | 3126 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) |
3127 { | 3127 { |
3128 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3128 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3129 v8SetReturnValueFast(info, imp->locationWithException(), imp); | 3129 v8SetReturnValueFast(info, imp->locationWithException(), imp); |
3130 } | 3130 } |
3131 | 3131 |
3132 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 3132 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
3133 { | 3133 { |
3134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 3134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
3135 TestObjV8Internal::locationWithExceptionAttributeGetter(info); | 3135 TestObjV8Internal::locationWithExceptionAttributeGetter(info); |
3136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3137 } | 3137 } |
3138 | 3138 |
3139 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) | 3139 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) |
3140 { | 3140 { |
3141 TestObj* proxyImp = V8TestObject::toNative(info.Holder()); | 3141 TestObj* proxyImp = V8TestObject::toNative(info.Holder()); |
3142 TestNode* imp = proxyImp->locationWithException(); | 3142 TestNode* imp = proxyImp->locationWithException(); |
3143 if (!imp) | 3143 if (!imp) |
3144 return; | 3144 return; |
3145 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 3145 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
3146 imp->setHrefThrows(cppValue); | 3146 imp->setHrefThrows(cppValue); |
3147 } | 3147 } |
3148 | 3148 |
3149 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 3149 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
3150 { | 3150 { |
3151 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 3151 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
3152 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info); | 3152 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info); |
3153 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3153 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3154 } | 3154 } |
3155 | 3155 |
3156 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 3156 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
3157 { | 3157 { |
3158 v8::Handle<v8::Value> data = info.Data(); | 3158 v8::Handle<v8::Value> data = info.Data(); |
3159 ASSERT(data->IsExternal()); | 3159 ASSERT(data->IsExternal()); |
3160 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | 3160 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); |
3161 if (!perContextData) | 3161 if (!perContextData) |
3162 return; | 3162 return; |
3163 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); | 3163 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); |
(...skipping 12 matching lines...) Expand all Loading... |
3176 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 3176 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
3177 { | 3177 { |
3178 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3178 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3179 imp->voidMethod(); | 3179 imp->voidMethod(); |
3180 } | 3180 } |
3181 | 3181 |
3182 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3182 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3183 { | 3183 { |
3184 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3184 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3185 TestObjV8Internal::voidMethodMethod(info); | 3185 TestObjV8Internal::voidMethodMethod(info); |
3186 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3186 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3187 } | 3187 } |
3188 | 3188 |
3189 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3189 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3190 { | 3190 { |
3191 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); | 3191 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); |
3192 if (UNLIKELY(info.Length() < 3)) { | 3192 if (UNLIKELY(info.Length() < 3)) { |
3193 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 3193 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
3194 exceptionState.throwIfNeeded(); | 3194 exceptionState.throwIfNeeded(); |
3195 return; | 3195 return; |
3196 } | 3196 } |
3197 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3197 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3198 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 3198 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
3199 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 3199 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
3200 if (info.Length() <= 2 || !info[2]->IsFunction()) { | 3200 if (info.Length() <= 2 || !info[2]->IsFunction()) { |
3201 exceptionState.throwTypeError("The callback provided as parameter 3 is n
ot a function."); | 3201 exceptionState.throwTypeError("The callback provided as parameter 3 is n
ot a function."); |
3202 exceptionState.throwIfNeeded(); | 3202 exceptionState.throwIfNeeded(); |
3203 return; | 3203 return; |
3204 } | 3204 } |
3205 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[2]), getExecutionContext()); | 3205 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[2]), getExecutionContext()); |
3206 imp->voidMethodWithArgs(longArg, strArg, objArg.release()); | 3206 imp->voidMethodWithArgs(longArg, strArg, objArg.release()); |
3207 } | 3207 } |
3208 | 3208 |
3209 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3209 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
3210 { | 3210 { |
3211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3212 TestObjV8Internal::voidMethodWithArgsMethod(info); | 3212 TestObjV8Internal::voidMethodWithArgsMethod(info); |
3213 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3213 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3214 } | 3214 } |
3215 | 3215 |
3216 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 3216 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
3217 { | 3217 { |
3218 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3218 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3219 v8SetReturnValueInt(info, imp->longMethod()); | 3219 v8SetReturnValueInt(info, imp->longMethod()); |
3220 } | 3220 } |
3221 | 3221 |
3222 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3222 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3223 { | 3223 { |
3224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3225 TestObjV8Internal::longMethodMethod(info); | 3225 TestObjV8Internal::longMethodMethod(info); |
3226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3227 } | 3227 } |
3228 | 3228 |
3229 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3229 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3230 { | 3230 { |
3231 ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); | 3231 ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); |
3232 if (UNLIKELY(info.Length() < 3)) { | 3232 if (UNLIKELY(info.Length() < 3)) { |
3233 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 3233 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
3234 exceptionState.throwIfNeeded(); | 3234 exceptionState.throwIfNeeded(); |
3235 return; | 3235 return; |
3236 } | 3236 } |
3237 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3237 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3238 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 3238 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
3239 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 3239 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
3240 if (info.Length() <= 2 || !info[2]->IsFunction()) { | 3240 if (info.Length() <= 2 || !info[2]->IsFunction()) { |
3241 exceptionState.throwTypeError("The callback provided as parameter 3 is n
ot a function."); | 3241 exceptionState.throwTypeError("The callback provided as parameter 3 is n
ot a function."); |
3242 exceptionState.throwIfNeeded(); | 3242 exceptionState.throwIfNeeded(); |
3243 return; | 3243 return; |
3244 } | 3244 } |
3245 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[2]), getExecutionContext()); | 3245 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[2]), getExecutionContext()); |
3246 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg.re
lease())); | 3246 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg.re
lease())); |
3247 } | 3247 } |
3248 | 3248 |
3249 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3249 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
3250 { | 3250 { |
3251 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3251 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3252 TestObjV8Internal::longMethodWithArgsMethod(info); | 3252 TestObjV8Internal::longMethodWithArgsMethod(info); |
3253 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3253 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3254 } | 3254 } |
3255 | 3255 |
3256 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 3256 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
3257 { | 3257 { |
3258 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3258 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3259 v8SetReturnValue(info, imp->objMethod()); | 3259 v8SetReturnValue(info, imp->objMethod()); |
3260 } | 3260 } |
3261 | 3261 |
3262 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3262 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3263 { | 3263 { |
3264 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3264 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3265 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); | 3265 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); |
3266 TestObjV8Internal::objMethodMethod(info); | 3266 TestObjV8Internal::objMethodMethod(info); |
3267 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3267 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3268 } | 3268 } |
3269 | 3269 |
3270 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3270 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3271 { | 3271 { |
3272 ExceptionState exceptionState(ExceptionState::ExecutionContext, "objMethodWi
thArgs", "TestObject", info.Holder(), info.GetIsolate()); | 3272 ExceptionState exceptionState(ExceptionState::ExecutionContext, "objMethodWi
thArgs", "TestObject", info.Holder(), info.GetIsolate()); |
3273 if (UNLIKELY(info.Length() < 3)) { | 3273 if (UNLIKELY(info.Length() < 3)) { |
3274 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 3274 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
3275 exceptionState.throwIfNeeded(); | 3275 exceptionState.throwIfNeeded(); |
3276 return; | 3276 return; |
3277 } | 3277 } |
3278 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3278 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3279 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 3279 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
3280 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 3280 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
3281 if (info.Length() <= 2 || !info[2]->IsFunction()) { | 3281 if (info.Length() <= 2 || !info[2]->IsFunction()) { |
3282 exceptionState.throwTypeError("The callback provided as parameter 3 is n
ot a function."); | 3282 exceptionState.throwTypeError("The callback provided as parameter 3 is n
ot a function."); |
3283 exceptionState.throwIfNeeded(); | 3283 exceptionState.throwIfNeeded(); |
3284 return; | 3284 return; |
3285 } | 3285 } |
3286 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[2]), getExecutionContext()); | 3286 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[2]), getExecutionContext()); |
3287 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg.releas
e())); | 3287 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg.releas
e())); |
3288 } | 3288 } |
3289 | 3289 |
3290 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3290 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
3291 { | 3291 { |
3292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3293 TestObjV8Internal::objMethodWithArgsMethod(info); | 3293 TestObjV8Internal::objMethodWithArgsMethod(info); |
3294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3295 } | 3295 } |
3296 | 3296 |
3297 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3297 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
3298 { | 3298 { |
3299 if (UNLIKELY(info.Length() < 1)) { | 3299 if (UNLIKELY(info.Length() < 1)) { |
3300 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 3300 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
3301 return; | 3301 return; |
3302 } | 3302 } |
3303 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3303 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3304 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative
Array<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate()))); | 3304 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative
Array<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate()))); |
3305 imp->methodWithSequenceArg(sequenceArg); | 3305 imp->methodWithSequenceArg(sequenceArg); |
3306 } | 3306 } |
3307 | 3307 |
3308 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 3308 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
3309 { | 3309 { |
3310 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3310 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3311 TestObjV8Internal::methodWithSequenceArgMethod(info); | 3311 TestObjV8Internal::methodWithSequenceArgMethod(info); |
3312 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3312 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3313 } | 3313 } |
3314 | 3314 |
3315 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 3315 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
3316 { | 3316 { |
3317 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodRetur
ningSequence", "TestObject", info.Holder(), info.GetIsolate()); | 3317 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodRetur
ningSequence", "TestObject", info.Holder(), info.GetIsolate()); |
3318 if (UNLIKELY(info.Length() < 1)) { | 3318 if (UNLIKELY(info.Length() < 1)) { |
3319 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 3319 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
3320 exceptionState.throwIfNeeded(); | 3320 exceptionState.throwIfNeeded(); |
3321 return; | 3321 return; |
3322 } | 3322 } |
3323 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3323 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3324 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 3324 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
3325 v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.G
etIsolate())); | 3325 v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.G
etIsolate())); |
3326 } | 3326 } |
3327 | 3327 |
3328 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 3328 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
3329 { | 3329 { |
3330 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3330 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3331 TestObjV8Internal::methodReturningSequenceMethod(info); | 3331 TestObjV8Internal::methodReturningSequenceMethod(info); |
3332 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3332 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3333 } | 3333 } |
3334 | 3334 |
3335 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3335 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3336 { | 3336 { |
3337 if (UNLIKELY(info.Length() < 1)) { | 3337 if (UNLIKELY(info.Length() < 1)) { |
3338 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 3338 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
3339 return; | 3339 return; |
3340 } | 3340 } |
3341 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3341 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3342 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]); | 3342 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]); |
3343 String string = enumArg; | 3343 String string = enumArg; |
3344 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) { | 3344 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) { |
3345 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.
GetIsolate()); | 3345 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.
GetIsolate()); |
3346 return; | 3346 return; |
3347 } | 3347 } |
3348 imp->methodWithEnumArg(enumArg); | 3348 imp->methodWithEnumArg(enumArg); |
3349 } | 3349 } |
3350 | 3350 |
3351 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3351 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
3352 { | 3352 { |
3353 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3353 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3354 TestObjV8Internal::methodWithEnumArgMethod(info); | 3354 TestObjV8Internal::methodWithEnumArgMethod(info); |
3355 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3355 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3356 } | 3356 } |
3357 | 3357 |
3358 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 3358 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
3359 { | 3359 { |
3360 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR
equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate()); | 3360 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR
equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate()); |
3361 if (UNLIKELY(info.Length() < 2)) { | 3361 if (UNLIKELY(info.Length() < 2)) { |
3362 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 3362 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
3363 exceptionState.throwIfNeeded(); | 3363 exceptionState.throwIfNeeded(); |
3364 return; | 3364 return; |
3365 } | 3365 } |
3366 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3366 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3367 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 3367 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
3368 if (info.Length() <= 1 || !info[1]->IsFunction()) { | 3368 if (info.Length() <= 1 || !info[1]->IsFunction()) { |
3369 exceptionState.throwTypeError("The callback provided as parameter 2 is n
ot a function."); | 3369 exceptionState.throwTypeError("The callback provided as parameter 2 is n
ot a function."); |
3370 exceptionState.throwIfNeeded(); | 3370 exceptionState.throwIfNeeded(); |
3371 return; | 3371 return; |
3372 } | 3372 } |
3373 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[1]), getExecutionContext()); | 3373 OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::C
ast(info[1]), getExecutionContext()); |
3374 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg.release(), exceptionState); | 3374 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg.release(), exceptionState); |
3375 if (exceptionState.throwIfNeeded()) | 3375 if (exceptionState.throwIfNeeded()) |
3376 return; | 3376 return; |
3377 v8SetReturnValue(info, result.release()); | 3377 v8SetReturnValue(info, result.release()); |
3378 } | 3378 } |
3379 | 3379 |
3380 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 3380 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
3381 { | 3381 { |
3382 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3382 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3383 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); | 3383 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); |
3384 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3384 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3385 } | 3385 } |
3386 | 3386 |
3387 static void methodQueryListListenerMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 3387 static void methodQueryListListenerMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
3388 { | 3388 { |
3389 if (UNLIKELY(info.Length() < 1)) { | 3389 if (UNLIKELY(info.Length() < 1)) { |
3390 throwTypeError(ExceptionMessages::failedToExecute("methodQueryListListen
er", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); | 3390 throwTypeError(ExceptionMessages::failedToExecute("methodQueryListListen
er", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
3391 return; | 3391 return; |
3392 } | 3392 } |
3393 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3393 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3394 V8TRYCATCH_VOID(RefPtr<MediaQueryListListener>, listener, MediaQueryListList
ener::create(ScriptValue(info[0], info.GetIsolate()))); | 3394 V8TRYCATCH_VOID(RefPtr<MediaQueryListListener>, listener, MediaQueryListList
ener::create(ScriptValue(info[0], info.GetIsolate()))); |
3395 imp->methodQueryListListener(listener); | 3395 imp->methodQueryListListener(listener); |
3396 } | 3396 } |
3397 | 3397 |
3398 static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 3398 static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
3399 { | 3399 { |
3400 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3400 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3401 TestObjV8Internal::methodQueryListListenerMethod(info); | 3401 TestObjV8Internal::methodQueryListListenerMethod(info); |
3402 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3402 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3403 } | 3403 } |
3404 | 3404 |
3405 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 3405 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
3406 { | 3406 { |
3407 ExceptionState exceptionState(ExceptionState::ExecutionContext, "serializedV
alue", "TestObject", info.Holder(), info.GetIsolate()); | 3407 ExceptionState exceptionState(ExceptionState::ExecutionContext, "serializedV
alue", "TestObject", info.Holder(), info.GetIsolate()); |
3408 if (UNLIKELY(info.Length() < 1)) { | 3408 if (UNLIKELY(info.Length() < 1)) { |
3409 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 3409 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
3410 exceptionState.throwIfNeeded(); | 3410 exceptionState.throwIfNeeded(); |
3411 return; | 3411 return; |
3412 } | 3412 } |
3413 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3413 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3414 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
info[0], 0, 0, exceptionState, info.GetIsolate()); | 3414 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
info[0], 0, 0, exceptionState, info.GetIsolate()); |
3415 if (exceptionState.throwIfNeeded()) | 3415 if (exceptionState.throwIfNeeded()) |
3416 return; | 3416 return; |
3417 imp->serializedValue(serializedArg); | 3417 imp->serializedValue(serializedArg); |
3418 } | 3418 } |
3419 | 3419 |
3420 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 3420 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
3421 { | 3421 { |
3422 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3422 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3423 TestObjV8Internal::serializedValueMethod(info); | 3423 TestObjV8Internal::serializedValueMethod(info); |
3424 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3424 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3425 } | 3425 } |
3426 | 3426 |
3427 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 3427 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
3428 { | 3428 { |
3429 if (UNLIKELY(info.Length() < 1)) { | 3429 if (UNLIKELY(info.Length() < 1)) { |
3430 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsola
te()); | 3430 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsola
te()); |
3431 return; | 3431 return; |
3432 } | 3432 } |
3433 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3433 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3434 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate())); | 3434 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate())); |
3435 if (!oo.isUndefinedOrNull() && !oo.isObject()) { | 3435 if (!oo.isUndefinedOrNull() && !oo.isObject()) { |
3436 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 1 ('oo') is not an object."), info.GetIsolate()); | 3436 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 1 ('oo') is not an object."), info.GetIsolate()); |
3437 return; | 3437 return; |
3438 } | 3438 } |
3439 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate())); | 3439 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate())); |
3440 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { | 3440 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { |
3441 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 2 ('ooo') is not an object."), info.GetIsolate()); | 3441 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 2 ('ooo') is not an object."), info.GetIsolate()); |
3442 return; | 3442 return; |
3443 } | 3443 } |
3444 imp->optionsObject(oo, ooo); | 3444 imp->optionsObject(oo, ooo); |
3445 } | 3445 } |
3446 | 3446 |
3447 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3447 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) |
3448 { | 3448 { |
3449 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3449 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3450 TestObjV8Internal::optionsObjectMethod(info); | 3450 TestObjV8Internal::optionsObjectMethod(info); |
3451 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3451 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3452 } | 3452 } |
3453 | 3453 |
3454 static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3454 static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3455 { | 3455 { |
3456 if (UNLIKELY(info.Length() < 1)) { | 3456 if (UNLIKELY(info.Length() < 1)) { |
3457 throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 3457 throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
3458 return; | 3458 return; |
3459 } | 3459 } |
3460 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3460 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3461 V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0],
1, info.GetIsolate())); | 3461 V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0],
1, info.GetIsolate())); |
3462 imp->optionsObjectList(list); | 3462 imp->optionsObjectList(list); |
3463 } | 3463 } |
3464 | 3464 |
3465 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3465 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
3466 { | 3466 { |
3467 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3467 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3468 TestObjV8Internal::optionsObjectListMethod(info); | 3468 TestObjV8Internal::optionsObjectListMethod(info); |
3469 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3469 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3470 } | 3470 } |
3471 | 3471 |
3472 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3472 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3473 { | 3473 { |
3474 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
xception", "TestObject", info.Holder(), info.GetIsolate()); | 3474 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
xception", "TestObject", info.Holder(), info.GetIsolate()); |
3475 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3475 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3476 imp->methodWithException(exceptionState); | 3476 imp->methodWithException(exceptionState); |
3477 if (exceptionState.throwIfNeeded()) | 3477 if (exceptionState.throwIfNeeded()) |
3478 return; | 3478 return; |
3479 } | 3479 } |
3480 | 3480 |
3481 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3481 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3482 { | 3482 { |
3483 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3483 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3484 TestObjV8Internal::methodWithExceptionMethod(info); | 3484 TestObjV8Internal::methodWithExceptionMethod(info); |
3485 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3485 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3486 } | 3486 } |
3487 | 3487 |
3488 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 3488 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
3489 { | 3489 { |
3490 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3490 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3491 UseCounter::count(activeExecutionContext(), UseCounter::CustomTestFeature); | 3491 UseCounter::count(activeExecutionContext(), UseCounter::CustomTestFeature); |
3492 V8TestObject::customMethodMethodCustom(info); | 3492 V8TestObject::customMethodMethodCustom(info); |
3493 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3493 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3494 } | 3494 } |
3495 | 3495 |
3496 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3496 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3497 { | 3497 { |
3498 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3498 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3499 V8TestObject::customMethodWithArgsMethodCustom(info); | 3499 V8TestObject::customMethodWithArgsMethodCustom(info); |
3500 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3500 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3501 } | 3501 } |
3502 | 3502 |
3503 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 3503 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
3504 { | 3504 { |
3505 ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventLis
tener", "TestObject", info.Holder(), info.GetIsolate()); | 3505 ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventLis
tener", "TestObject", info.Holder(), info.GetIsolate()); |
3506 EventTarget* impl = V8TestObject::toNative(info.Holder()); | 3506 EventTarget* impl = V8TestObject::toNative(info.Holder()); |
3507 if (DOMWindow* window = impl->toDOMWindow()) { | 3507 if (DOMWindow* window = impl->toDOMWindow()) { |
3508 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { | 3508 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { |
3509 exceptionState.throwIfNeeded(); | 3509 exceptionState.throwIfNeeded(); |
3510 return; | 3510 return; |
3511 } | 3511 } |
3512 if (!window->document()) | 3512 if (!window->document()) |
3513 return; | 3513 return; |
3514 } | 3514 } |
3515 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOrCreate); | 3515 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOrCreate); |
3516 if (listener) { | 3516 if (listener) { |
3517 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); | 3517 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); |
3518 impl->addEventListener(eventName, listener, info[2]->BooleanValue()); | 3518 impl->addEventListener(eventName, listener, info[2]->BooleanValue()); |
3519 if (!impl->toNode()) | 3519 if (!impl->toNode()) |
3520 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); | 3520 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); |
3521 } | 3521 } |
3522 } | 3522 } |
3523 | 3523 |
3524 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 3524 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
3525 { | 3525 { |
3526 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3526 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3527 TestObjV8Internal::addEventListenerMethod(info); | 3527 TestObjV8Internal::addEventListenerMethod(info); |
3528 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3528 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3529 } | 3529 } |
3530 | 3530 |
3531 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3531 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3532 { | 3532 { |
3533 ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEvent
Listener", "TestObject", info.Holder(), info.GetIsolate()); | 3533 ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEvent
Listener", "TestObject", info.Holder(), info.GetIsolate()); |
3534 EventTarget* impl = V8TestObject::toNative(info.Holder()); | 3534 EventTarget* impl = V8TestObject::toNative(info.Holder()); |
3535 if (DOMWindow* window = impl->toDOMWindow()) { | 3535 if (DOMWindow* window = impl->toDOMWindow()) { |
3536 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { | 3536 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { |
3537 exceptionState.throwIfNeeded(); | 3537 exceptionState.throwIfNeeded(); |
3538 return; | 3538 return; |
3539 } | 3539 } |
3540 if (!window->document()) | 3540 if (!window->document()) |
3541 return; | 3541 return; |
3542 } | 3542 } |
3543 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOnly); | 3543 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOnly); |
3544 if (listener) { | 3544 if (listener) { |
3545 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); | 3545 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); |
3546 impl->removeEventListener(eventName, listener.get(), info[2]->BooleanVal
ue()); | 3546 impl->removeEventListener(eventName, listener.get(), info[2]->BooleanVal
ue()); |
3547 if (!impl->toNode()) | 3547 if (!impl->toNode()) |
3548 removeHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); | 3548 removeHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); |
3549 } | 3549 } |
3550 } | 3550 } |
3551 | 3551 |
3552 static void removeEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3552 static void removeEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3553 { | 3553 { |
3554 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3554 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3555 TestObjV8Internal::removeEventListenerMethod(info); | 3555 TestObjV8Internal::removeEventListenerMethod(info); |
3556 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3556 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3557 } | 3557 } |
3558 | 3558 |
3559 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3559 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3560 { | 3560 { |
3561 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3561 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3562 ScriptState* currentState = ScriptState::current(); | 3562 ScriptState* currentState = ScriptState::current(); |
3563 if (!currentState) | 3563 if (!currentState) |
3564 return; | 3564 return; |
3565 ScriptState& state = *currentState; | 3565 ScriptState& state = *currentState; |
3566 imp->withScriptStateVoid(&state); | 3566 imp->withScriptStateVoid(&state); |
3567 if (state.hadException()) { | 3567 if (state.hadException()) { |
3568 v8::Local<v8::Value> exception = state.exception(); | 3568 v8::Local<v8::Value> exception = state.exception(); |
3569 state.clearException(); | 3569 state.clearException(); |
3570 throwError(exception, info.GetIsolate()); | 3570 throwError(exception, info.GetIsolate()); |
3571 return; | 3571 return; |
3572 } | 3572 } |
3573 } | 3573 } |
3574 | 3574 |
3575 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3575 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3576 { | 3576 { |
3577 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3577 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3578 TestObjV8Internal::withScriptStateVoidMethod(info); | 3578 TestObjV8Internal::withScriptStateVoidMethod(info); |
3579 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3579 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3580 } | 3580 } |
3581 | 3581 |
3582 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3582 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3583 { | 3583 { |
3584 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3584 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3585 ScriptState* currentState = ScriptState::current(); | 3585 ScriptState* currentState = ScriptState::current(); |
3586 if (!currentState) | 3586 if (!currentState) |
3587 return; | 3587 return; |
3588 ScriptState& state = *currentState; | 3588 ScriptState& state = *currentState; |
3589 RefPtr<TestObj> result = imp->withScriptStateObj(&state); | 3589 RefPtr<TestObj> result = imp->withScriptStateObj(&state); |
3590 if (state.hadException()) { | 3590 if (state.hadException()) { |
3591 v8::Local<v8::Value> exception = state.exception(); | 3591 v8::Local<v8::Value> exception = state.exception(); |
3592 state.clearException(); | 3592 state.clearException(); |
3593 throwError(exception, info.GetIsolate()); | 3593 throwError(exception, info.GetIsolate()); |
3594 return; | 3594 return; |
3595 } | 3595 } |
3596 v8SetReturnValue(info, result.release()); | 3596 v8SetReturnValue(info, result.release()); |
3597 } | 3597 } |
3598 | 3598 |
3599 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3599 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
3600 { | 3600 { |
3601 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3601 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3602 TestObjV8Internal::withScriptStateObjMethod(info); | 3602 TestObjV8Internal::withScriptStateObjMethod(info); |
3603 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3603 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3604 } | 3604 } |
3605 | 3605 |
3606 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3606 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3607 { | 3607 { |
3608 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS
tateVoidException", "TestObject", info.Holder(), info.GetIsolate()); | 3608 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS
tateVoidException", "TestObject", info.Holder(), info.GetIsolate()); |
3609 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3609 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3610 ScriptState* currentState = ScriptState::current(); | 3610 ScriptState* currentState = ScriptState::current(); |
3611 if (!currentState) | 3611 if (!currentState) |
3612 return; | 3612 return; |
3613 ScriptState& state = *currentState; | 3613 ScriptState& state = *currentState; |
3614 imp->withScriptStateVoidException(&state, exceptionState); | 3614 imp->withScriptStateVoidException(&state, exceptionState); |
3615 if (exceptionState.throwIfNeeded()) | 3615 if (exceptionState.throwIfNeeded()) |
3616 return; | 3616 return; |
3617 if (state.hadException()) { | 3617 if (state.hadException()) { |
3618 v8::Local<v8::Value> exception = state.exception(); | 3618 v8::Local<v8::Value> exception = state.exception(); |
3619 state.clearException(); | 3619 state.clearException(); |
3620 throwError(exception, info.GetIsolate()); | 3620 throwError(exception, info.GetIsolate()); |
3621 return; | 3621 return; |
3622 } | 3622 } |
3623 } | 3623 } |
3624 | 3624 |
3625 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3625 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3626 { | 3626 { |
3627 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3627 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3628 TestObjV8Internal::withScriptStateVoidExceptionMethod(info); | 3628 TestObjV8Internal::withScriptStateVoidExceptionMethod(info); |
3629 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3629 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3630 } | 3630 } |
3631 | 3631 |
3632 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3632 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3633 { | 3633 { |
3634 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS
tateObjException", "TestObject", info.Holder(), info.GetIsolate()); | 3634 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS
tateObjException", "TestObject", info.Holder(), info.GetIsolate()); |
3635 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3635 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3636 ScriptState* currentState = ScriptState::current(); | 3636 ScriptState* currentState = ScriptState::current(); |
3637 if (!currentState) | 3637 if (!currentState) |
3638 return; | 3638 return; |
3639 ScriptState& state = *currentState; | 3639 ScriptState& state = *currentState; |
3640 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, exceptionS
tate); | 3640 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, exceptionS
tate); |
3641 if (exceptionState.throwIfNeeded()) | 3641 if (exceptionState.throwIfNeeded()) |
3642 return; | 3642 return; |
3643 if (state.hadException()) { | 3643 if (state.hadException()) { |
3644 v8::Local<v8::Value> exception = state.exception(); | 3644 v8::Local<v8::Value> exception = state.exception(); |
3645 state.clearException(); | 3645 state.clearException(); |
3646 throwError(exception, info.GetIsolate()); | 3646 throwError(exception, info.GetIsolate()); |
3647 return; | 3647 return; |
3648 } | 3648 } |
3649 v8SetReturnValue(info, result.release()); | 3649 v8SetReturnValue(info, result.release()); |
3650 } | 3650 } |
3651 | 3651 |
3652 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3652 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3653 { | 3653 { |
3654 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3654 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3655 TestObjV8Internal::withScriptStateObjExceptionMethod(info); | 3655 TestObjV8Internal::withScriptStateObjExceptionMethod(info); |
3656 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3656 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3657 } | 3657 } |
3658 | 3658 |
3659 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 3659 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
3660 { | 3660 { |
3661 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3661 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3662 ExecutionContext* scriptContext = getExecutionContext(); | 3662 ExecutionContext* scriptContext = getExecutionContext(); |
3663 imp->withExecutionContext(scriptContext); | 3663 imp->withExecutionContext(scriptContext); |
3664 } | 3664 } |
3665 | 3665 |
3666 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3666 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3667 { | 3667 { |
3668 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3668 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3669 TestObjV8Internal::withExecutionContextMethod(info); | 3669 TestObjV8Internal::withExecutionContextMethod(info); |
3670 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3670 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3671 } | 3671 } |
3672 | 3672 |
3673 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 3673 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
3674 { | 3674 { |
3675 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3675 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3676 ScriptState* currentState = ScriptState::current(); | 3676 ScriptState* currentState = ScriptState::current(); |
3677 if (!currentState) | 3677 if (!currentState) |
3678 return; | 3678 return; |
3679 ScriptState& state = *currentState; | 3679 ScriptState& state = *currentState; |
3680 ExecutionContext* scriptContext = getExecutionContext(); | 3680 ExecutionContext* scriptContext = getExecutionContext(); |
3681 imp->withExecutionContextAndScriptState(&state, scriptContext); | 3681 imp->withExecutionContextAndScriptState(&state, scriptContext); |
3682 if (state.hadException()) { | 3682 if (state.hadException()) { |
3683 v8::Local<v8::Value> exception = state.exception(); | 3683 v8::Local<v8::Value> exception = state.exception(); |
3684 state.clearException(); | 3684 state.clearException(); |
3685 throwError(exception, info.GetIsolate()); | 3685 throwError(exception, info.GetIsolate()); |
3686 return; | 3686 return; |
3687 } | 3687 } |
3688 } | 3688 } |
3689 | 3689 |
3690 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 3690 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
3691 { | 3691 { |
3692 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3692 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3693 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info); | 3693 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info); |
3694 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3694 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3695 } | 3695 } |
3696 | 3696 |
3697 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3697 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3698 { | 3698 { |
3699 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecuti
onContextAndScriptStateObjException", "TestObject", info.Holder(), info.GetIsola
te()); | 3699 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecuti
onContextAndScriptStateObjException", "TestObject", info.Holder(), info.GetIsola
te()); |
3700 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3700 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3701 ScriptState* currentState = ScriptState::current(); | 3701 ScriptState* currentState = ScriptState::current(); |
3702 if (!currentState) | 3702 if (!currentState) |
3703 return; | 3703 return; |
3704 ScriptState& state = *currentState; | 3704 ScriptState& state = *currentState; |
3705 ExecutionContext* scriptContext = getExecutionContext(); | 3705 ExecutionContext* scriptContext = getExecutionContext(); |
3706 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException
(&state, scriptContext, exceptionState); | 3706 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException
(&state, scriptContext, exceptionState); |
3707 if (exceptionState.throwIfNeeded()) | 3707 if (exceptionState.throwIfNeeded()) |
3708 return; | 3708 return; |
3709 if (state.hadException()) { | 3709 if (state.hadException()) { |
3710 v8::Local<v8::Value> exception = state.exception(); | 3710 v8::Local<v8::Value> exception = state.exception(); |
3711 state.clearException(); | 3711 state.clearException(); |
3712 throwError(exception, info.GetIsolate()); | 3712 throwError(exception, info.GetIsolate()); |
3713 return; | 3713 return; |
3714 } | 3714 } |
3715 v8SetReturnValue(info, result.release()); | 3715 v8SetReturnValue(info, result.release()); |
3716 } | 3716 } |
3717 | 3717 |
3718 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) | 3718 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) |
3719 { | 3719 { |
3720 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3720 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3721 TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info
); | 3721 TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info
); |
3722 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3722 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3723 } | 3723 } |
3724 | 3724 |
3725 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::Functio
nCallbackInfo<v8::Value>& info) | 3725 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::Functio
nCallbackInfo<v8::Value>& info) |
3726 { | 3726 { |
3727 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3727 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3728 ScriptState* currentState = ScriptState::current(); | 3728 ScriptState* currentState = ScriptState::current(); |
3729 if (!currentState) | 3729 if (!currentState) |
3730 return; | 3730 return; |
3731 ScriptState& state = *currentState; | 3731 ScriptState& state = *currentState; |
3732 ExecutionContext* scriptContext = getExecutionContext(); | 3732 ExecutionContext* scriptContext = getExecutionContext(); |
3733 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateWithSpaces(&
state, scriptContext); | 3733 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateWithSpaces(&
state, scriptContext); |
3734 if (state.hadException()) { | 3734 if (state.hadException()) { |
3735 v8::Local<v8::Value> exception = state.exception(); | 3735 v8::Local<v8::Value> exception = state.exception(); |
3736 state.clearException(); | 3736 state.clearException(); |
3737 throwError(exception, info.GetIsolate()); | 3737 throwError(exception, info.GetIsolate()); |
3738 return; | 3738 return; |
3739 } | 3739 } |
3740 v8SetReturnValue(info, result.release()); | 3740 v8SetReturnValue(info, result.release()); |
3741 } | 3741 } |
3742 | 3742 |
3743 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) | 3743 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) |
3744 { | 3744 { |
3745 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3745 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3746 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info); | 3746 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info); |
3747 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3747 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3748 } | 3748 } |
3749 | 3749 |
3750 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) | 3750 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
3751 { | 3751 { |
3752 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3752 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3753 imp->withActiveWindowAndFirstWindow(activeDOMWindow(), firstDOMWindow()); | 3753 imp->withActiveWindowAndFirstWindow(activeDOMWindow(), firstDOMWindow()); |
3754 } | 3754 } |
3755 | 3755 |
3756 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3756 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3757 { | 3757 { |
3758 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3758 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3759 TestObjV8Internal::withActiveWindowAndFirstWindowMethod(info); | 3759 TestObjV8Internal::withActiveWindowAndFirstWindowMethod(info); |
3760 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3760 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3761 } | 3761 } |
3762 | 3762 |
3763 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3763 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
3764 { | 3764 { |
3765 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithO
ptionalArg", "TestObject", info.Holder(), info.GetIsolate()); | 3765 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithO
ptionalArg", "TestObject", info.Holder(), info.GetIsolate()); |
3766 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3766 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3767 if (UNLIKELY(info.Length() <= 0)) { | 3767 if (UNLIKELY(info.Length() <= 0)) { |
3768 imp->methodWithOptionalArg(); | 3768 imp->methodWithOptionalArg(); |
3769 return; | 3769 return; |
3770 } | 3770 } |
3771 V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[0], exceptionState), except
ionState); | 3771 V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[0], exceptionState), except
ionState); |
3772 imp->methodWithOptionalArg(opt); | 3772 imp->methodWithOptionalArg(opt); |
3773 } | 3773 } |
3774 | 3774 |
3775 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 3775 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
3776 { | 3776 { |
3777 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3777 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3778 TestObjV8Internal::methodWithOptionalArgMethod(info); | 3778 TestObjV8Internal::methodWithOptionalArgMethod(info); |
3779 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3779 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3780 } | 3780 } |
3781 | 3781 |
3782 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3782 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3783 { | 3783 { |
3784 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
onOptionalArgAndOptionalArg", "TestObject", info.Holder(), info.GetIsolate()); | 3784 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
onOptionalArgAndOptionalArg", "TestObject", info.Holder(), info.GetIsolate()); |
3785 if (UNLIKELY(info.Length() < 1)) { | 3785 if (UNLIKELY(info.Length() < 1)) { |
3786 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 3786 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
3787 exceptionState.throwIfNeeded(); | 3787 exceptionState.throwIfNeeded(); |
3788 return; | 3788 return; |
3789 } | 3789 } |
3790 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3790 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3791 V8TRYCATCH_EXCEPTION_VOID(int, nonOpt, toInt32(info[0], exceptionState), exc
eptionState); | 3791 V8TRYCATCH_EXCEPTION_VOID(int, nonOpt, toInt32(info[0], exceptionState), exc
eptionState); |
3792 if (UNLIKELY(info.Length() <= 1)) { | 3792 if (UNLIKELY(info.Length() <= 1)) { |
3793 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); | 3793 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); |
3794 return; | 3794 return; |
3795 } | 3795 } |
3796 V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[1], exceptionState), except
ionState); | 3796 V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[1], exceptionState), except
ionState); |
3797 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); | 3797 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); |
3798 } | 3798 } |
3799 | 3799 |
3800 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3800 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3801 { | 3801 { |
3802 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3802 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3803 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info); | 3803 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info); |
3804 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3804 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3805 } | 3805 } |
3806 | 3806 |
3807 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) | 3807 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) |
3808 { | 3808 { |
3809 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
onOptionalArgAndTwoOptionalArgs", "TestObject", info.Holder(), info.GetIsolate()
); | 3809 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
onOptionalArgAndTwoOptionalArgs", "TestObject", info.Holder(), info.GetIsolate()
); |
3810 if (UNLIKELY(info.Length() < 1)) { | 3810 if (UNLIKELY(info.Length() < 1)) { |
3811 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 3811 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
3812 exceptionState.throwIfNeeded(); | 3812 exceptionState.throwIfNeeded(); |
3813 return; | 3813 return; |
3814 } | 3814 } |
3815 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3815 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3816 V8TRYCATCH_EXCEPTION_VOID(int, nonOpt, toInt32(info[0], exceptionState), exc
eptionState); | 3816 V8TRYCATCH_EXCEPTION_VOID(int, nonOpt, toInt32(info[0], exceptionState), exc
eptionState); |
3817 if (UNLIKELY(info.Length() <= 1)) { | 3817 if (UNLIKELY(info.Length() <= 1)) { |
3818 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); | 3818 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); |
3819 return; | 3819 return; |
3820 } | 3820 } |
3821 V8TRYCATCH_EXCEPTION_VOID(int, opt1, toInt32(info[1], exceptionState), excep
tionState); | 3821 V8TRYCATCH_EXCEPTION_VOID(int, opt1, toInt32(info[1], exceptionState), excep
tionState); |
3822 if (UNLIKELY(info.Length() <= 2)) { | 3822 if (UNLIKELY(info.Length() <= 2)) { |
3823 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); | 3823 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); |
3824 return; | 3824 return; |
3825 } | 3825 } |
3826 V8TRYCATCH_EXCEPTION_VOID(int, opt2, toInt32(info[2], exceptionState), excep
tionState); | 3826 V8TRYCATCH_EXCEPTION_VOID(int, opt2, toInt32(info[2], exceptionState), excep
tionState); |
3827 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); | 3827 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); |
3828 } | 3828 } |
3829 | 3829 |
3830 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::F
unctionCallbackInfo<v8::Value>& info) | 3830 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::F
unctionCallbackInfo<v8::Value>& info) |
3831 { | 3831 { |
3832 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3832 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3833 TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info); | 3833 TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info); |
3834 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3834 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3835 } | 3835 } |
3836 | 3836 |
3837 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 3837 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
3838 { | 3838 { |
3839 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3839 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3840 if (UNLIKELY(info.Length() <= 0)) { | 3840 if (UNLIKELY(info.Length() <= 0)) { |
3841 imp->methodWithOptionalString(); | 3841 imp->methodWithOptionalString(); |
3842 return; | 3842 return; |
3843 } | 3843 } |
3844 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 3844 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
3845 imp->methodWithOptionalString(str); | 3845 imp->methodWithOptionalString(str); |
3846 } | 3846 } |
3847 | 3847 |
3848 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 3848 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
3849 { | 3849 { |
3850 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3850 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3851 TestObjV8Internal::methodWithOptionalStringMethod(info); | 3851 TestObjV8Internal::methodWithOptionalStringMethod(info); |
3852 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3852 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3853 } | 3853 } |
3854 | 3854 |
3855 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallback
Info<v8::Value>& info) | 3855 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallback
Info<v8::Value>& info) |
3856 { | 3856 { |
3857 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3857 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3858 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 3858 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
3859 imp->methodWithOptionalStringIsUndefined(str); | 3859 imp->methodWithOptionalStringIsUndefined(str); |
3860 } | 3860 } |
3861 | 3861 |
3862 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) | 3862 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) |
3863 { | 3863 { |
3864 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3864 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3865 TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(info); | 3865 TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(info); |
3866 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3866 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3867 } | 3867 } |
3868 | 3868 |
3869 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3869 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3870 { | 3870 { |
3871 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3871 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3872 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull
(info, 0)); | 3872 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull
(info, 0)); |
3873 imp->methodWithOptionalStringIsNullString(str); | 3873 imp->methodWithOptionalStringIsNullString(str); |
3874 } | 3874 } |
3875 | 3875 |
3876 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) | 3876 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
3877 { | 3877 { |
3878 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3878 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3879 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info); | 3879 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info); |
3880 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3880 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3881 } | 3881 } |
3882 | 3882 |
3883 static void methodWithCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) | 3883 static void methodWithCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
3884 { | 3884 { |
3885 if (UNLIKELY(info.Length() < 1)) { | 3885 if (UNLIKELY(info.Length() < 1)) { |
3886 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt
erfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); | 3886 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt
erfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
3887 return; | 3887 return; |
3888 } | 3888 } |
3889 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3889 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3890 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 3890 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
3891 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt
erfaceArg", "TestObject", "The callback provided as parameter 1 is not a functio
n."), info.GetIsolate()); | 3891 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInt
erfaceArg", "TestObject", "The callback provided as parameter 1 is not a functio
n."), info.GetIsolate()); |
3892 return; | 3892 return; |
3893 } | 3893 } |
3894 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); | 3894 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
3895 imp->methodWithCallbackInterfaceArg(callbackInterface.release()); | 3895 imp->methodWithCallbackInterfaceArg(callbackInterface.release()); |
3896 } | 3896 } |
3897 | 3897 |
3898 static void methodWithCallbackInterfaceArgMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3898 static void methodWithCallbackInterfaceArgMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3899 { | 3899 { |
3900 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3900 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3901 TestObjV8Internal::methodWithCallbackInterfaceArgMethod(info); | 3901 TestObjV8Internal::methodWithCallbackInterfaceArgMethod(info); |
3902 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3902 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3903 } | 3903 } |
3904 | 3904 |
3905 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethod(const v8::Func
tionCallbackInfo<v8::Value>& info) | 3905 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethod(const v8::Func
tionCallbackInfo<v8::Value>& info) |
3906 { | 3906 { |
3907 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
onCallbackArgAndCallbackInterfaceArg", "TestObject", info.Holder(), info.GetIsol
ate()); | 3907 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
onCallbackArgAndCallbackInterfaceArg", "TestObject", info.Holder(), info.GetIsol
ate()); |
3908 if (UNLIKELY(info.Length() < 2)) { | 3908 if (UNLIKELY(info.Length() < 2)) { |
3909 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 3909 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
3910 exceptionState.throwIfNeeded(); | 3910 exceptionState.throwIfNeeded(); |
3911 return; | 3911 return; |
3912 } | 3912 } |
3913 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3913 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3914 V8TRYCATCH_EXCEPTION_VOID(int, nonCallback, toInt32(info[0], exceptionState)
, exceptionState); | 3914 V8TRYCATCH_EXCEPTION_VOID(int, nonCallback, toInt32(info[0], exceptionState)
, exceptionState); |
3915 if (info.Length() <= 1 || !info[1]->IsFunction()) { | 3915 if (info.Length() <= 1 || !info[1]->IsFunction()) { |
3916 exceptionState.throwTypeError("The callback provided as parameter 2 is n
ot a function."); | 3916 exceptionState.throwTypeError("The callback provided as parameter 2 is n
ot a function."); |
3917 exceptionState.throwIfNeeded(); | 3917 exceptionState.throwIfNeeded(); |
3918 return; | 3918 return; |
3919 } | 3919 } |
3920 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext()); | 3920 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext()); |
3921 imp->methodWithNonCallbackArgAndCallbackInterfaceArg(nonCallback, callbackIn
terface.release()); | 3921 imp->methodWithNonCallbackArgAndCallbackInterfaceArg(nonCallback, callbackIn
terface.release()); |
3922 } | 3922 } |
3923 | 3923 |
3924 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) | 3924 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) |
3925 { | 3925 { |
3926 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3926 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3927 TestObjV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethod(inf
o); | 3927 TestObjV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethod(inf
o); |
3928 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3928 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3929 } | 3929 } |
3930 | 3930 |
3931 static void methodWithCallbackInterfaceAndOptionalArgMethod(const v8::FunctionCa
llbackInfo<v8::Value>& info) | 3931 static void methodWithCallbackInterfaceAndOptionalArgMethod(const v8::FunctionCa
llbackInfo<v8::Value>& info) |
3932 { | 3932 { |
3933 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3933 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3934 OwnPtr<TestCallbackInterface> callbackInterface; | 3934 OwnPtr<TestCallbackInterface> callbackInterface; |
3935 if (info.Length() > 0 && !isUndefinedOrNull(info[0])) { | 3935 if (info.Length() > 0 && !isUndefinedOrNull(info[0])) { |
3936 if (!info[0]->IsFunction()) { | 3936 if (!info[0]->IsFunction()) { |
3937 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbac
kInterfaceAndOptionalArg", "TestObject", "The callback provided as parameter 1 i
s not a function."), info.GetIsolate()); | 3937 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbac
kInterfaceAndOptionalArg", "TestObject", "The callback provided as parameter 1 i
s not a function."), info.GetIsolate()); |
3938 return; | 3938 return; |
3939 } | 3939 } |
3940 callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Funct
ion>::Cast(info[0]), getExecutionContext()); | 3940 callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Funct
ion>::Cast(info[0]), getExecutionContext()); |
3941 } | 3941 } |
3942 imp->methodWithCallbackInterfaceAndOptionalArg(callbackInterface.release()); | 3942 imp->methodWithCallbackInterfaceAndOptionalArg(callbackInterface.release()); |
3943 } | 3943 } |
3944 | 3944 |
3945 static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::Fu
nctionCallbackInfo<v8::Value>& info) | 3945 static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::Fu
nctionCallbackInfo<v8::Value>& info) |
3946 { | 3946 { |
3947 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3947 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3948 TestObjV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info); | 3948 TestObjV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info); |
3949 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3949 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3950 } | 3950 } |
3951 | 3951 |
3952 static void methodWithNullableCallbackInterfaceArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3952 static void methodWithNullableCallbackInterfaceArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3953 { | 3953 { |
3954 if (UNLIKELY(info.Length() < 1)) { | 3954 if (UNLIKELY(info.Length() < 1)) { |
3955 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.
Length())), info.GetIsolate()); | 3955 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.
Length())), info.GetIsolate()); |
3956 return; | 3956 return; |
3957 } | 3957 } |
3958 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3958 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3959 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { | 3959 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { |
3960 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a
function."), info.GetIsolate()); | 3960 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a
function."), info.GetIsolate()); |
3961 return; | 3961 return; |
3962 } | 3962 } |
3963 OwnPtr<TestCallbackInterface> callbackInterface = info[0]->IsNull() ? nullpt
r : V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), get
ExecutionContext()); | 3963 OwnPtr<TestCallbackInterface> callbackInterface = info[0]->IsNull() ? nullpt
r : V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), get
ExecutionContext()); |
3964 imp->methodWithNullableCallbackInterfaceArg(callbackInterface.release()); | 3964 imp->methodWithNullableCallbackInterfaceArg(callbackInterface.release()); |
3965 } | 3965 } |
3966 | 3966 |
3967 static void methodWithNullableCallbackInterfaceArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3967 static void methodWithNullableCallbackInterfaceArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3968 { | 3968 { |
3969 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3969 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3970 TestObjV8Internal::methodWithNullableCallbackInterfaceArgMethod(info); | 3970 TestObjV8Internal::methodWithNullableCallbackInterfaceArgMethod(info); |
3971 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3971 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3972 } | 3972 } |
3973 | 3973 |
3974 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3974 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3975 { | 3975 { |
3976 OwnPtr<TestCallbackInterface> callbackInterface; | 3976 OwnPtr<TestCallbackInterface> callbackInterface; |
3977 if (info.Length() > 0 && !isUndefinedOrNull(info[0])) { | 3977 if (info.Length() > 0 && !isUndefinedOrNull(info[0])) { |
3978 if (!info[0]->IsFunction()) { | 3978 if (!info[0]->IsFunction()) { |
3979 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithC
allbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is n
ot a function."), info.GetIsolate()); | 3979 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithC
allbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is n
ot a function."), info.GetIsolate()); |
3980 return; | 3980 return; |
3981 } | 3981 } |
3982 callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Funct
ion>::Cast(info[0]), getExecutionContext()); | 3982 callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Funct
ion>::Cast(info[0]), getExecutionContext()); |
3983 } | 3983 } |
3984 TestObj::staticMethodWithCallbackAndOptionalArg(callbackInterface.release())
; | 3984 TestObj::staticMethodWithCallbackAndOptionalArg(callbackInterface.release())
; |
3985 } | 3985 } |
3986 | 3986 |
3987 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3987 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3988 { | 3988 { |
3989 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3989 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3990 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); | 3990 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); |
3991 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3991 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3992 } | 3992 } |
3993 | 3993 |
3994 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3994 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3995 { | 3995 { |
3996 if (UNLIKELY(info.Length() < 1)) { | 3996 if (UNLIKELY(info.Length() < 1)) { |
3997 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3997 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3998 return; | 3998 return; |
3999 } | 3999 } |
4000 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 4000 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
4001 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", "The callback provided as parameter 1 is not a function."
), info.GetIsolate()); | 4001 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", "The callback provided as parameter 1 is not a function."
), info.GetIsolate()); |
4002 return; | 4002 return; |
4003 } | 4003 } |
4004 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); | 4004 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::c
reate(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
4005 TestObj::staticMethodWithCallbackArg(callbackInterface.release()); | 4005 TestObj::staticMethodWithCallbackArg(callbackInterface.release()); |
4006 } | 4006 } |
4007 | 4007 |
4008 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 4008 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
4009 { | 4009 { |
4010 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4010 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4011 TestObjV8Internal::staticMethodWithCallbackArgMethod(info); | 4011 TestObjV8Internal::staticMethodWithCallbackArgMethod(info); |
4012 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4012 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4013 } | 4013 } |
4014 | 4014 |
4015 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::
Value>& info) | 4015 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::
Value>& info) |
4016 { | 4016 { |
4017 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt8", "TestObject", info.Holder(), info.GetIsolate()); | 4017 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt8", "TestObject", info.Holder(), info.GetIsolate()); |
4018 if (UNLIKELY(info.Length() < 1)) { | 4018 if (UNLIKELY(info.Length() < 1)) { |
4019 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4019 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4020 exceptionState.throwIfNeeded(); | 4020 exceptionState.throwIfNeeded(); |
4021 return; | 4021 return; |
4022 } | 4022 } |
4023 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4023 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4024 V8TRYCATCH_EXCEPTION_VOID(int, value, toInt8(info[0], EnforceRange, exceptio
nState), exceptionState); | 4024 V8TRYCATCH_EXCEPTION_VOID(int, value, toInt8(info[0], EnforceRange, exceptio
nState), exceptionState); |
4025 imp->methodWithEnforceRangeInt8(value); | 4025 imp->methodWithEnforceRangeInt8(value); |
4026 } | 4026 } |
4027 | 4027 |
4028 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 4028 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
4029 { | 4029 { |
4030 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4030 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4031 TestObjV8Internal::methodWithEnforceRangeInt8Method(info); | 4031 TestObjV8Internal::methodWithEnforceRangeInt8Method(info); |
4032 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4032 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4033 } | 4033 } |
4034 | 4034 |
4035 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4035 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4036 { | 4036 { |
4037 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt8", "TestObject", info.Holder(), info.GetIsolate()); | 4037 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt8", "TestObject", info.Holder(), info.GetIsolate()); |
4038 if (UNLIKELY(info.Length() < 1)) { | 4038 if (UNLIKELY(info.Length() < 1)) { |
4039 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4039 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4040 exceptionState.throwIfNeeded(); | 4040 exceptionState.throwIfNeeded(); |
4041 return; | 4041 return; |
4042 } | 4042 } |
4043 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4043 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4044 V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt8(info[0], EnforceRange, ex
ceptionState), exceptionState); | 4044 V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt8(info[0], EnforceRange, ex
ceptionState), exceptionState); |
4045 imp->methodWithEnforceRangeUInt8(value); | 4045 imp->methodWithEnforceRangeUInt8(value); |
4046 } | 4046 } |
4047 | 4047 |
4048 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 4048 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
4049 { | 4049 { |
4050 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4050 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4051 TestObjV8Internal::methodWithEnforceRangeUInt8Method(info); | 4051 TestObjV8Internal::methodWithEnforceRangeUInt8Method(info); |
4052 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4052 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4053 } | 4053 } |
4054 | 4054 |
4055 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4055 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4056 { | 4056 { |
4057 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt16", "TestObject", info.Holder(), info.GetIsolate()); | 4057 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt16", "TestObject", info.Holder(), info.GetIsolate()); |
4058 if (UNLIKELY(info.Length() < 1)) { | 4058 if (UNLIKELY(info.Length() < 1)) { |
4059 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4059 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4060 exceptionState.throwIfNeeded(); | 4060 exceptionState.throwIfNeeded(); |
4061 return; | 4061 return; |
4062 } | 4062 } |
4063 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4063 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4064 V8TRYCATCH_EXCEPTION_VOID(int, value, toInt16(info[0], EnforceRange, excepti
onState), exceptionState); | 4064 V8TRYCATCH_EXCEPTION_VOID(int, value, toInt16(info[0], EnforceRange, excepti
onState), exceptionState); |
4065 imp->methodWithEnforceRangeInt16(value); | 4065 imp->methodWithEnforceRangeInt16(value); |
4066 } | 4066 } |
4067 | 4067 |
4068 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 4068 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
4069 { | 4069 { |
4070 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4070 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4071 TestObjV8Internal::methodWithEnforceRangeInt16Method(info); | 4071 TestObjV8Internal::methodWithEnforceRangeInt16Method(info); |
4072 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4072 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4073 } | 4073 } |
4074 | 4074 |
4075 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4075 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4076 { | 4076 { |
4077 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt16", "TestObject", info.Holder(), info.GetIsolate()); | 4077 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt16", "TestObject", info.Holder(), info.GetIsolate()); |
4078 if (UNLIKELY(info.Length() < 1)) { | 4078 if (UNLIKELY(info.Length() < 1)) { |
4079 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4079 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4080 exceptionState.throwIfNeeded(); | 4080 exceptionState.throwIfNeeded(); |
4081 return; | 4081 return; |
4082 } | 4082 } |
4083 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4083 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4084 V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt16(info[0], EnforceRange, e
xceptionState), exceptionState); | 4084 V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt16(info[0], EnforceRange, e
xceptionState), exceptionState); |
4085 imp->methodWithEnforceRangeUInt16(value); | 4085 imp->methodWithEnforceRangeUInt16(value); |
4086 } | 4086 } |
4087 | 4087 |
4088 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 4088 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
4089 { | 4089 { |
4090 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4090 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4091 TestObjV8Internal::methodWithEnforceRangeUInt16Method(info); | 4091 TestObjV8Internal::methodWithEnforceRangeUInt16Method(info); |
4092 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4092 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4093 } | 4093 } |
4094 | 4094 |
4095 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4095 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4096 { | 4096 { |
4097 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt32", "TestObject", info.Holder(), info.GetIsolate()); | 4097 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt32", "TestObject", info.Holder(), info.GetIsolate()); |
4098 if (UNLIKELY(info.Length() < 1)) { | 4098 if (UNLIKELY(info.Length() < 1)) { |
4099 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4099 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4100 exceptionState.throwIfNeeded(); | 4100 exceptionState.throwIfNeeded(); |
4101 return; | 4101 return; |
4102 } | 4102 } |
4103 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4103 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4104 V8TRYCATCH_EXCEPTION_VOID(int, value, toInt32(info[0], EnforceRange, excepti
onState), exceptionState); | 4104 V8TRYCATCH_EXCEPTION_VOID(int, value, toInt32(info[0], EnforceRange, excepti
onState), exceptionState); |
4105 imp->methodWithEnforceRangeInt32(value); | 4105 imp->methodWithEnforceRangeInt32(value); |
4106 } | 4106 } |
4107 | 4107 |
4108 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 4108 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
4109 { | 4109 { |
4110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4111 TestObjV8Internal::methodWithEnforceRangeInt32Method(info); | 4111 TestObjV8Internal::methodWithEnforceRangeInt32Method(info); |
4112 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4112 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4113 } | 4113 } |
4114 | 4114 |
4115 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4115 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4116 { | 4116 { |
4117 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt32", "TestObject", info.Holder(), info.GetIsolate()); | 4117 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt32", "TestObject", info.Holder(), info.GetIsolate()); |
4118 if (UNLIKELY(info.Length() < 1)) { | 4118 if (UNLIKELY(info.Length() < 1)) { |
4119 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4119 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4120 exceptionState.throwIfNeeded(); | 4120 exceptionState.throwIfNeeded(); |
4121 return; | 4121 return; |
4122 } | 4122 } |
4123 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4123 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4124 V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt32(info[0], EnforceRange, e
xceptionState), exceptionState); | 4124 V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt32(info[0], EnforceRange, e
xceptionState), exceptionState); |
4125 imp->methodWithEnforceRangeUInt32(value); | 4125 imp->methodWithEnforceRangeUInt32(value); |
4126 } | 4126 } |
4127 | 4127 |
4128 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 4128 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
4129 { | 4129 { |
4130 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4130 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4131 TestObjV8Internal::methodWithEnforceRangeUInt32Method(info); | 4131 TestObjV8Internal::methodWithEnforceRangeUInt32Method(info); |
4132 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4132 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4133 } | 4133 } |
4134 | 4134 |
4135 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4135 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4136 { | 4136 { |
4137 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt64", "TestObject", info.Holder(), info.GetIsolate()); | 4137 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt64", "TestObject", info.Holder(), info.GetIsolate()); |
4138 if (UNLIKELY(info.Length() < 1)) { | 4138 if (UNLIKELY(info.Length() < 1)) { |
4139 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4139 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4140 exceptionState.throwIfNeeded(); | 4140 exceptionState.throwIfNeeded(); |
4141 return; | 4141 return; |
4142 } | 4142 } |
4143 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4143 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4144 V8TRYCATCH_EXCEPTION_VOID(long long, value, toInt64(info[0], EnforceRange, e
xceptionState), exceptionState); | 4144 V8TRYCATCH_EXCEPTION_VOID(long long, value, toInt64(info[0], EnforceRange, e
xceptionState), exceptionState); |
4145 imp->methodWithEnforceRangeInt64(value); | 4145 imp->methodWithEnforceRangeInt64(value); |
4146 } | 4146 } |
4147 | 4147 |
4148 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 4148 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
4149 { | 4149 { |
4150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4151 TestObjV8Internal::methodWithEnforceRangeInt64Method(info); | 4151 TestObjV8Internal::methodWithEnforceRangeInt64Method(info); |
4152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4153 } | 4153 } |
4154 | 4154 |
4155 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4155 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4156 { | 4156 { |
4157 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt64", "TestObject", info.Holder(), info.GetIsolate()); | 4157 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt64", "TestObject", info.Holder(), info.GetIsolate()); |
4158 if (UNLIKELY(info.Length() < 1)) { | 4158 if (UNLIKELY(info.Length() < 1)) { |
4159 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4159 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4160 exceptionState.throwIfNeeded(); | 4160 exceptionState.throwIfNeeded(); |
4161 return; | 4161 return; |
4162 } | 4162 } |
4163 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4163 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4164 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, value, toUInt64(info[0], Enfor
ceRange, exceptionState), exceptionState); | 4164 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, value, toUInt64(info[0], Enfor
ceRange, exceptionState), exceptionState); |
4165 imp->methodWithEnforceRangeUInt64(value); | 4165 imp->methodWithEnforceRangeUInt64(value); |
4166 } | 4166 } |
4167 | 4167 |
4168 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 4168 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
4169 { | 4169 { |
4170 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4170 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4171 TestObjV8Internal::methodWithEnforceRangeUInt64Method(info); | 4171 TestObjV8Internal::methodWithEnforceRangeUInt64Method(info); |
4172 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4172 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4173 } | 4173 } |
4174 | 4174 |
4175 #if ENABLE(Condition1) | 4175 #if ENABLE(Condition1) |
4176 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4176 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4177 { | 4177 { |
4178 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4178 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4179 v8SetReturnValueString(info, imp->conditionalMethod1(), info.GetIsolate()); | 4179 v8SetReturnValueString(info, imp->conditionalMethod1(), info.GetIsolate()); |
4180 } | 4180 } |
4181 #endif // ENABLE(Condition1) | 4181 #endif // ENABLE(Condition1) |
4182 | 4182 |
4183 #if ENABLE(Condition1) | 4183 #if ENABLE(Condition1) |
4184 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 4184 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
4185 { | 4185 { |
4186 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4186 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4187 TestObjV8Internal::conditionalMethod1Method(info); | 4187 TestObjV8Internal::conditionalMethod1Method(info); |
4188 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4188 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4189 } | 4189 } |
4190 #endif // ENABLE(Condition1) | 4190 #endif // ENABLE(Condition1) |
4191 | 4191 |
4192 #if ENABLE(Condition1) && ENABLE(Condition2) | 4192 #if ENABLE(Condition1) && ENABLE(Condition2) |
4193 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4193 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4194 { | 4194 { |
4195 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4195 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4196 imp->conditionalMethod2(); | 4196 imp->conditionalMethod2(); |
4197 } | 4197 } |
4198 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 4198 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
4199 | 4199 |
4200 #if ENABLE(Condition1) && ENABLE(Condition2) | 4200 #if ENABLE(Condition1) && ENABLE(Condition2) |
4201 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 4201 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
4202 { | 4202 { |
4203 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4203 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4204 TestObjV8Internal::conditionalMethod2Method(info); | 4204 TestObjV8Internal::conditionalMethod2Method(info); |
4205 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4205 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4206 } | 4206 } |
4207 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 4207 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
4208 | 4208 |
4209 #if ENABLE(Condition1) || ENABLE(Condition2) | 4209 #if ENABLE(Condition1) || ENABLE(Condition2) |
4210 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4210 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4211 { | 4211 { |
4212 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4212 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4213 imp->conditionalMethod3(); | 4213 imp->conditionalMethod3(); |
4214 } | 4214 } |
4215 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 4215 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
4216 | 4216 |
4217 #if ENABLE(Condition1) || ENABLE(Condition2) | 4217 #if ENABLE(Condition1) || ENABLE(Condition2) |
4218 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 4218 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
4219 { | 4219 { |
4220 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4220 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4221 TestObjV8Internal::conditionalMethod3Method(info); | 4221 TestObjV8Internal::conditionalMethod3Method(info); |
4222 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4222 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4223 } | 4223 } |
4224 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 4224 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
4225 | 4225 |
4226 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4226 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4227 { | 4227 { |
4228 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4228 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4229 v8SetReturnValue(info, imp->callbackFunctionReturnValue().v8Value()); | 4229 v8SetReturnValue(info, imp->callbackFunctionReturnValue().v8Value()); |
4230 } | 4230 } |
4231 | 4231 |
4232 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 4232 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
4233 { | 4233 { |
4234 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4234 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4235 TestObjV8Internal::callbackFunctionReturnValueMethod(info); | 4235 TestObjV8Internal::callbackFunctionReturnValueMethod(info); |
4236 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4236 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4237 } | 4237 } |
4238 | 4238 |
4239 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 4239 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
4240 { | 4240 { |
4241 if (UNLIKELY(info.Length() < 1)) { | 4241 if (UNLIKELY(info.Length() < 1)) { |
4242 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgum
ent", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); | 4242 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgum
ent", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
4243 return; | 4243 return; |
4244 } | 4244 } |
4245 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4245 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4246 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate(
))); | 4246 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate(
))); |
4247 imp->callbackFunctionArgument(function); | 4247 imp->callbackFunctionArgument(function); |
4248 } | 4248 } |
4249 | 4249 |
4250 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 4250 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
4251 { | 4251 { |
4252 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4252 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4253 TestObjV8Internal::callbackFunctionArgumentMethod(info); | 4253 TestObjV8Internal::callbackFunctionArgumentMethod(info); |
4254 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4254 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4255 } | 4255 } |
4256 | 4256 |
4257 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4257 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
4258 { | 4258 { |
4259 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethod", "TestObject", info.Holder(), info.GetIsolate()); | 4259 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethod", "TestObject", info.Holder(), info.GetIsolate()); |
4260 if (UNLIKELY(info.Length() < 1)) { | 4260 if (UNLIKELY(info.Length() < 1)) { |
4261 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4261 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4262 exceptionState.throwIfNeeded(); | 4262 exceptionState.throwIfNeeded(); |
4263 return; | 4263 return; |
4264 } | 4264 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4348 return; | 4348 return; |
4349 } | 4349 } |
4350 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 4350 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
4351 exceptionState.throwIfNeeded(); | 4351 exceptionState.throwIfNeeded(); |
4352 } | 4352 } |
4353 | 4353 |
4354 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 4354 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
4355 { | 4355 { |
4356 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4356 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4357 TestObjV8Internal::overloadedMethodMethod(info); | 4357 TestObjV8Internal::overloadedMethodMethod(info); |
4358 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4358 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4359 } | 4359 } |
4360 | 4360 |
4361 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4361 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4362 { | 4362 { |
4363 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodA", "TestObject", info.Holder(), info.GetIsolate()); | 4363 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodA", "TestObject", info.Holder(), info.GetIsolate()); |
4364 if (UNLIKELY(info.Length() < 1)) { | 4364 if (UNLIKELY(info.Length() < 1)) { |
4365 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4365 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4366 exceptionState.throwIfNeeded(); | 4366 exceptionState.throwIfNeeded(); |
4367 return; | 4367 return; |
4368 } | 4368 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4414 return; | 4414 return; |
4415 } | 4415 } |
4416 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 4416 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
4417 exceptionState.throwIfNeeded(); | 4417 exceptionState.throwIfNeeded(); |
4418 } | 4418 } |
4419 | 4419 |
4420 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4420 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4421 { | 4421 { |
4422 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4422 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4423 TestObjV8Internal::overloadedMethodAMethod(info); | 4423 TestObjV8Internal::overloadedMethodAMethod(info); |
4424 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4424 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4425 } | 4425 } |
4426 | 4426 |
4427 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4427 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4428 { | 4428 { |
4429 if (UNLIKELY(info.Length() < 1)) { | 4429 if (UNLIKELY(info.Length() < 1)) { |
4430 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 4430 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
4431 return; | 4431 return; |
4432 } | 4432 } |
4433 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4433 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4434 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4434 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
(...skipping 28 matching lines...) Expand all Loading... |
4463 return; | 4463 return; |
4464 } | 4464 } |
4465 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 4465 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
4466 exceptionState.throwIfNeeded(); | 4466 exceptionState.throwIfNeeded(); |
4467 } | 4467 } |
4468 | 4468 |
4469 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4469 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4470 { | 4470 { |
4471 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4471 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4472 TestObjV8Internal::overloadedMethodBMethod(info); | 4472 TestObjV8Internal::overloadedMethodBMethod(info); |
4473 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4473 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4474 } | 4474 } |
4475 | 4475 |
4476 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 4476 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
4477 { | 4477 { |
4478 TestObj::classMethod(); | 4478 TestObj::classMethod(); |
4479 } | 4479 } |
4480 | 4480 |
4481 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4481 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4482 { | 4482 { |
4483 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4483 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4484 TestObjV8Internal::classMethodMethod(info); | 4484 TestObjV8Internal::classMethodMethod(info); |
4485 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4485 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4486 } | 4486 } |
4487 | 4487 |
4488 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 4488 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
4489 { | 4489 { |
4490 ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethod
WithOptional", "TestObject", info.Holder(), info.GetIsolate()); | 4490 ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethod
WithOptional", "TestObject", info.Holder(), info.GetIsolate()); |
4491 if (UNLIKELY(info.Length() <= 0)) { | 4491 if (UNLIKELY(info.Length() <= 0)) { |
4492 v8SetReturnValueInt(info, TestObj::classMethodWithOptional()); | 4492 v8SetReturnValueInt(info, TestObj::classMethodWithOptional()); |
4493 return; | 4493 return; |
4494 } | 4494 } |
4495 V8TRYCATCH_EXCEPTION_VOID(int, arg, toInt32(info[0], exceptionState), except
ionState); | 4495 V8TRYCATCH_EXCEPTION_VOID(int, arg, toInt32(info[0], exceptionState), except
ionState); |
4496 v8SetReturnValueInt(info, TestObj::classMethodWithOptional(arg)); | 4496 v8SetReturnValueInt(info, TestObj::classMethodWithOptional(arg)); |
4497 } | 4497 } |
4498 | 4498 |
4499 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 4499 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
4500 { | 4500 { |
4501 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4501 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4502 TestObjV8Internal::classMethodWithOptionalMethod(info); | 4502 TestObjV8Internal::classMethodWithOptionalMethod(info); |
4503 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4503 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4504 } | 4504 } |
4505 | 4505 |
4506 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4506 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4507 { | 4507 { |
4508 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4508 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4509 V8TestObject::classMethod2MethodCustom(info); | 4509 V8TestObject::classMethod2MethodCustom(info); |
4510 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4510 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4511 } | 4511 } |
4512 | 4512 |
4513 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4513 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4514 { | 4514 { |
4515 ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethod
WithClamp", "TestObject", info.Holder(), info.GetIsolate()); | 4515 ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethod
WithClamp", "TestObject", info.Holder(), info.GetIsolate()); |
4516 if (UNLIKELY(info.Length() < 2)) { | 4516 if (UNLIKELY(info.Length() < 2)) { |
4517 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 4517 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
4518 exceptionState.throwIfNeeded(); | 4518 exceptionState.throwIfNeeded(); |
4519 return; | 4519 return; |
4520 } | 4520 } |
4521 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4521 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4522 unsigned objArgsShort = 0; | 4522 unsigned objArgsShort = 0; |
4523 V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue()); | 4523 V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue()); |
4524 if (!std::isnan(objArgsShortNativeValue)) | 4524 if (!std::isnan(objArgsShortNativeValue)) |
4525 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); | 4525 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); |
4526 unsigned objArgsLong = 0; | 4526 unsigned objArgsLong = 0; |
4527 V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue()); | 4527 V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue()); |
4528 if (!std::isnan(objArgsLongNativeValue)) | 4528 if (!std::isnan(objArgsLongNativeValue)) |
4529 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); | 4529 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); |
4530 imp->classMethodWithClamp(objArgsShort, objArgsLong); | 4530 imp->classMethodWithClamp(objArgsShort, objArgsLong); |
4531 } | 4531 } |
4532 | 4532 |
4533 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4533 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4534 { | 4534 { |
4535 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4535 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4536 TestObjV8Internal::classMethodWithClampMethod(info); | 4536 TestObjV8Internal::classMethodWithClampMethod(info); |
4537 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4537 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4538 } | 4538 } |
4539 | 4539 |
4540 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4540 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4541 { | 4541 { |
4542 ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledAtRu
ntimeMethod", "TestObject", info.Holder(), info.GetIsolate()); | 4542 ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledAtRu
ntimeMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4543 if (UNLIKELY(info.Length() < 1)) { | 4543 if (UNLIKELY(info.Length() < 1)) { |
4544 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4544 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4545 exceptionState.throwIfNeeded(); | 4545 exceptionState.throwIfNeeded(); |
4546 return; | 4546 return; |
4547 } | 4547 } |
4548 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4548 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4549 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 4549 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
4550 imp->enabledAtRuntimeMethod(longArg); | 4550 imp->enabledAtRuntimeMethod(longArg); |
4551 } | 4551 } |
4552 | 4552 |
4553 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4553 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4554 { | 4554 { |
4555 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4555 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4556 TestObjV8Internal::enabledAtRuntimeMethodMethod(info); | 4556 TestObjV8Internal::enabledAtRuntimeMethodMethod(info); |
4557 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4557 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4558 } | 4558 } |
4559 | 4559 |
4560 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 4560 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
4561 { | 4561 { |
4562 ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledPerC
ontextMethod", "TestObject", info.Holder(), info.GetIsolate()); | 4562 ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledPerC
ontextMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4563 if (UNLIKELY(info.Length() < 1)) { | 4563 if (UNLIKELY(info.Length() < 1)) { |
4564 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4564 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4565 exceptionState.throwIfNeeded(); | 4565 exceptionState.throwIfNeeded(); |
4566 return; | 4566 return; |
4567 } | 4567 } |
4568 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4568 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4569 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 4569 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
4570 imp->enabledPerContextMethod(longArg); | 4570 imp->enabledPerContextMethod(longArg); |
4571 } | 4571 } |
4572 | 4572 |
4573 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 4573 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
4574 { | 4574 { |
4575 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4575 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4576 TestObjV8Internal::enabledPerContextMethodMethod(info); | 4576 TestObjV8Internal::enabledPerContextMethodMethod(info); |
4577 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4577 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4578 } | 4578 } |
4579 | 4579 |
4580 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4580 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4581 { | 4581 { |
4582 if (UNLIKELY(info.Length() < 1)) { | 4582 if (UNLIKELY(info.Length() < 1)) { |
4583 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLon
gSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); | 4583 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLon
gSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
4584 return; | 4584 return; |
4585 } | 4585 } |
4586 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4586 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4587 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign
ed>(info[0], 1, info.GetIsolate())); | 4587 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign
ed>(info[0], 1, info.GetIsolate())); |
4588 imp->methodWithUnsignedLongSequence(unsignedLongSequence); | 4588 imp->methodWithUnsignedLongSequence(unsignedLongSequence); |
4589 } | 4589 } |
4590 | 4590 |
4591 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 4591 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
4592 { | 4592 { |
4593 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4593 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4594 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info); | 4594 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info); |
4595 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4595 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4596 } | 4596 } |
4597 | 4597 |
4598 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4598 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4599 { | 4599 { |
4600 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray
Function", "TestObject", info.Holder(), info.GetIsolate()); | 4600 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray
Function", "TestObject", info.Holder(), info.GetIsolate()); |
4601 if (UNLIKELY(info.Length() < 1)) { | 4601 if (UNLIKELY(info.Length() < 1)) { |
4602 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4602 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4603 exceptionState.throwIfNeeded(); | 4603 exceptionState.throwIfNeeded(); |
4604 return; | 4604 return; |
4605 } | 4605 } |
4606 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4606 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4607 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); | 4607 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); |
4608 Vector<String> result = imp->stringArrayFunction(values, exceptionState); | 4608 Vector<String> result = imp->stringArrayFunction(values, exceptionState); |
4609 if (exceptionState.throwIfNeeded()) | 4609 if (exceptionState.throwIfNeeded()) |
4610 return; | 4610 return; |
4611 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); | 4611 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); |
4612 } | 4612 } |
4613 | 4613 |
4614 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4614 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4615 { | 4615 { |
4616 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4616 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4617 TestObjV8Internal::stringArrayFunctionMethod(info); | 4617 TestObjV8Internal::stringArrayFunctionMethod(info); |
4618 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4618 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4619 } | 4619 } |
4620 | 4620 |
4621 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4621 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
4622 { | 4622 { |
4623 ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringLi
stFunction", "TestObject", info.Holder(), info.GetIsolate()); | 4623 ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringLi
stFunction", "TestObject", info.Holder(), info.GetIsolate()); |
4624 if (UNLIKELY(info.Length() < 1)) { | 4624 if (UNLIKELY(info.Length() < 1)) { |
4625 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4625 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4626 exceptionState.throwIfNeeded(); | 4626 exceptionState.throwIfNeeded(); |
4627 return; | 4627 return; |
4628 } | 4628 } |
4629 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4629 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4630 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0]
, info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v
8::Handle<v8::Object>::Cast(info[0])) : 0); | 4630 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0]
, info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v
8::Handle<v8::Object>::Cast(info[0])) : 0); |
4631 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS
tate); | 4631 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS
tate); |
4632 if (exceptionState.throwIfNeeded()) | 4632 if (exceptionState.throwIfNeeded()) |
4633 return; | 4633 return; |
4634 v8SetReturnValue(info, result.release()); | 4634 v8SetReturnValue(info, result.release()); |
4635 } | 4635 } |
4636 | 4636 |
4637 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 4637 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
4638 { | 4638 { |
4639 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4639 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4640 TestObjV8Internal::domStringListFunctionMethod(info); | 4640 TestObjV8Internal::domStringListFunctionMethod(info); |
4641 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4641 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4642 } | 4642 } |
4643 | 4643 |
4644 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) | 4644 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
4645 { | 4645 { |
4646 if (UNLIKELY(info.Length() < 1)) { | 4646 if (UNLIKELY(info.Length() < 1)) { |
4647 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; | 4647 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
4648 return; | 4648 return; |
4649 } | 4649 } |
4650 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4650 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4651 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); | 4651 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
4652 imp->convert1(value); | 4652 imp->convert1(value); |
4653 } | 4653 } |
4654 | 4654 |
4655 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4655 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
4656 { | 4656 { |
4657 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4657 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4658 TestObjV8Internal::convert1Method(info); | 4658 TestObjV8Internal::convert1Method(info); |
4659 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4659 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4660 } | 4660 } |
4661 | 4661 |
4662 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) | 4662 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
4663 { | 4663 { |
4664 if (UNLIKELY(info.Length() < 1)) { | 4664 if (UNLIKELY(info.Length() < 1)) { |
4665 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; | 4665 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
4666 return; | 4666 return; |
4667 } | 4667 } |
4668 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4668 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4669 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); | 4669 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
4670 imp->convert2(value); | 4670 imp->convert2(value); |
4671 } | 4671 } |
4672 | 4672 |
4673 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4673 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
4674 { | 4674 { |
4675 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4675 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4676 TestObjV8Internal::convert2Method(info); | 4676 TestObjV8Internal::convert2Method(info); |
4677 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4677 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4678 } | 4678 } |
4679 | 4679 |
4680 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 4680 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
4681 { | 4681 { |
4682 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4682 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4683 imp->banana(); | 4683 imp->banana(); |
4684 } | 4684 } |
4685 | 4685 |
4686 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4686 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4687 { | 4687 { |
4688 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4688 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4689 TestObjV8Internal::orangeMethod(info); | 4689 TestObjV8Internal::orangeMethod(info); |
4690 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4690 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4691 } | 4691 } |
4692 | 4692 |
4693 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4693 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4694 { | 4694 { |
4695 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunct
ion", "TestObject", info.Holder(), info.GetIsolate()); | 4695 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunct
ion", "TestObject", info.Holder(), info.GetIsolate()); |
4696 if (UNLIKELY(info.Length() < 3)) { | 4696 if (UNLIKELY(info.Length() < 3)) { |
4697 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 4697 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
4698 exceptionState.throwIfNeeded(); | 4698 exceptionState.throwIfNeeded(); |
4699 return; | 4699 return; |
4700 } | 4700 } |
4701 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4701 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4702 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 4702 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
4703 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); | 4703 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); |
4704 V8TRYCATCH_EXCEPTION_VOID(int, b, toInt32(info[2], exceptionState), exceptio
nState); | 4704 V8TRYCATCH_EXCEPTION_VOID(int, b, toInt32(info[2], exceptionState), exceptio
nState); |
4705 bool result = imp->strictFunction(str, a, b, exceptionState); | 4705 bool result = imp->strictFunction(str, a, b, exceptionState); |
4706 if (exceptionState.throwIfNeeded()) | 4706 if (exceptionState.throwIfNeeded()) |
4707 return; | 4707 return; |
4708 v8SetReturnValueBool(info, result); | 4708 v8SetReturnValueBool(info, result); |
4709 } | 4709 } |
4710 | 4710 |
4711 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4711 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4712 { | 4712 { |
4713 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4713 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4714 TestObjV8Internal::strictFunctionMethod(info); | 4714 TestObjV8Internal::strictFunctionMethod(info); |
4715 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4715 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4716 } | 4716 } |
4717 | 4717 |
4718 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4718 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4719 { | 4719 { |
4720 if (UNLIKELY(info.Length() < 1)) { | 4720 if (UNLIKELY(info.Length() < 1)) { |
4721 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); | 4721 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); |
4722 return; | 4722 return; |
4723 } | 4723 } |
4724 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4724 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4725 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]); | 4725 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]); |
4726 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1)); | 4726 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1)); |
4727 imp->variadicStringMethod(head, tail); | 4727 imp->variadicStringMethod(head, tail); |
4728 } | 4728 } |
4729 | 4729 |
4730 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4730 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4731 { | 4731 { |
4732 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4732 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4733 TestObjV8Internal::variadicStringMethodMethod(info); | 4733 TestObjV8Internal::variadicStringMethodMethod(info); |
4734 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4734 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4735 } | 4735 } |
4736 | 4736 |
4737 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4737 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4738 { | 4738 { |
4739 if (UNLIKELY(info.Length() < 1)) { | 4739 if (UNLIKELY(info.Length() < 1)) { |
4740 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); | 4740 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); |
4741 return; | 4741 return; |
4742 } | 4742 } |
4743 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4743 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4744 V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue())); | 4744 V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue())); |
4745 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1)); | 4745 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1)); |
4746 imp->variadicDoubleMethod(head, tail); | 4746 imp->variadicDoubleMethod(head, tail); |
4747 } | 4747 } |
4748 | 4748 |
4749 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4749 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4750 { | 4750 { |
4751 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4751 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4752 TestObjV8Internal::variadicDoubleMethodMethod(info); | 4752 TestObjV8Internal::variadicDoubleMethodMethod(info); |
4753 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4753 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4754 } | 4754 } |
4755 | 4755 |
4756 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4756 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4757 { | 4757 { |
4758 if (UNLIKELY(info.Length() < 1)) { | 4758 if (UNLIKELY(info.Length() < 1)) { |
4759 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get
Isolate()); | 4759 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get
Isolate()); |
4760 return; | 4760 return; |
4761 } | 4761 } |
4762 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4762 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4763 V8TRYCATCH_VOID(Node*, head, V8Node::hasInstance(info[0], info.GetIsolate(),
worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(i
nfo[0])) : 0); | 4763 V8TRYCATCH_VOID(Node*, head, V8Node::hasInstance(info[0], info.GetIsolate(),
worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(i
nfo[0])) : 0); |
4764 Vector<RefPtr<Node> > tail; | 4764 Vector<RefPtr<Node> > tail; |
4765 for (int i = 1; i < info.Length(); ++i) { | 4765 for (int i = 1; i < info.Length(); ++i) { |
4766 if (!V8Node::hasInstance(info[i], info.GetIsolate(), worldType(info.GetI
solate()))) { | 4766 if (!V8Node::hasInstance(info[i], info.GetIsolate(), worldType(info.GetI
solate()))) { |
4767 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); | 4767 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); |
4768 return; | 4768 return; |
4769 } | 4769 } |
4770 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); | 4770 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); |
4771 } | 4771 } |
4772 imp->variadicNodeMethod(head, tail); | 4772 imp->variadicNodeMethod(head, tail); |
4773 } | 4773 } |
4774 | 4774 |
4775 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 4775 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
4776 { | 4776 { |
4777 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4777 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4778 TestObjV8Internal::variadicNodeMethodMethod(info); | 4778 TestObjV8Internal::variadicNodeMethodMethod(info); |
4779 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4779 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4780 } | 4780 } |
4781 | 4781 |
4782 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4782 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4783 { | 4783 { |
4784 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
ullableArguments", "TestObject", info.Holder(), info.GetIsolate()); | 4784 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
ullableArguments", "TestObject", info.Holder(), info.GetIsolate()); |
4785 if (UNLIKELY(info.Length() < 3)) { | 4785 if (UNLIKELY(info.Length() < 3)) { |
4786 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 4786 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
4787 exceptionState.throwIfNeeded(); | 4787 exceptionState.throwIfNeeded(); |
4788 return; | 4788 return; |
4789 } | 4789 } |
(...skipping 15 matching lines...) Expand all Loading... |
4805 } | 4805 } |
4806 bool dIsNull = info[3]->IsNull(); | 4806 bool dIsNull = info[3]->IsNull(); |
4807 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue())); | 4807 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue())); |
4808 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj
.release(), dIsNull ? 0 : &d); | 4808 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj
.release(), dIsNull ? 0 : &d); |
4809 } | 4809 } |
4810 | 4810 |
4811 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 4811 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
4812 { | 4812 { |
4813 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4813 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4814 TestObjV8Internal::methodWithNullableArgumentsMethod(info); | 4814 TestObjV8Internal::methodWithNullableArgumentsMethod(info); |
4815 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4815 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4816 } | 4816 } |
4817 | 4817 |
4818 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4818 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4819 { | 4819 { |
4820 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4820 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4821 imp->perWorldMethod(); | 4821 imp->perWorldMethod(); |
4822 } | 4822 } |
4823 | 4823 |
4824 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4824 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4825 { | 4825 { |
4826 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4826 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4827 TestObjV8Internal::perWorldMethodMethod(info); | 4827 TestObjV8Internal::perWorldMethodMethod(info); |
4828 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4828 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4829 } | 4829 } |
4830 | 4830 |
4831 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::
Value>& info) | 4831 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::
Value>& info) |
4832 { | 4832 { |
4833 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4833 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4834 imp->perWorldMethod(); | 4834 imp->perWorldMethod(); |
4835 } | 4835 } |
4836 | 4836 |
4837 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 4837 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
4838 { | 4838 { |
4839 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4839 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4840 TestObjV8Internal::perWorldMethodMethodForMainWorld(info); | 4840 TestObjV8Internal::perWorldMethodMethodForMainWorld(info); |
4841 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4841 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4842 } | 4842 } |
4843 | 4843 |
4844 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4844 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4845 { | 4845 { |
4846 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP
erWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); | 4846 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP
erWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4847 if (UNLIKELY(info.Length() < 1)) { | 4847 if (UNLIKELY(info.Length() < 1)) { |
4848 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4848 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4849 exceptionState.throwIfNeeded(); | 4849 exceptionState.throwIfNeeded(); |
4850 return; | 4850 return; |
4851 } | 4851 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4898 return; | 4898 return; |
4899 } | 4899 } |
4900 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 4900 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
4901 exceptionState.throwIfNeeded(); | 4901 exceptionState.throwIfNeeded(); |
4902 } | 4902 } |
4903 | 4903 |
4904 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 4904 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
4905 { | 4905 { |
4906 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4906 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4907 TestObjV8Internal::overloadedPerWorldMethodMethod(info); | 4907 TestObjV8Internal::overloadedPerWorldMethodMethod(info); |
4908 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4908 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4909 } | 4909 } |
4910 | 4910 |
4911 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 4911 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
4912 { | 4912 { |
4913 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP
erWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); | 4913 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP
erWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4914 if (UNLIKELY(info.Length() < 2)) { | 4914 if (UNLIKELY(info.Length() < 2)) { |
4915 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 4915 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
4916 exceptionState.throwIfNeeded(); | 4916 exceptionState.throwIfNeeded(); |
4917 return; | 4917 return; |
4918 } | 4918 } |
(...skipping 20 matching lines...) Expand all Loading... |
4939 return; | 4939 return; |
4940 } | 4940 } |
4941 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 4941 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
4942 exceptionState.throwIfNeeded(); | 4942 exceptionState.throwIfNeeded(); |
4943 } | 4943 } |
4944 | 4944 |
4945 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio
nCallbackInfo<v8::Value>& info) | 4945 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio
nCallbackInfo<v8::Value>& info) |
4946 { | 4946 { |
4947 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4947 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4948 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); | 4948 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); |
4949 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4949 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4950 } | 4950 } |
4951 | 4951 |
4952 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4952 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value
>& info) |
4953 { | 4953 { |
4954 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedMethod1", "TestObject", info.Holder(), info.GetIsolate()); | 4954 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedMethod1", "TestObject", info.Holder(), info.GetIsolate()); |
4955 if (UNLIKELY(info.Length() < 1)) { | 4955 if (UNLIKELY(info.Length() < 1)) { |
4956 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4956 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4957 exceptionState.throwIfNeeded(); | 4957 exceptionState.throwIfNeeded(); |
4958 return; | 4958 return; |
4959 } | 4959 } |
4960 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4960 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4961 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 4961 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
4962 imp->activityLoggedMethod1(longArg); | 4962 imp->activityLoggedMethod1(longArg); |
4963 } | 4963 } |
4964 | 4964 |
4965 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 4965 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
4966 { | 4966 { |
4967 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4967 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4968 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4968 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4969 if (contextData && contextData->activityLogger()) { | 4969 if (contextData && contextData->activityLogger()) { |
4970 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4970 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4971 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", i
nfo.Length(), loggerArgs.data(), "Method"); | 4971 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", i
nfo.Length(), loggerArgs.data(), "Method"); |
4972 } | 4972 } |
4973 TestObjV8Internal::activityLoggedMethod1Method(info); | 4973 TestObjV8Internal::activityLoggedMethod1Method(info); |
4974 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4974 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
4975 } | 4975 } |
4976 | 4976 |
4977 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4977 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value
>& info) |
4978 { | 4978 { |
4979 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedMethod2", "TestObject", info.Holder(), info.GetIsolate()); | 4979 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedMethod2", "TestObject", info.Holder(), info.GetIsolate()); |
4980 if (UNLIKELY(info.Length() < 1)) { | 4980 if (UNLIKELY(info.Length() < 1)) { |
4981 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4981 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
4982 exceptionState.throwIfNeeded(); | 4982 exceptionState.throwIfNeeded(); |
4983 return; | 4983 return; |
4984 } | 4984 } |
4985 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4985 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4986 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 4986 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
4987 imp->activityLoggedMethod2(longArg); | 4987 imp->activityLoggedMethod2(longArg); |
4988 } | 4988 } |
4989 | 4989 |
4990 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 4990 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
4991 { | 4991 { |
4992 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4992 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4993 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4993 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4994 if (contextData && contextData->activityLogger()) { | 4994 if (contextData && contextData->activityLogger()) { |
4995 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4995 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4996 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); | 4996 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); |
4997 } | 4997 } |
4998 TestObjV8Internal::activityLoggedMethod2Method(info); | 4998 TestObjV8Internal::activityLoggedMethod2Method(info); |
4999 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4999 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5000 } | 5000 } |
5001 | 5001 |
5002 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn
fo<v8::Value>& info) | 5002 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn
fo<v8::Value>& info) |
5003 { | 5003 { |
5004 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedMethod2", "TestObject", info.Holder(), info.GetIsolate()); | 5004 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedMethod2", "TestObject", info.Holder(), info.GetIsolate()); |
5005 if (UNLIKELY(info.Length() < 1)) { | 5005 if (UNLIKELY(info.Length() < 1)) { |
5006 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 5006 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
5007 exceptionState.throwIfNeeded(); | 5007 exceptionState.throwIfNeeded(); |
5008 return; | 5008 return; |
5009 } | 5009 } |
5010 TestObj* imp = V8TestObject::toNative(info.Holder()); | 5010 TestObj* imp = V8TestObject::toNative(info.Holder()); |
5011 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 5011 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
5012 imp->activityLoggedMethod2(longArg); | 5012 imp->activityLoggedMethod2(longArg); |
5013 } | 5013 } |
5014 | 5014 |
5015 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCa
llbackInfo<v8::Value>& info) | 5015 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCa
llbackInfo<v8::Value>& info) |
5016 { | 5016 { |
5017 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5017 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5018 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 5018 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
5019 if (contextData && contextData->activityLogger()) { | 5019 if (contextData && contextData->activityLogger()) { |
5020 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 5020 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
5021 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); | 5021 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); |
5022 } | 5022 } |
5023 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info); | 5023 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info); |
5024 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5024 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5025 } | 5025 } |
5026 | 5026 |
5027 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) | 5027 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) |
5028 { | 5028 { |
5029 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); | 5029 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
5030 if (UNLIKELY(info.Length() < 1)) { | 5030 if (UNLIKELY(info.Length() < 1)) { |
5031 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 5031 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
5032 exceptionState.throwIfNeeded(); | 5032 exceptionState.throwIfNeeded(); |
5033 return; | 5033 return; |
5034 } | 5034 } |
5035 TestObj* imp = V8TestObject::toNative(info.Holder()); | 5035 TestObj* imp = V8TestObject::toNative(info.Holder()); |
5036 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 5036 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
5037 imp->activityLoggedInIsolatedWorldMethod(longArg); | 5037 imp->activityLoggedInIsolatedWorldMethod(longArg); |
5038 } | 5038 } |
5039 | 5039 |
5040 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) | 5040 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) |
5041 { | 5041 { |
5042 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5042 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5043 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 5043 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
5044 if (contextData && contextData->activityLogger()) { | 5044 if (contextData && contextData->activityLogger()) { |
5045 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 5045 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
5046 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", info.Length(), loggerArgs.data(), "Method"); | 5046 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", info.Length(), loggerArgs.data(), "Method"); |
5047 } | 5047 } |
5048 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info); | 5048 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info); |
5049 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5049 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5050 } | 5050 } |
5051 | 5051 |
5052 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func
tionCallbackInfo<v8::Value>& info) | 5052 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func
tionCallbackInfo<v8::Value>& info) |
5053 { | 5053 { |
5054 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); | 5054 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
5055 if (UNLIKELY(info.Length() < 1)) { | 5055 if (UNLIKELY(info.Length() < 1)) { |
5056 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 5056 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
5057 exceptionState.throwIfNeeded(); | 5057 exceptionState.throwIfNeeded(); |
5058 return; | 5058 return; |
5059 } | 5059 } |
5060 TestObj* imp = V8TestObject::toNative(info.Holder()); | 5060 TestObj* imp = V8TestObject::toNative(info.Holder()); |
5061 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 5061 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
5062 imp->activityLoggedInIsolatedWorldMethod(longArg); | 5062 imp->activityLoggedInIsolatedWorldMethod(longArg); |
5063 } | 5063 } |
5064 | 5064 |
5065 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) | 5065 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) |
5066 { | 5066 { |
5067 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5067 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5068 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(inf
o); | 5068 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(inf
o); |
5069 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5069 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5070 } | 5070 } |
5071 | 5071 |
5072 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo
<v8::Value>& info) | 5072 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo
<v8::Value>& info) |
5073 { | 5073 { |
5074 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedA
ctivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); | 5074 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedA
ctivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
5075 if (UNLIKELY(info.Length() < 1)) { | 5075 if (UNLIKELY(info.Length() < 1)) { |
5076 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 5076 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
5077 exceptionState.throwIfNeeded(); | 5077 exceptionState.throwIfNeeded(); |
5078 return; | 5078 return; |
5079 } | 5079 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5131 | 5131 |
5132 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 5132 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
5133 { | 5133 { |
5134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5135 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 5135 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
5136 if (contextData && contextData->activityLogger()) { | 5136 if (contextData && contextData->activityLogger()) { |
5137 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 5137 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
5138 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); | 5138 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); |
5139 } | 5139 } |
5140 TestObjV8Internal::overloadedActivityLoggedMethodMethod(info); | 5140 TestObjV8Internal::overloadedActivityLoggedMethodMethod(info); |
5141 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5141 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5142 } | 5142 } |
5143 | 5143 |
5144 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) | 5144 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) |
5145 { | 5145 { |
5146 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedA
ctivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); | 5146 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedA
ctivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
5147 if (UNLIKELY(info.Length() < 2)) { | 5147 if (UNLIKELY(info.Length() < 2)) { |
5148 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 5148 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
5149 exceptionState.throwIfNeeded(); | 5149 exceptionState.throwIfNeeded(); |
5150 return; | 5150 return; |
5151 } | 5151 } |
(...skipping 25 matching lines...) Expand all Loading... |
5177 | 5177 |
5178 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::F
unctionCallbackInfo<v8::Value>& info) | 5178 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::F
unctionCallbackInfo<v8::Value>& info) |
5179 { | 5179 { |
5180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5181 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 5181 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
5182 if (contextData && contextData->activityLogger()) { | 5182 if (contextData && contextData->activityLogger()) { |
5183 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 5183 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
5184 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); | 5184 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); |
5185 } | 5185 } |
5186 TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info); | 5186 TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info); |
5187 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5187 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5188 } | 5188 } |
5189 | 5189 |
5190 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 5190 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
5191 { | 5191 { |
5192 TestObj* imp = V8TestObject::toNative(info.Holder()); | 5192 TestObj* imp = V8TestObject::toNative(info.Holder()); |
5193 imp->deprecatedMethod(); | 5193 imp->deprecatedMethod(); |
5194 } | 5194 } |
5195 | 5195 |
5196 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 5196 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
5197 { | 5197 { |
5198 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5198 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5199 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Method); | 5199 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Method); |
5200 TestObjV8Internal::deprecatedMethodMethod(info); | 5200 TestObjV8Internal::deprecatedMethodMethod(info); |
5201 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5201 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5202 } | 5202 } |
5203 | 5203 |
5204 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 5204 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
5205 { | 5205 { |
5206 TestObj::deprecatedStaticMethod(); | 5206 TestObj::deprecatedStaticMethod(); |
5207 } | 5207 } |
5208 | 5208 |
5209 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 5209 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
5210 { | 5210 { |
5211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5212 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMet
hod); | 5212 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMet
hod); |
5213 TestObjV8Internal::deprecatedStaticMethodMethod(info); | 5213 TestObjV8Internal::deprecatedStaticMethodMethod(info); |
5214 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5214 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5215 } | 5215 } |
5216 | 5216 |
5217 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 5217 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
5218 { | 5218 { |
5219 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | 5219 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
5220 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5220 TestObj* collection = V8TestObject::toNative(info.Holder()); |
5221 RefPtr<Node> element = collection->item(index); | 5221 RefPtr<Node> element = collection->item(index); |
5222 if (!element) | 5222 if (!element) |
5223 return; | 5223 return; |
5224 v8SetReturnValueFast(info, element.release(), collection); | 5224 v8SetReturnValueFast(info, element.release(), collection); |
5225 } | 5225 } |
5226 | 5226 |
5227 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 5227 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
5228 { | 5228 { |
5229 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 5229 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
5230 TestObjV8Internal::indexedPropertyGetter(index, info); | 5230 TestObjV8Internal::indexedPropertyGetter(index, info); |
5231 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5231 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5232 } | 5232 } |
5233 | 5233 |
5234 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 5234 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
5235 { | 5235 { |
5236 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 5236 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
5237 return; | 5237 return; |
5238 if (info.Holder()->HasRealNamedCallbackProperty(name)) | 5238 if (info.Holder()->HasRealNamedCallbackProperty(name)) |
5239 return; | 5239 return; |
5240 if (info.Holder()->HasRealNamedProperty(name)) | 5240 if (info.Holder()->HasRealNamedProperty(name)) |
5241 return; | 5241 return; |
5242 | 5242 |
5243 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | 5243 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
5244 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5244 TestObj* collection = V8TestObject::toNative(info.Holder()); |
5245 AtomicString propertyName = toCoreAtomicString(name); | 5245 AtomicString propertyName = toCoreAtomicString(name); |
5246 String element = collection->namedItem(propertyName); | 5246 String element = collection->namedItem(propertyName); |
5247 if (element.isNull()) | 5247 if (element.isNull()) |
5248 return; | 5248 return; |
5249 v8SetReturnValueString(info, element, info.GetIsolate()); | 5249 v8SetReturnValueString(info, element, info.GetIsolate()); |
5250 } | 5250 } |
5251 | 5251 |
5252 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 5252 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
5253 { | 5253 { |
5254 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 5254 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
5255 TestObjV8Internal::namedPropertyGetter(name, info); | 5255 TestObjV8Internal::namedPropertyGetter(name, info); |
5256 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5256 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5257 } | 5257 } |
5258 | 5258 |
5259 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | 5259 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
5260 { | 5260 { |
5261 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 5261 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
5262 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5262 TestObj* collection = V8TestObject::toNative(info.Holder()); |
5263 Vector<String> names; | 5263 Vector<String> names; |
5264 collection->namedPropertyEnumerator(names, exceptionState); | 5264 collection->namedPropertyEnumerator(names, exceptionState); |
5265 if (exceptionState.throwIfNeeded()) | 5265 if (exceptionState.throwIfNeeded()) |
5266 return; | 5266 return; |
(...skipping 13 matching lines...) Expand all Loading... |
5280 return; | 5280 return; |
5281 if (!result) | 5281 if (!result) |
5282 return; | 5282 return; |
5283 v8SetReturnValueInt(info, v8::None); | 5283 v8SetReturnValueInt(info, v8::None); |
5284 } | 5284 } |
5285 | 5285 |
5286 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 5286 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
5287 { | 5287 { |
5288 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 5288 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
5289 TestObjV8Internal::namedPropertyEnumerator(info); | 5289 TestObjV8Internal::namedPropertyEnumerator(info); |
5290 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5290 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5291 } | 5291 } |
5292 | 5292 |
5293 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) | 5293 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) |
5294 { | 5294 { |
5295 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 5295 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
5296 TestObjV8Internal::namedPropertyQuery(name, info); | 5296 TestObjV8Internal::namedPropertyQuery(name, info); |
5297 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5297 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
5298 } | 5298 } |
5299 | 5299 |
5300 } // namespace TestObjV8Internal | 5300 } // namespace TestObjV8Internal |
5301 | 5301 |
5302 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[]
= { | 5302 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[]
= { |
5303 {"readOnlyLongAttr", TestObjV8Internal::readOnlyLongAttrAttributeGetterCallb
ack, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, | 5303 {"readOnlyLongAttr", TestObjV8Internal::readOnlyLongAttrAttributeGetterCallb
ack, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, |
5304 {"readOnlyStringAttr", TestObjV8Internal::readOnlyStringAttrAttributeGetterC
allback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, | 5304 {"readOnlyStringAttr", TestObjV8Internal::readOnlyStringAttrAttributeGetterC
allback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, |
5305 {"readOnlyTestObjectAttr", TestObjV8Internal::readOnlyTestObjectAttrAttribut
eGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static
_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 5305 {"readOnlyTestObjectAttr", TestObjV8Internal::readOnlyTestObjectAttrAttribut
eGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static
_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
5306 {"TestSubObj", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Interna
l::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>
(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), s
tatic_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, | 5306 {"TestSubObj", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Interna
l::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>
(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), s
tatic_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
5307 {"enumAttr", TestObjV8Internal::enumAttrAttributeGetterCallback, TestObjV8In
ternal::enumAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>
(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */
}, | 5307 {"enumAttr", TestObjV8Internal::enumAttrAttributeGetterCallback, TestObjV8In
ternal::enumAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>
(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */
}, |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5614 fromInternalPointer(object)->deref(); | 5614 fromInternalPointer(object)->deref(); |
5615 } | 5615 } |
5616 | 5616 |
5617 template<> | 5617 template<> |
5618 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 5618 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
5619 { | 5619 { |
5620 return toV8(impl, creationContext, isolate); | 5620 return toV8(impl, creationContext, isolate); |
5621 } | 5621 } |
5622 | 5622 |
5623 } // namespace WebCore | 5623 } // namespace WebCore |
OLD | NEW |