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

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

Issue 265753003: Add support for type checking of floating point attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove nop [TypeChecking=Unrestricted] Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/modules/mediasource/SourceBuffer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 static void doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 98 static void doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
99 { 99 {
100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
101 TestInterfaceImplementationV8Internal::doubleAttributeAttributeGetter(info); 101 TestInterfaceImplementationV8Internal::doubleAttributeAttributeGetter(info);
102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
103 } 103 }
104 104
105 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::PropertyCallbackInfo<void>& info) 105 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::PropertyCallbackInfo<void>& info)
106 { 106 {
107 v8::Handle<v8::Object> holder = info.Holder(); 107 v8::Handle<v8::Object> holder = info.Holder();
108 ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribut e", "TestInterface", holder, info.GetIsolate());
108 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); 109 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
109 TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue())) ; 110 TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue())) ;
111 if (!std::isfinite(cppValue)) {
112 exceptionState.throwTypeError("The provided double value is non-finite." );
113 exceptionState.throwIfNeeded();
114 return;
115 }
110 impl->setDoubleAttribute(cppValue); 116 impl->setDoubleAttribute(cppValue);
111 } 117 }
112 118
113 static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 119 static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
114 { 120 {
115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 121 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
116 TestInterfaceImplementationV8Internal::doubleAttributeAttributeSetter(v8Valu e, info); 122 TestInterfaceImplementationV8Internal::doubleAttributeAttributeSetter(v8Valu e, info);
117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 123 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
118 } 124 }
119 125
120 static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info) 126 static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info)
121 { 127 {
122 v8::Handle<v8::Object> holder = info.Holder(); 128 v8::Handle<v8::Object> holder = info.Holder();
123 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); 129 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
124 v8SetReturnValue(info, impl->floatAttribute()); 130 v8SetReturnValue(info, impl->floatAttribute());
125 } 131 }
126 132
127 static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info) 133 static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info)
128 { 134 {
129 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
130 TestInterfaceImplementationV8Internal::floatAttributeAttributeGetter(info); 136 TestInterfaceImplementationV8Internal::floatAttributeAttributeGetter(info);
131 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 137 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
132 } 138 }
133 139
134 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::PropertyCallbackInfo<void>& info) 140 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::PropertyCallbackInfo<void>& info)
135 { 141 {
136 v8::Handle<v8::Object> holder = info.Holder(); 142 v8::Handle<v8::Object> holder = info.Holder();
143 ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute ", "TestInterface", holder, info.GetIsolate());
137 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); 144 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
138 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); 145 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue()));
146 if (!std::isfinite(cppValue)) {
147 exceptionState.throwTypeError("The provided float value is non-finite.") ;
148 exceptionState.throwIfNeeded();
149 return;
150 }
139 impl->setFloatAttribute(cppValue); 151 impl->setFloatAttribute(cppValue);
140 } 152 }
141 153
142 static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 154 static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
143 { 155 {
144 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 156 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
145 TestInterfaceImplementationV8Internal::floatAttributeAttributeSetter(v8Value , info); 157 TestInterfaceImplementationV8Internal::floatAttributeAttributeSetter(v8Value , info);
146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 158 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
147 } 159 }
148 160
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 } 1552 }
1541 1553
1542 template<> 1554 template<>
1543 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle <v8::Object> creationContext, v8::Isolate* isolate) 1555 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle <v8::Object> creationContext, v8::Isolate* isolate)
1544 { 1556 {
1545 return toV8(impl, creationContext, isolate); 1557 return toV8(impl, creationContext, isolate);
1546 } 1558 }
1547 1559
1548 } // namespace WebCore 1560 } // namespace WebCore
1549 #endif // ENABLE(CONDITION) 1561 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/modules/mediasource/SourceBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698