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

Side by Side Diff: Source/bindings/tests/results/V8TestEventTarget.cpp

Issue 121113004: Improve handling of failed integer type conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 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
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
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
OLDNEW
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/bindings/tests/results/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698