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

Side by Side Diff: Source/bindings/tests/results/V8TestInterface.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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 static void supplementalMethod4MethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 672 static void supplementalMethod4MethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
673 { 673 {
674 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 674 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
675 TestInterfaceV8Internal::supplementalMethod4Method(info); 675 TestInterfaceV8Internal::supplementalMethod4Method(info);
676 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 676 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
677 } 677 }
678 #endif // ENABLE(Condition11) || ENABLE(Condition12) 678 #endif // ENABLE(Condition11) || ENABLE(Condition12)
679 679
680 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 680 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
681 { 681 {
682 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rface", info.Holder(), info.GetIsolate());
682 if (UNLIKELY(info.Length() < 1)) { 683 if (UNLIKELY(info.Length() < 1)) {
683 throwTypeError(ExceptionMessages::failedToConstruct("TestInterface", Exc eptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); 684 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
685 exceptionState.throwIfNeeded();
684 return; 686 return;
685 } 687 }
686 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rface", info.Holder(), info.GetIsolate());
687 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]); 688 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]);
688 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]); 689 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]);
689 ExecutionContext* context = getExecutionContext(); 690 ExecutionContext* context = getExecutionContext();
690 RefPtr<TestInterface> impl = TestInterface::create(context, str1, str2, exce ptionState); 691 RefPtr<TestInterface> impl = TestInterface::create(context, str1, str2, exce ptionState);
691 v8::Handle<v8::Object> wrapper = info.Holder(); 692 v8::Handle<v8::Object> wrapper = info.Holder();
692 if (exceptionState.throwIfNeeded()) 693 if (exceptionState.throwIfNeeded())
693 return; 694 return;
694 695
695 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface>(impl.release(), &V 8TestInterface::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguratio n::Dependent); 696 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface>(impl.release(), &V 8TestInterface::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguratio n::Dependent);
696 v8SetReturnValue(info, wrapper); 697 v8SetReturnValue(info, wrapper);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 } 982 }
982 983
983 template<> 984 template<>
984 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 985 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
985 { 986 {
986 return toV8(impl, creationContext, isolate); 987 return toV8(impl, creationContext, isolate);
987 } 988 }
988 989
989 } // namespace WebCore 990 } // namespace WebCore
990 #endif // ENABLE(Condition1) || ENABLE(Condition2) 991 #endif // ENABLE(Condition1) || ENABLE(Condition2)
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestEventTarget.cpp ('k') | Source/bindings/tests/results/V8TestInterfaceCheckSecurity.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698