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

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

Issue 304223007: Use auto-rethrowing v8::TryCatch variant (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 // 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 50 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
51 { 51 {
52 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes tInterface2", info.Holder(), info.GetIsolate()); 52 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes tInterface2", info.Holder(), info.GetIsolate());
53 if (UNLIKELY(info.Length() < 1)) { 53 if (UNLIKELY(info.Length() < 1)) {
54 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 54 throwMinimumArityTypeError(exceptionState, 1, info.Length());
55 return; 55 return;
56 } 56 }
57 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 57 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
58 unsigned index; 58 unsigned index;
59 { 59 {
60 v8::TryCatch block; 60 V8TryPropagate block;
61 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exception State), exceptionState); 61 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exception State), exceptionState);
62 } 62 }
63 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState); 63 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState);
64 if (exceptionState.hadException()) { 64 if (exceptionState.hadException()) {
65 exceptionState.throwIfNeeded(); 65 exceptionState.throwIfNeeded();
66 return; 66 return;
67 } 67 }
68 v8SetReturnValue(info, result.release()); 68 v8SetReturnValue(info, result.release());
69 } 69 }
70 70
71 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 71 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
72 { 72 {
73 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 73 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
74 TestInterface2V8Internal::itemMethod(info); 74 TestInterface2V8Internal::itemMethod(info);
75 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 75 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
76 } 76 }
77 77
78 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 78 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
79 { 79 {
80 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestInterface2", info.Holder(), info.GetIsolate()); 80 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestInterface2", info.Holder(), info.GetIsolate());
81 if (UNLIKELY(info.Length() < 2)) { 81 if (UNLIKELY(info.Length() < 2)) {
82 throwMinimumArityTypeError(exceptionState, 2, info.Length()); 82 throwMinimumArityTypeError(exceptionState, 2, info.Length());
83 return; 83 return;
84 } 84 }
85 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 85 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
86 unsigned index; 86 unsigned index;
87 V8StringResource<> value; 87 V8StringResource<> value;
88 { 88 {
89 v8::TryCatch block; 89 V8TryPropagate block;
90 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exception State), exceptionState); 90 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exception State), exceptionState);
91 TOSTRING_VOID_INTERNAL(value, info[1]); 91 TOSTRING_VOID_INTERNAL(value, info[1]);
92 } 92 }
93 String result = impl->setItem(index, value, exceptionState); 93 String result = impl->setItem(index, value, exceptionState);
94 if (exceptionState.hadException()) { 94 if (exceptionState.hadException()) {
95 exceptionState.throwIfNeeded(); 95 exceptionState.throwIfNeeded();
96 return; 96 return;
97 } 97 }
98 v8SetReturnValueString(info, result, info.GetIsolate()); 98 v8SetReturnValueString(info, result, info.GetIsolate());
99 } 99 }
100 100
101 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 101 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
102 { 102 {
103 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 103 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
104 TestInterface2V8Internal::setItemMethod(info); 104 TestInterface2V8Internal::setItemMethod(info);
105 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 105 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
106 } 106 }
107 107
108 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 108 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
109 { 109 {
110 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestInterface2", info.Holder(), info.GetIsolate()); 110 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestInterface2", info.Holder(), info.GetIsolate());
111 if (UNLIKELY(info.Length() < 1)) { 111 if (UNLIKELY(info.Length() < 1)) {
112 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 112 throwMinimumArityTypeError(exceptionState, 1, info.Length());
113 return; 113 return;
114 } 114 }
115 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 115 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
116 unsigned index; 116 unsigned index;
117 { 117 {
118 v8::TryCatch block; 118 V8TryPropagate block;
119 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exception State), exceptionState); 119 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exception State), exceptionState);
120 } 120 }
121 bool result = impl->deleteItem(index, exceptionState); 121 bool result = impl->deleteItem(index, exceptionState);
122 if (exceptionState.hadException()) { 122 if (exceptionState.hadException()) {
123 exceptionState.throwIfNeeded(); 123 exceptionState.throwIfNeeded();
124 return; 124 return;
125 } 125 }
126 v8SetReturnValueBool(info, result); 126 v8SetReturnValueBool(info, result);
127 } 127 }
128 128
129 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 129 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
130 { 130 {
131 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 131 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
132 TestInterface2V8Internal::deleteItemMethod(info); 132 TestInterface2V8Internal::deleteItemMethod(info);
133 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 133 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
134 } 134 }
135 135
136 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 136 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
137 { 137 {
138 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestInterface2", info.Holder(), info.GetIsolate()); 138 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestInterface2", info.Holder(), info.GetIsolate());
139 if (UNLIKELY(info.Length() < 1)) { 139 if (UNLIKELY(info.Length() < 1)) {
140 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 140 throwMinimumArityTypeError(exceptionState, 1, info.Length());
141 return; 141 return;
142 } 142 }
143 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 143 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
144 V8StringResource<> name; 144 V8StringResource<> name;
145 { 145 {
146 TOSTRING_VOID_INTERNAL_NOTRYCATCH(name, info[0]); 146 TOSTRING_VOID_INTERNAL(name, info[0]);
147 } 147 }
148 RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState); 148 RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState);
149 if (exceptionState.hadException()) { 149 if (exceptionState.hadException()) {
150 exceptionState.throwIfNeeded(); 150 exceptionState.throwIfNeeded();
151 return; 151 return;
152 } 152 }
153 v8SetReturnValue(info, result.release()); 153 v8SetReturnValue(info, result.release());
154 } 154 }
155 155
156 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 156 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
157 { 157 {
158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
159 TestInterface2V8Internal::namedItemMethod(info); 159 TestInterface2V8Internal::namedItemMethod(info);
160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
161 } 161 }
162 162
163 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 163 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
164 { 164 {
165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestInterface2", info.Holder(), info.GetIsolate()); 165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestInterface2", info.Holder(), info.GetIsolate());
166 if (UNLIKELY(info.Length() < 2)) { 166 if (UNLIKELY(info.Length() < 2)) {
167 throwMinimumArityTypeError(exceptionState, 2, info.Length()); 167 throwMinimumArityTypeError(exceptionState, 2, info.Length());
168 return; 168 return;
169 } 169 }
170 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 170 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
171 V8StringResource<> name; 171 V8StringResource<> name;
172 V8StringResource<> value; 172 V8StringResource<> value;
173 { 173 {
174 TOSTRING_VOID_INTERNAL_NOTRYCATCH(name, info[0]); 174 TOSTRING_VOID_INTERNAL(name, info[0]);
175 TOSTRING_VOID_INTERNAL_NOTRYCATCH(value, info[1]); 175 TOSTRING_VOID_INTERNAL(value, info[1]);
176 } 176 }
177 String result = impl->setNamedItem(name, value, exceptionState); 177 String result = impl->setNamedItem(name, value, exceptionState);
178 if (exceptionState.hadException()) { 178 if (exceptionState.hadException()) {
179 exceptionState.throwIfNeeded(); 179 exceptionState.throwIfNeeded();
180 return; 180 return;
181 } 181 }
182 v8SetReturnValueString(info, result, info.GetIsolate()); 182 v8SetReturnValueString(info, result, info.GetIsolate());
183 } 183 }
184 184
185 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info) 185 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)
186 { 186 {
187 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 187 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
188 TestInterface2V8Internal::setNamedItemMethod(info); 188 TestInterface2V8Internal::setNamedItemMethod(info);
189 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 189 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
190 } 190 }
191 191
192 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o) 192 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o)
193 { 193 {
194 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestInterface2", info.Holder(), info.GetIsolate()); 194 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestInterface2", info.Holder(), info.GetIsolate());
195 if (UNLIKELY(info.Length() < 1)) { 195 if (UNLIKELY(info.Length() < 1)) {
196 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 196 throwMinimumArityTypeError(exceptionState, 1, info.Length());
197 return; 197 return;
198 } 198 }
199 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 199 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
200 V8StringResource<> name; 200 V8StringResource<> name;
201 { 201 {
202 TOSTRING_VOID_INTERNAL_NOTRYCATCH(name, info[0]); 202 TOSTRING_VOID_INTERNAL(name, info[0]);
203 } 203 }
204 bool result = impl->deleteNamedItem(name, exceptionState); 204 bool result = impl->deleteNamedItem(name, exceptionState);
205 if (exceptionState.hadException()) { 205 if (exceptionState.hadException()) {
206 exceptionState.throwIfNeeded(); 206 exceptionState.throwIfNeeded();
207 return; 207 return;
208 } 208 }
209 v8SetReturnValueBool(info, result); 209 v8SetReturnValueBool(info, result);
210 } 210 }
211 211
212 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info) 212 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info)
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 fromInternalPointer(object)->deref(); 523 fromInternalPointer(object)->deref();
524 } 524 }
525 525
526 template<> 526 template<>
527 v8::Handle<v8::Value> toV8NoInline(TestInterface2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 527 v8::Handle<v8::Value> toV8NoInline(TestInterface2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
528 { 528 {
529 return toV8(impl, creationContext, isolate); 529 return toV8(impl, creationContext, isolate);
530 } 530 }
531 531
532 } // namespace WebCore 532 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698