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

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

Issue 265293004: Create fewer local v8::TryCatch objects in generated bindings code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added comment 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
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 throwMinimumArityTypeError(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 unsigned index;
60 {
61 v8::TryCatch block;
62 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exception State), exceptionState);
63 }
60 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState); 64 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState);
61 if (exceptionState.throwIfNeeded()) 65 if (exceptionState.throwIfNeeded())
62 return; 66 return;
63 v8SetReturnValue(info, result.release()); 67 v8SetReturnValue(info, result.release());
64 } 68 }
65 69
66 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 70 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
67 { 71 {
68 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 72 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
69 TestInterface2V8Internal::itemMethod(info); 73 TestInterface2V8Internal::itemMethod(info);
70 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 74 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
71 } 75 }
72 76
73 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 77 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
74 { 78 {
75 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestInterface2", info.Holder(), info.GetIsolate()); 79 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestInterface2", info.Holder(), info.GetIsolate());
76 if (UNLIKELY(info.Length() < 2)) { 80 if (UNLIKELY(info.Length() < 2)) {
77 throwMinimumArityTypeError(exceptionState, 2, info.Length()); 81 throwMinimumArityTypeError(exceptionState, 2, info.Length());
78 return; 82 return;
79 } 83 }
80 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 84 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
81 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, index, toUInt32(info[0], exceptionSta te), exceptionState); 85 unsigned index;
82 TOSTRING_VOID(V8StringResource<>, value, info[1]); 86 V8StringResource<> value;
87 {
88 v8::TryCatch block;
89 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exception State), exceptionState);
90 TOSTRING_VOID_INTERNAL_RETHROW(value, info[1], block);
91 }
83 String result = impl->setItem(index, value, exceptionState); 92 String result = impl->setItem(index, value, exceptionState);
84 if (exceptionState.throwIfNeeded()) 93 if (exceptionState.throwIfNeeded())
85 return; 94 return;
86 v8SetReturnValueString(info, result, info.GetIsolate()); 95 v8SetReturnValueString(info, result, info.GetIsolate());
87 } 96 }
88 97
89 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 98 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
90 { 99 {
91 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
92 TestInterface2V8Internal::setItemMethod(info); 101 TestInterface2V8Internal::setItemMethod(info);
93 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
94 } 103 }
95 104
96 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 105 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
97 { 106 {
98 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestInterface2", info.Holder(), info.GetIsolate()); 107 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestInterface2", info.Holder(), info.GetIsolate());
99 if (UNLIKELY(info.Length() < 1)) { 108 if (UNLIKELY(info.Length() < 1)) {
100 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 109 throwMinimumArityTypeError(exceptionState, 1, info.Length());
101 return; 110 return;
102 } 111 }
103 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 112 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
104 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, index, toUInt32(info[0], exceptionSta te), exceptionState); 113 unsigned index;
114 {
115 v8::TryCatch block;
116 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exception State), exceptionState);
117 }
105 bool result = impl->deleteItem(index, exceptionState); 118 bool result = impl->deleteItem(index, exceptionState);
106 if (exceptionState.throwIfNeeded()) 119 if (exceptionState.throwIfNeeded())
107 return; 120 return;
108 v8SetReturnValueBool(info, result); 121 v8SetReturnValueBool(info, result);
109 } 122 }
110 123
111 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 124 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
112 { 125 {
113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 126 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
114 TestInterface2V8Internal::deleteItemMethod(info); 127 TestInterface2V8Internal::deleteItemMethod(info);
115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 128 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
116 } 129 }
117 130
118 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 131 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
119 { 132 {
120 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestInterface2", info.Holder(), info.GetIsolate()); 133 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestInterface2", info.Holder(), info.GetIsolate());
121 if (UNLIKELY(info.Length() < 1)) { 134 if (UNLIKELY(info.Length() < 1)) {
122 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 135 throwMinimumArityTypeError(exceptionState, 1, info.Length());
123 return; 136 return;
124 } 137 }
125 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 138 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
126 TOSTRING_VOID(V8StringResource<>, name, info[0]); 139 V8StringResource<> name;
140 {
141 TOSTRING_VOID_INTERNAL(name, info[0]);
142 }
127 RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState); 143 RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState);
128 if (exceptionState.throwIfNeeded()) 144 if (exceptionState.throwIfNeeded())
129 return; 145 return;
130 v8SetReturnValue(info, result.release()); 146 v8SetReturnValue(info, result.release());
131 } 147 }
132 148
133 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 149 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
134 { 150 {
135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 151 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
136 TestInterface2V8Internal::namedItemMethod(info); 152 TestInterface2V8Internal::namedItemMethod(info);
137 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 153 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
138 } 154 }
139 155
140 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 156 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
141 { 157 {
142 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestInterface2", info.Holder(), info.GetIsolate()); 158 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestInterface2", info.Holder(), info.GetIsolate());
143 if (UNLIKELY(info.Length() < 2)) { 159 if (UNLIKELY(info.Length() < 2)) {
144 throwMinimumArityTypeError(exceptionState, 2, info.Length()); 160 throwMinimumArityTypeError(exceptionState, 2, info.Length());
145 return; 161 return;
146 } 162 }
147 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 163 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
148 TOSTRING_VOID(V8StringResource<>, name, info[0]); 164 V8StringResource<> name;
149 TOSTRING_VOID(V8StringResource<>, value, info[1]); 165 V8StringResource<> value;
166 {
167 TOSTRING_VOID_INTERNAL(name, info[0]);
168 TOSTRING_VOID_INTERNAL(value, info[1]);
169 }
150 String result = impl->setNamedItem(name, value, exceptionState); 170 String result = impl->setNamedItem(name, value, exceptionState);
151 if (exceptionState.throwIfNeeded()) 171 if (exceptionState.throwIfNeeded())
152 return; 172 return;
153 v8SetReturnValueString(info, result, info.GetIsolate()); 173 v8SetReturnValueString(info, result, info.GetIsolate());
154 } 174 }
155 175
156 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info) 176 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)
157 { 177 {
158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 178 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
159 TestInterface2V8Internal::setNamedItemMethod(info); 179 TestInterface2V8Internal::setNamedItemMethod(info);
160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 180 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
161 } 181 }
162 182
163 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o) 183 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o)
164 { 184 {
165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestInterface2", info.Holder(), info.GetIsolate()); 185 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestInterface2", info.Holder(), info.GetIsolate());
166 if (UNLIKELY(info.Length() < 1)) { 186 if (UNLIKELY(info.Length() < 1)) {
167 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 187 throwMinimumArityTypeError(exceptionState, 1, info.Length());
168 return; 188 return;
169 } 189 }
170 TestInterface2* impl = V8TestInterface2::toNative(info.Holder()); 190 TestInterface2* impl = V8TestInterface2::toNative(info.Holder());
171 TOSTRING_VOID(V8StringResource<>, name, info[0]); 191 V8StringResource<> name;
192 {
193 TOSTRING_VOID_INTERNAL(name, info[0]);
194 }
172 bool result = impl->deleteNamedItem(name, exceptionState); 195 bool result = impl->deleteNamedItem(name, exceptionState);
173 if (exceptionState.throwIfNeeded()) 196 if (exceptionState.throwIfNeeded())
174 return; 197 return;
175 v8SetReturnValueBool(info, result); 198 v8SetReturnValueBool(info, result);
176 } 199 }
177 200
178 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info) 201 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info)
179 { 202 {
180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 203 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
181 TestInterface2V8Internal::deleteNamedItemMethod(info); 204 TestInterface2V8Internal::deleteNamedItemMethod(info);
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 fromInternalPointer(object)->deref(); 512 fromInternalPointer(object)->deref();
490 } 513 }
491 514
492 template<> 515 template<>
493 v8::Handle<v8::Value> toV8NoInline(TestInterface2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 516 v8::Handle<v8::Value> toV8NoInline(TestInterface2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
494 { 517 {
495 return toV8(impl, creationContext, isolate); 518 return toV8(impl, creationContext, isolate);
496 } 519 }
497 520
498 } // namespace WebCore 521 } // 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