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

Side by Side Diff: Source/bindings/tests/results/core/V8TestTypedefs.cpp

Issue 1125683002: Avoid nearly identical toImplArray() and toImplHeapArray() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 "V8TestTypedefs.h" 8 #include "V8TestTypedefs.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 static void voidMethodArrayOfLongsArgMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) 106 static void voidMethodArrayOfLongsArgMethod(const v8::FunctionCallbackInfo<v8::V alue>& info)
107 { 107 {
108 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodA rrayOfLongsArg", "TestTypedefs", info.Holder(), info.GetIsolate()); 108 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodA rrayOfLongsArg", "TestTypedefs", info.Holder(), info.GetIsolate());
109 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder()); 109 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
110 Vector<int> arrayOfLongsArg; 110 Vector<int> arrayOfLongsArg;
111 { 111 {
112 if (UNLIKELY(info.Length() <= 0)) { 112 if (UNLIKELY(info.Length() <= 0)) {
113 impl->voidMethodArrayOfLongsArg(); 113 impl->voidMethodArrayOfLongsArg();
114 return; 114 return;
115 } 115 }
116 arrayOfLongsArg = toImplArray<int>(info[0], 1, info.GetIsolate(), except ionState); 116 arrayOfLongsArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate() , exceptionState);
117 if (exceptionState.throwIfNeeded()) 117 if (exceptionState.throwIfNeeded())
118 return; 118 return;
119 } 119 }
120 impl->voidMethodArrayOfLongsArg(arrayOfLongsArg); 120 impl->voidMethodArrayOfLongsArg(arrayOfLongsArg);
121 } 121 }
122 122
123 static void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info) 123 static void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info)
124 { 124 {
125 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 125 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
126 TestTypedefsV8Internal::voidMethodArrayOfLongsArgMethod(info); 126 TestTypedefsV8Internal::voidMethodArrayOfLongsArgMethod(info);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 { 240 {
241 ExceptionState exceptionState(ExceptionState::ExecutionContext, "arrayOfStri ngsMethodArrayOfStringsArg", "TestTypedefs", info.Holder(), info.GetIsolate()); 241 ExceptionState exceptionState(ExceptionState::ExecutionContext, "arrayOfStri ngsMethodArrayOfStringsArg", "TestTypedefs", info.Holder(), info.GetIsolate());
242 if (UNLIKELY(info.Length() < 1)) { 242 if (UNLIKELY(info.Length() < 1)) {
243 setMinimumArityTypeError(exceptionState, 1, info.Length()); 243 setMinimumArityTypeError(exceptionState, 1, info.Length());
244 exceptionState.throwIfNeeded(); 244 exceptionState.throwIfNeeded();
245 return; 245 return;
246 } 246 }
247 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder()); 247 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
248 Vector<String> arrayOfStringsArg; 248 Vector<String> arrayOfStringsArg;
249 { 249 {
250 arrayOfStringsArg = toImplArray<String>(info[0], 1, info.GetIsolate(), e xceptionState); 250 arrayOfStringsArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsol ate(), exceptionState);
251 if (exceptionState.throwIfNeeded()) 251 if (exceptionState.throwIfNeeded())
252 return; 252 return;
253 } 253 }
254 v8SetReturnValue(info, toV8(impl->arrayOfStringsMethodArrayOfStringsArg(arra yOfStringsArg), info.Holder(), info.GetIsolate())); 254 v8SetReturnValue(info, toV8(impl->arrayOfStringsMethodArrayOfStringsArg(arra yOfStringsArg), info.Holder(), info.GetIsolate()));
255 } 255 }
256 256
257 static void arrayOfStringsMethodArrayOfStringsArgMethodCallback(const v8::Functi onCallbackInfo<v8::Value>& info) 257 static void arrayOfStringsMethodArrayOfStringsArgMethodCallback(const v8::Functi onCallbackInfo<v8::Value>& info)
258 { 258 {
259 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 259 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
260 TestTypedefsV8Internal::arrayOfStringsMethodArrayOfStringsArgMethod(info); 260 TestTypedefsV8Internal::arrayOfStringsMethodArrayOfStringsArgMethod(info);
261 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 261 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
262 } 262 }
263 263
264 static void stringArrayMethodStringArrayArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 264 static void stringArrayMethodStringArrayArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
265 { 265 {
266 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray MethodStringArrayArg", "TestTypedefs", info.Holder(), info.GetIsolate()); 266 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray MethodStringArrayArg", "TestTypedefs", info.Holder(), info.GetIsolate());
267 if (UNLIKELY(info.Length() < 1)) { 267 if (UNLIKELY(info.Length() < 1)) {
268 setMinimumArityTypeError(exceptionState, 1, info.Length()); 268 setMinimumArityTypeError(exceptionState, 1, info.Length());
269 exceptionState.throwIfNeeded(); 269 exceptionState.throwIfNeeded();
270 return; 270 return;
271 } 271 }
272 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder()); 272 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
273 Vector<String> stringArrayArg; 273 Vector<String> stringArrayArg;
274 { 274 {
275 stringArrayArg = toImplArray<String>(info[0], 1, info.GetIsolate(), exce ptionState); 275 stringArrayArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate (), exceptionState);
276 if (exceptionState.throwIfNeeded()) 276 if (exceptionState.throwIfNeeded())
277 return; 277 return;
278 } 278 }
279 v8SetReturnValue(info, toV8(impl->stringArrayMethodStringArrayArg(stringArra yArg), info.Holder(), info.GetIsolate())); 279 v8SetReturnValue(info, toV8(impl->stringArrayMethodStringArrayArg(stringArra yArg), info.Holder(), info.GetIsolate()));
280 } 280 }
281 281
282 static void stringArrayMethodStringArrayArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 282 static void stringArrayMethodStringArrayArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
283 { 283 {
284 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 284 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
285 TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethod(info); 285 TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethod(info);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 { 385 {
386 scriptWrappable->toImpl<TestTypedefs>()->ref(); 386 scriptWrappable->toImpl<TestTypedefs>()->ref();
387 } 387 }
388 388
389 void V8TestTypedefs::derefObject(ScriptWrappable* scriptWrappable) 389 void V8TestTypedefs::derefObject(ScriptWrappable* scriptWrappable)
390 { 390 {
391 scriptWrappable->toImpl<TestTypedefs>()->deref(); 391 scriptWrappable->toImpl<TestTypedefs>()->deref();
392 } 392 }
393 393
394 } // namespace blink 394 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/V8TestObject.cpp ('k') | Source/modules/cachestorage/CacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698