OLD | NEW |
1 /* | 1 /* |
2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
4 | 4 |
5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
9 | 9 |
10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 Library General Public License for more details. | 13 Library General Public License for more details. |
14 | 14 |
15 You should have received a copy of the GNU Library General Public License | 15 You should have received a copy of the GNU Library General Public License |
16 along with this library; see the file COPYING.LIB. If not, write to | 16 along with this library; see the file COPYING.LIB. If not, write to |
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 Boston, MA 02111-1307, USA. | 18 Boston, MA 02111-1307, USA. |
19 */ | 19 */ |
20 | 20 |
21 #include "config.h" | 21 #include "config.h" |
22 #include "V8TestEventTarget.h" | 22 #include "V8TestEventTarget.h" |
23 | 23 |
24 #include "RuntimeEnabledFeatures.h" | 24 #include "RuntimeEnabledFeatures.h" |
25 #include "V8EventTarget.h" | 25 #include "V8EventTarget.h" |
26 #include "V8Node.h" | 26 #include "V8Node.h" |
| 27 #include "bindings/v8/ExceptionState.h" |
27 #include "bindings/v8/ScriptController.h" | 28 #include "bindings/v8/ScriptController.h" |
28 #include "bindings/v8/V8Binding.h" | 29 #include "bindings/v8/V8Binding.h" |
29 #include "bindings/v8/V8DOMConfiguration.h" | 30 #include "bindings/v8/V8DOMConfiguration.h" |
30 #include "bindings/v8/V8DOMWrapper.h" | 31 #include "bindings/v8/V8DOMWrapper.h" |
31 #include "core/dom/ContextFeatures.h" | 32 #include "core/dom/ContextFeatures.h" |
32 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
33 #include "core/dom/ExceptionCode.h" | 34 #include "core/dom/ExceptionCode.h" |
34 #include "core/page/Frame.h" | 35 #include "core/page/Frame.h" |
35 #include "core/platform/chromium/TraceEvent.h" | 36 #include "core/platform/chromium/TraceEvent.h" |
36 #include "wtf/UnusedParam.h" | 37 #include "wtf/UnusedParam.h" |
(...skipping 26 matching lines...) Expand all Loading... |
63 | 64 |
64 template <typename T> void V8_USE(T) { } | 65 template <typename T> void V8_USE(T) { } |
65 | 66 |
66 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& args) | 67 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& args) |
67 { | 68 { |
68 if (args.Length() < 1) { | 69 if (args.Length() < 1) { |
69 throwNotEnoughArgumentsError(args.GetIsolate()); | 70 throwNotEnoughArgumentsError(args.GetIsolate()); |
70 return; | 71 return; |
71 } | 72 } |
72 TestEventTarget* imp = V8TestEventTarget::toNative(args.Holder()); | 73 TestEventTarget* imp = V8TestEventTarget::toNative(args.Holder()); |
73 ExceptionCode ec = 0; | 74 ExceptionState es(args.GetIsolate()); |
74 V8TRYCATCH_VOID(int, index, toUInt32(args[0])); | 75 V8TRYCATCH_VOID(int, index, toUInt32(args[0])); |
75 if (UNLIKELY(index < 0)) { | 76 if (UNLIKELY(index < 0)) { |
76 setDOMException(IndexSizeError, args.GetIsolate()); | 77 setDOMException(IndexSizeError, args.GetIsolate()); |
77 return; | 78 return; |
78 } | 79 } |
79 v8SetReturnValue(args, toV8(imp->item(index), args.Holder(), args.GetIsolate
())); | 80 v8SetReturnValue(args, toV8(imp->item(index), args.Holder(), args.GetIsolate
())); |
80 return; | 81 return; |
81 } | 82 } |
82 | 83 |
83 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) | 84 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
alue, const v8::PropertyCallbackInfo<v8::Value>& info) | 137 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
alue, const v8::PropertyCallbackInfo<v8::Value>& info) |
137 { | 138 { |
138 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 139 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
139 TestEventTargetV8Internal::indexedPropertySetter(index, value, info); | 140 TestEventTargetV8Internal::indexedPropertySetter(index, value, info); |
140 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 141 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
141 } | 142 } |
142 | 143 |
143 static void indexedPropertyDeleter(unsigned index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) | 144 static void indexedPropertyDeleter(unsigned index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) |
144 { | 145 { |
145 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); | 146 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); |
146 ExceptionCode ec = 0; | 147 ExceptionState es(info.GetIsolate()); |
147 bool result = collection->anonymousIndexedDeleter(index, ec); | 148 bool result = collection->anonymousIndexedDeleter(index, es); |
148 if (ec) { | 149 if (es.throwIfNeeded()) |
149 setDOMException(ec, info.GetIsolate()); | |
150 return; | 150 return; |
151 } | |
152 return v8SetReturnValueBool(info, result); | 151 return v8SetReturnValueBool(info, result); |
153 } | 152 } |
154 | 153 |
155 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 154 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
156 { | 155 { |
157 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 156 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
158 TestEventTargetV8Internal::indexedPropertyDeleter(index, info); | 157 TestEventTargetV8Internal::indexedPropertyDeleter(index, info); |
159 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 158 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
160 } | 159 } |
161 | 160 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 221 |
223 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Boolean>& info) | 222 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Boolean>& info) |
224 { | 223 { |
225 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
226 TestEventTargetV8Internal::namedPropertyDeleter(name, info); | 225 TestEventTargetV8Internal::namedPropertyDeleter(name, info); |
227 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
228 } | 227 } |
229 | 228 |
230 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | 229 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
231 { | 230 { |
232 ExceptionCode ec = 0; | 231 ExceptionState es(info.GetIsolate()); |
233 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); | 232 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); |
234 Vector<String> names; | 233 Vector<String> names; |
235 collection->namedPropertyEnumerator(names, ec); | 234 collection->namedPropertyEnumerator(names, es); |
236 if (ec) { | 235 if (es.throwIfNeeded()) |
237 setDOMException(ec, info.GetIsolate()); | |
238 return; | 236 return; |
239 } | |
240 v8::Handle<v8::Array> v8names = v8::Array::New(names.size()); | 237 v8::Handle<v8::Array> v8names = v8::Array::New(names.size()); |
241 for (size_t i = 0; i < names.size(); ++i) | 238 for (size_t i = 0; i < names.size(); ++i) |
242 v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i],
info.GetIsolate())); | 239 v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i],
info.GetIsolate())); |
243 v8SetReturnValue(info, v8names); | 240 v8SetReturnValue(info, v8names); |
244 } | 241 } |
245 | 242 |
246 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) | 243 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) |
247 { | 244 { |
248 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); | 245 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); |
249 AtomicString propertyName = toWebCoreAtomicString(name); | 246 AtomicString propertyName = toWebCoreAtomicString(name); |
250 ExceptionCode ec = 0; | 247 ExceptionState es(info.GetIsolate()); |
251 bool result = collection->namedPropertyQuery(propertyName, ec); | 248 bool result = collection->namedPropertyQuery(propertyName, es); |
252 if (ec) { | 249 if (es.throwIfNeeded()) |
253 setDOMException(ec, info.GetIsolate()); | |
254 return; | 250 return; |
255 } | |
256 if (!result) | 251 if (!result) |
257 return; | 252 return; |
258 v8SetReturnValueInt(info, v8::None); | 253 v8SetReturnValueInt(info, v8::None); |
259 } | 254 } |
260 | 255 |
261 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 256 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
262 { | 257 { |
263 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 258 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
264 TestEventTargetV8Internal::namedPropertyEnumerator(info); | 259 TestEventTargetV8Internal::namedPropertyEnumerator(info); |
265 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 260 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 installPerContextProperties(wrapper, impl.get(), isolate); | 340 installPerContextProperties(wrapper, impl.get(), isolate); |
346 V8DOMWrapper::associateObjectWithWrapper<V8TestEventTarget>(impl, &info, wra
pper, isolate, WrapperConfiguration::Independent); | 341 V8DOMWrapper::associateObjectWithWrapper<V8TestEventTarget>(impl, &info, wra
pper, isolate, WrapperConfiguration::Independent); |
347 return wrapper; | 342 return wrapper; |
348 } | 343 } |
349 void V8TestEventTarget::derefObject(void* object) | 344 void V8TestEventTarget::derefObject(void* object) |
350 { | 345 { |
351 fromInternalPointer(object)->deref(); | 346 fromInternalPointer(object)->deref(); |
352 } | 347 } |
353 | 348 |
354 } // namespace WebCore | 349 } // namespace WebCore |
OLD | NEW |