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

Side by Side Diff: Source/bindings/tests/results/V8TestTypedefs.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
« no previous file with comments | « Source/bindings/tests/results/V8TestObjectPython.cpp ('k') | Source/bindings/v8/Dictionary.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, c onst v8::PropertyCallbackInfo<v8::Value>& info) 84 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, c onst v8::PropertyCallbackInfo<v8::Value>& info)
85 { 85 {
86 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 86 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
87 TestTypedefsV8Internal::unsignedLongLongAttrAttributeGetter(info); 87 TestTypedefsV8Internal::unsignedLongLongAttrAttributeGetter(info);
88 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 88 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
89 } 89 }
90 90
91 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, co nst v8::PropertyCallbackInfo<void>& info) 91 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, co nst v8::PropertyCallbackInfo<void>& info)
92 { 92 {
93 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLo ngAttr", "TestTypedefs", info.Holder(), info.GetIsolate());
93 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); 94 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
94 V8TRYCATCH_VOID(unsigned long long, cppValue, toUInt64(jsValue)); 95 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(jsValue, ex ceptionState), exceptionState);
95 imp->setUnsignedLongLongAttr(cppValue); 96 imp->setUnsignedLongLongAttr(cppValue);
96 } 97 }
97 98
98 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v 8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 99 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v 8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
99 { 100 {
100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 101 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
101 TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info); 102 TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info);
102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 103 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
103 } 104 }
104 105
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 142
142 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info) 143 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info)
143 { 144 {
144 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
145 TestTypedefsV8Internal::attrWithGetterExceptionAttributeGetter(info); 146 TestTypedefsV8Internal::attrWithGetterExceptionAttributeGetter(info);
146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
147 } 148 }
148 149
149 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 150 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
150 { 151 {
152 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithGetter Exception", "TestTypedefs", info.Holder(), info.GetIsolate());
151 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); 153 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
152 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); 154 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState);
153 imp->setAttrWithGetterException(cppValue); 155 imp->setAttrWithGetterException(cppValue);
154 } 156 }
155 157
156 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 158 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
157 { 159 {
158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 160 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
159 TestTypedefsV8Internal::attrWithGetterExceptionAttributeSetter(jsValue, info ); 161 TestTypedefsV8Internal::attrWithGetterExceptionAttributeSetter(jsValue, info );
160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 162 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
161 } 163 }
162 164
163 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info) 165 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info)
164 { 166 {
165 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); 167 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
166 v8SetReturnValueInt(info, imp->attrWithSetterException()); 168 v8SetReturnValueInt(info, imp->attrWithSetterException());
167 } 169 }
168 170
169 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info) 171 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info)
170 { 172 {
171 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 173 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
172 TestTypedefsV8Internal::attrWithSetterExceptionAttributeGetter(info); 174 TestTypedefsV8Internal::attrWithSetterExceptionAttributeGetter(info);
173 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 175 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
174 } 176 }
175 177
176 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 178 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
177 { 179 {
178 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetter Exception", "TestTypedefs", info.Holder(), info.GetIsolate()); 180 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetter Exception", "TestTypedefs", info.Holder(), info.GetIsolate());
179 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); 181 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
180 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); 182 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState);
181 imp->setAttrWithSetterException(cppValue, exceptionState); 183 imp->setAttrWithSetterException(cppValue, exceptionState);
182 exceptionState.throwIfNeeded(); 184 exceptionState.throwIfNeeded();
183 } 185 }
184 186
185 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 187 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
186 { 188 {
187 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 189 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
188 TestTypedefsV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info ); 190 TestTypedefsV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info );
189 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 191 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
190 } 192 }
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 fromInternalPointer(object)->deref(); 560 fromInternalPointer(object)->deref();
559 } 561 }
560 562
561 template<> 563 template<>
562 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 564 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
563 { 565 {
564 return toV8(impl, creationContext, isolate); 566 return toV8(impl, creationContext, isolate);
565 } 567 }
566 568
567 } // namespace WebCore 569 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObjectPython.cpp ('k') | Source/bindings/v8/Dictionary.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698