| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 namespace WebCore { | 68 namespace WebCore { |
| 69 const WrapperTypeInfo V8TestEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink
, V8TestEventTarget::domTemplate, V8TestEventTarget::derefObject, 0, V8TestEvent
Target::toEventTarget, 0, V8TestEventTarget::installPerContextEnabledMethods, &V
8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype }; | 69 const WrapperTypeInfo V8TestEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink
, V8TestEventTarget::domTemplate, V8TestEventTarget::derefObject, 0, V8TestEvent
Target::toEventTarget, 0, V8TestEventTarget::installPerContextEnabledMethods, &V
8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype }; |
| 70 | 70 |
| 71 namespace TestEventTargetV8Internal { | 71 namespace TestEventTargetV8Internal { |
| 72 | 72 |
| 73 template <typename T> void V8_USE(T) { } | 73 template <typename T> void V8_USE(T) { } |
| 74 | 74 |
| 75 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 75 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 76 { | 76 { |
| 77 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes
tEventTarget", info.Holder(), info.GetIsolate()); |
| 77 if (UNLIKELY(info.Length() < 1)) { | 78 if (UNLIKELY(info.Length() < 1)) { |
| 78 throwTypeError(ExceptionMessages::failedToExecute("item", "TestEventTarg
et", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()
); | 79 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 80 exceptionState.throwIfNeeded(); |
| 79 return; | 81 return; |
| 80 } | 82 } |
| 81 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder()); | 83 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder()); |
| 82 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[0])); | 84 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[0], exceptionState)
, exceptionState); |
| 83 v8SetReturnValue(info, imp->item(index)); | 85 v8SetReturnValue(info, imp->item(index)); |
| 84 } | 86 } |
| 85 | 87 |
| 86 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 88 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 87 { | 89 { |
| 88 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 90 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 89 TestEventTargetV8Internal::itemMethod(info); | 91 TestEventTargetV8Internal::itemMethod(info); |
| 90 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 92 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 91 } | 93 } |
| 92 | 94 |
| (...skipping 260 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 |