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

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

Issue 284163002: Better arity checks for overloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Return properly 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
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 #include "V8TestInterface2.h" 8 #include "V8TestInterface2.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 const WrapperTypeInfo V8TestInterface2::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface2::domTemplate, V8TestInterface2::derefObject, 0, 0, V8TestInter face2::visitDOMWrapper, V8TestInterface2::installPerContextEnabledMethods, 0, Wr apperTypeObjectPrototype, RefCountedObject }; 45 const WrapperTypeInfo V8TestInterface2::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface2::domTemplate, V8TestInterface2::derefObject, 0, 0, V8TestInter face2::visitDOMWrapper, V8TestInterface2::installPerContextEnabledMethods, 0, Wr apperTypeObjectPrototype, RefCountedObject };
46 46
47 namespace TestInterface2V8Internal { 47 namespace TestInterface2V8Internal {
48 48
49 template <typename T> void V8_USE(T) { } 49 template <typename T> void V8_USE(T) { }
50 50
51 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 51 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
52 { 52 {
53 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes tInterface2", info.Holder(), info.GetIsolate()); 53 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes tInterface2", info.Holder(), info.GetIsolate());
54 if (UNLIKELY(info.Length() < 1)) { 54 if (UNLIKELY(info.Length() < 1)) {
55 throwArityTypeError(exceptionState, 1, info.Length()); 55 throwMinimumArityTypeError(exceptionState, 1, info.Length());
56 return; 56 return;
57 } 57 }
58 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 58 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
59 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, index, toUInt32(info[0], exceptionSta te), exceptionState); 59 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, index, toUInt32(info[0], exceptionSta te), exceptionState);
60 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState); 60 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState);
61 if (exceptionState.throwIfNeeded()) 61 if (exceptionState.throwIfNeeded())
62 return; 62 return;
63 v8SetReturnValue(info, result.release()); 63 v8SetReturnValue(info, result.release());
64 } 64 }
65 65
66 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 66 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
67 { 67 {
68 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 68 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
69 TestInterface2V8Internal::itemMethod(info); 69 TestInterface2V8Internal::itemMethod(info);
70 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 70 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
71 } 71 }
72 72
73 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 73 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
74 { 74 {
75 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestInterface2", info.Holder(), info.GetIsolate()); 75 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestInterface2", info.Holder(), info.GetIsolate());
76 if (UNLIKELY(info.Length() < 2)) { 76 if (UNLIKELY(info.Length() < 2)) {
77 throwArityTypeError(exceptionState, 2, info.Length()); 77 throwMinimumArityTypeError(exceptionState, 2, info.Length());
78 return; 78 return;
79 } 79 }
80 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 80 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
81 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, index, toUInt32(info[0], exceptionSta te), exceptionState); 81 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, index, toUInt32(info[0], exceptionSta te), exceptionState);
82 TOSTRING_VOID(V8StringResource<>, value, info[1]); 82 TOSTRING_VOID(V8StringResource<>, value, info[1]);
83 String result = impl->setItem(index, value, exceptionState); 83 String result = impl->setItem(index, value, exceptionState);
84 if (exceptionState.throwIfNeeded()) 84 if (exceptionState.throwIfNeeded())
85 return; 85 return;
86 v8SetReturnValueString(info, result, info.GetIsolate()); 86 v8SetReturnValueString(info, result, info.GetIsolate());
87 } 87 }
88 88
89 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 89 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
90 { 90 {
91 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 91 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
92 TestInterface2V8Internal::setItemMethod(info); 92 TestInterface2V8Internal::setItemMethod(info);
93 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 93 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
94 } 94 }
95 95
96 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 96 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
97 { 97 {
98 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestInterface2", info.Holder(), info.GetIsolate()); 98 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestInterface2", info.Holder(), info.GetIsolate());
99 if (UNLIKELY(info.Length() < 1)) { 99 if (UNLIKELY(info.Length() < 1)) {
100 throwArityTypeError(exceptionState, 1, info.Length()); 100 throwMinimumArityTypeError(exceptionState, 1, info.Length());
101 return; 101 return;
102 } 102 }
103 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 103 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
104 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, index, toUInt32(info[0], exceptionSta te), exceptionState); 104 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, index, toUInt32(info[0], exceptionSta te), exceptionState);
105 bool result = impl->deleteItem(index, exceptionState); 105 bool result = impl->deleteItem(index, exceptionState);
106 if (exceptionState.throwIfNeeded()) 106 if (exceptionState.throwIfNeeded())
107 return; 107 return;
108 v8SetReturnValueBool(info, result); 108 v8SetReturnValueBool(info, result);
109 } 109 }
110 110
111 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 111 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
112 { 112 {
113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
114 TestInterface2V8Internal::deleteItemMethod(info); 114 TestInterface2V8Internal::deleteItemMethod(info);
115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
116 } 116 }
117 117
118 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 118 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
119 { 119 {
120 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestInterface2", info.Holder(), info.GetIsolate()); 120 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestInterface2", info.Holder(), info.GetIsolate());
121 if (UNLIKELY(info.Length() < 1)) { 121 if (UNLIKELY(info.Length() < 1)) {
122 throwArityTypeError(exceptionState, 1, info.Length()); 122 throwMinimumArityTypeError(exceptionState, 1, info.Length());
123 return; 123 return;
124 } 124 }
125 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 125 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
126 TOSTRING_VOID(V8StringResource<>, name, info[0]); 126 TOSTRING_VOID(V8StringResource<>, name, info[0]);
127 RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState); 127 RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState);
128 if (exceptionState.throwIfNeeded()) 128 if (exceptionState.throwIfNeeded())
129 return; 129 return;
130 v8SetReturnValue(info, result.release()); 130 v8SetReturnValue(info, result.release());
131 } 131 }
132 132
133 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 133 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
134 { 134 {
135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
136 TestInterface2V8Internal::namedItemMethod(info); 136 TestInterface2V8Internal::namedItemMethod(info);
137 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 137 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
138 } 138 }
139 139
140 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 140 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
141 { 141 {
142 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestInterface2", info.Holder(), info.GetIsolate()); 142 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestInterface2", info.Holder(), info.GetIsolate());
143 if (UNLIKELY(info.Length() < 2)) { 143 if (UNLIKELY(info.Length() < 2)) {
144 throwArityTypeError(exceptionState, 2, info.Length()); 144 throwMinimumArityTypeError(exceptionState, 2, info.Length());
145 return; 145 return;
146 } 146 }
147 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 147 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
148 TOSTRING_VOID(V8StringResource<>, name, info[0]); 148 TOSTRING_VOID(V8StringResource<>, name, info[0]);
149 TOSTRING_VOID(V8StringResource<>, value, info[1]); 149 TOSTRING_VOID(V8StringResource<>, value, info[1]);
150 String result = impl->setNamedItem(name, value, exceptionState); 150 String result = impl->setNamedItem(name, value, exceptionState);
151 if (exceptionState.throwIfNeeded()) 151 if (exceptionState.throwIfNeeded())
152 return; 152 return;
153 v8SetReturnValueString(info, result, info.GetIsolate()); 153 v8SetReturnValueString(info, result, info.GetIsolate());
154 } 154 }
155 155
156 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info) 156 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)
157 { 157 {
158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
159 TestInterface2V8Internal::setNamedItemMethod(info); 159 TestInterface2V8Internal::setNamedItemMethod(info);
160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
161 } 161 }
162 162
163 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o) 163 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o)
164 { 164 {
165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestInterface2", info.Holder(), info.GetIsolate()); 165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestInterface2", info.Holder(), info.GetIsolate());
166 if (UNLIKELY(info.Length() < 1)) { 166 if (UNLIKELY(info.Length() < 1)) {
167 throwArityTypeError(exceptionState, 1, info.Length()); 167 throwMinimumArityTypeError(exceptionState, 1, info.Length());
168 return; 168 return;
169 } 169 }
170 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 170 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
171 TOSTRING_VOID(V8StringResource<>, name, info[0]); 171 TOSTRING_VOID(V8StringResource<>, name, info[0]);
172 bool result = impl->deleteNamedItem(name, exceptionState); 172 bool result = impl->deleteNamedItem(name, exceptionState);
173 if (exceptionState.throwIfNeeded()) 173 if (exceptionState.throwIfNeeded())
174 return; 174 return;
175 v8SetReturnValueBool(info, result); 175 v8SetReturnValueBool(info, result);
176 } 176 }
177 177
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 fromInternalPointer(object)->deref(); 489 fromInternalPointer(object)->deref();
490 } 490 }
491 491
492 template<> 492 template<>
493 v8::Handle<v8::Value> toV8NoInline(TestInterface2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 493 v8::Handle<v8::Value> toV8NoInline(TestInterface2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
494 { 494 {
495 return toV8(impl, creationContext, isolate); 495 return toV8(impl, creationContext, isolate);
496 } 496 }
497 497
498 } // namespace WebCore 498 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | Source/bindings/tests/results/V8TestInterfaceConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698