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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 namespace WebCore { | 67 namespace WebCore { |
68 const WrapperTypeInfo V8TestEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink
, V8TestEventTarget::domTemplate, V8TestEventTarget::derefObject, 0, V8TestEvent
Target::toEventTarget, 0, V8TestEventTarget::installPerContextEnabledMethods, &V
8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype }; | 68 const WrapperTypeInfo V8TestEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink
, V8TestEventTarget::domTemplate, V8TestEventTarget::derefObject, 0, V8TestEvent
Target::toEventTarget, 0, V8TestEventTarget::installPerContextEnabledMethods, &V
8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype }; |
69 | 69 |
70 namespace TestEventTargetV8Internal { | 70 namespace TestEventTargetV8Internal { |
71 | 71 |
72 template <typename T> void V8_USE(T) { } | 72 template <typename T> void V8_USE(T) { } |
73 | 73 |
74 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 74 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
75 { | 75 { |
| 76 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes
tEventTarget", info.Holder(), info.GetIsolate()); |
76 if (UNLIKELY(info.Length() < 1)) { | 77 if (UNLIKELY(info.Length() < 1)) { |
77 throwTypeError(ExceptionMessages::failedToExecute("item", "TestEventTarg
et", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()
); | 78 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 79 exceptionState.throwIfNeeded(); |
78 return; | 80 return; |
79 } | 81 } |
80 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder()); | 82 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder()); |
81 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[0])); | 83 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState)
, exceptionState); |
82 v8SetReturnValue(info, imp->item(index)); | 84 v8SetReturnValue(info, imp->item(index)); |
83 } | 85 } |
84 | 86 |
85 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 87 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
86 { | 88 { |
87 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 89 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
88 TestEventTargetV8Internal::itemMethod(info); | 90 TestEventTargetV8Internal::itemMethod(info); |
89 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 91 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
90 } | 92 } |
91 | 93 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 fromInternalPointer(object)->deref(); | 355 fromInternalPointer(object)->deref(); |
354 } | 356 } |
355 | 357 |
356 template<> | 358 template<> |
357 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) | 359 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) |
358 { | 360 { |
359 return toV8(impl, creationContext, isolate); | 361 return toV8(impl, creationContext, isolate); |
360 } | 362 } |
361 | 363 |
362 } // namespace WebCore | 364 } // namespace WebCore |
OLD | NEW |