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

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

Issue 946973005: IDL: Drop value conversion (V8 -> C++) macros from generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 5 years, 9 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 "V8TestInterfaceConstructor.h" 8 #include "V8TestInterfaceConstructor.h"
9 9
10 #include "bindings/core/v8/Dictionary.h" 10 #include "bindings/core/v8/Dictionary.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 54 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
55 double doubleArg; 55 double doubleArg;
56 V8StringResource<> stringArg; 56 V8StringResource<> stringArg;
57 TestInterfaceEmpty* testInterfaceEmptyArg; 57 TestInterfaceEmpty* testInterfaceEmptyArg;
58 Dictionary dictionaryArg; 58 Dictionary dictionaryArg;
59 Vector<String> sequenceStringArg; 59 Vector<String> sequenceStringArg;
60 Vector<Dictionary> sequenceDictionaryArg; 60 Vector<Dictionary> sequenceDictionaryArg;
61 Dictionary optionalDictionaryArg; 61 Dictionary optionalDictionaryArg;
62 TestInterfaceEmpty* optionalTestInterfaceEmptyArg; 62 TestInterfaceEmpty* optionalTestInterfaceEmptyArg;
63 { 63 {
64 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], excep tionState), exceptionState); 64 doubleArg = toDouble(info[0], exceptionState);
65 TOSTRING_VOID_INTERNAL(stringArg, info[1]); 65 if (exceptionState.throwIfNeeded())
66 return;
67 stringArg = info[1];
68 if (!stringArg.prepare())
69 return;
66 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[2]); 70 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[2]);
67 if (!isUndefinedOrNull(info[3]) && !info[3]->IsObject()) { 71 if (!isUndefinedOrNull(info[3]) && !info[3]->IsObject()) {
68 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an object."); 72 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an object.");
69 exceptionState.throwIfNeeded(); 73 exceptionState.throwIfNeeded();
70 return; 74 return;
71 } 75 }
72 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(dictionaryArg, Dictionary(info[3], info.GetIsolate(), exceptionState), exceptionState); 76 dictionaryArg = Dictionary(info[3], info.GetIsolate(), exceptionState);
73 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(sequenceStringArg, toImplArray<Str ing>(info[4], 5, info.GetIsolate(), exceptionState), exceptionState); 77 if (exceptionState.throwIfNeeded())
74 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(sequenceDictionaryArg, toImplArray <Dictionary>(info[5], 6, info.GetIsolate(), exceptionState), exceptionState); 78 return;
79 sequenceStringArg = toImplArray<String>(info[4], 5, info.GetIsolate(), e xceptionState);
80 if (exceptionState.throwIfNeeded())
81 return;
82 sequenceDictionaryArg = toImplArray<Dictionary>(info[5], 6, info.GetIsol ate(), exceptionState);
83 if (exceptionState.throwIfNeeded())
84 return;
75 if (!isUndefinedOrNull(info[6]) && !info[6]->IsObject()) { 85 if (!isUndefinedOrNull(info[6]) && !info[6]->IsObject()) {
76 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is not an object."); 86 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is not an object.");
77 exceptionState.throwIfNeeded(); 87 exceptionState.throwIfNeeded();
78 return; 88 return;
79 } 89 }
80 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalDictionaryArg, Dictionary( info[6], info.GetIsolate(), exceptionState), exceptionState); 90 optionalDictionaryArg = Dictionary(info[6], info.GetIsolate(), exception State);
91 if (exceptionState.throwIfNeeded())
92 return;
81 optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeChec k(info.GetIsolate(), info[7]); 93 optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeChec k(info.GetIsolate(), info[7]);
82 } 94 }
83 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 95 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
84 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 96 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
85 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 97 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
86 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, doubleArg, stringArg, testInterfaceEmptyAr g, dictionaryArg, sequenceStringArg, sequenceDictionaryArg, optionalDictionaryAr g, optionalTestInterfaceEmptyArg, exceptionState); 98 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, doubleArg, stringArg, testInterfaceEmptyAr g, dictionaryArg, sequenceStringArg, sequenceDictionaryArg, optionalDictionaryAr g, optionalTestInterfaceEmptyArg, exceptionState);
87 if (exceptionState.hadException()) { 99 if (exceptionState.hadException()) {
88 exceptionState.throwIfNeeded(); 100 exceptionState.throwIfNeeded();
89 return; 101 return;
90 } 102 }
91 v8::Local<v8::Object> wrapper = info.Holder(); 103 v8::Local<v8::Object> wrapper = info.Holder();
92 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper); 104 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper);
93 v8SetReturnValue(info, wrapper); 105 v8SetReturnValue(info, wrapper);
94 } 106 }
95 107
96 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) 108 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
97 { 109 {
98 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 110 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
99 V8StringResource<> arg; 111 V8StringResource<> arg;
100 V8StringResource<> optArg; 112 V8StringResource<> optArg;
101 { 113 {
102 TOSTRING_VOID_INTERNAL(arg, info[0]); 114 arg = info[0];
115 if (!arg.prepare())
116 return;
103 if (UNLIKELY(info.Length() <= 1)) { 117 if (UNLIKELY(info.Length() <= 1)) {
104 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 118 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
105 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate()); 119 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate());
106 Document& document = *toDocument(currentExecutionContext(info.GetIso late())); 120 Document& document = *toDocument(currentExecutionContext(info.GetIso late()));
107 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eate(scriptState, executionContext, document, arg, exceptionState); 121 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eate(scriptState, executionContext, document, arg, exceptionState);
108 if (exceptionState.hadException()) { 122 if (exceptionState.hadException()) {
109 exceptionState.throwIfNeeded(); 123 exceptionState.throwIfNeeded();
110 return; 124 return;
111 } 125 }
112 v8::Local<v8::Object> wrapper = info.Holder(); 126 v8::Local<v8::Object> wrapper = info.Holder();
113 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstr uctor::wrapperTypeInfo, wrapper); 127 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstr uctor::wrapperTypeInfo, wrapper);
114 v8SetReturnValue(info, wrapper); 128 v8SetReturnValue(info, wrapper);
115 return; 129 return;
116 } 130 }
117 TOSTRING_VOID_INTERNAL(optArg, info[1]); 131 optArg = info[1];
132 if (!optArg.prepare())
133 return;
118 } 134 }
119 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 135 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
120 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 136 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
121 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 137 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
122 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, arg, optArg, exceptionState); 138 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, arg, optArg, exceptionState);
123 if (exceptionState.hadException()) { 139 if (exceptionState.hadException()) {
124 exceptionState.throwIfNeeded(); 140 exceptionState.throwIfNeeded();
125 return; 141 return;
126 } 142 }
127 v8::Local<v8::Object> wrapper = info.Holder(); 143 v8::Local<v8::Object> wrapper = info.Holder();
128 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper); 144 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::w rapperTypeInfo, wrapper);
129 v8SetReturnValue(info, wrapper); 145 v8SetReturnValue(info, wrapper);
130 } 146 }
131 147
132 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) 148 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info)
133 { 149 {
134 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 150 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
135 V8StringResource<> arg; 151 V8StringResource<> arg;
136 V8StringResource<> arg2; 152 V8StringResource<> arg2;
137 V8StringResource<> arg3; 153 V8StringResource<> arg3;
138 { 154 {
139 TOSTRING_VOID_INTERNAL(arg, info[0]); 155 arg = info[0];
140 TOSTRING_VOID_INTERNAL(arg2, info[1]); 156 if (!arg.prepare())
141 TOSTRING_VOID_INTERNAL(arg3, info[2]); 157 return;
158 arg2 = info[1];
159 if (!arg2.prepare())
160 return;
161 arg3 = info[2];
162 if (!arg3.prepare())
163 return;
142 } 164 }
143 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 165 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
144 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 166 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
145 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 167 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
146 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, arg, arg2, arg3, exceptionState); 168 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(scr iptState, executionContext, document, arg, arg2, arg3, exceptionState);
147 if (exceptionState.hadException()) { 169 if (exceptionState.hadException()) {
148 exceptionState.throwIfNeeded(); 170 exceptionState.throwIfNeeded();
149 return; 171 return;
150 } 172 }
151 v8::Local<v8::Object> wrapper = info.Holder(); 173 v8::Local<v8::Object> wrapper = info.Holder();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 251 }
230 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 252 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
231 if (UNLIKELY(info.Length() < 1)) { 253 if (UNLIKELY(info.Length() < 1)) {
232 setMinimumArityTypeError(exceptionState, 1, info.Length()); 254 setMinimumArityTypeError(exceptionState, 1, info.Length());
233 exceptionState.throwIfNeeded(); 255 exceptionState.throwIfNeeded();
234 return; 256 return;
235 } 257 }
236 V8StringResource<> arg; 258 V8StringResource<> arg;
237 V8StringResource<> optArg; 259 V8StringResource<> optArg;
238 { 260 {
239 TOSTRING_VOID_INTERNAL(arg, info[0]); 261 arg = info[0];
262 if (!arg.prepare())
263 return;
240 if (UNLIKELY(info.Length() <= 1)) { 264 if (UNLIKELY(info.Length() <= 1)) {
241 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 265 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
242 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate()); 266 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate());
243 Document& document = *toDocument(currentExecutionContext(info.GetIso late())); 267 Document& document = *toDocument(currentExecutionContext(info.GetIso late()));
244 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eateForJSConstructor(scriptState, executionContext, document, arg, exceptionStat e); 268 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eateForJSConstructor(scriptState, executionContext, document, arg, exceptionStat e);
245 if (exceptionState.hadException()) { 269 if (exceptionState.hadException()) {
246 exceptionState.throwIfNeeded(); 270 exceptionState.throwIfNeeded();
247 return; 271 return;
248 } 272 }
249 v8::Local<v8::Object> wrapper = info.Holder(); 273 v8::Local<v8::Object> wrapper = info.Holder();
250 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstr uctorConstructor::wrapperTypeInfo, wrapper); 274 impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstr uctorConstructor::wrapperTypeInfo, wrapper);
251 v8SetReturnValue(info, wrapper); 275 v8SetReturnValue(info, wrapper);
252 return; 276 return;
253 } 277 }
254 TOSTRING_VOID_INTERNAL(optArg, info[1]); 278 optArg = info[1];
279 if (!optArg.prepare())
280 return;
255 } 281 }
256 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 282 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
257 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 283 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
258 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 284 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
259 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::createForJ SConstructor(scriptState, executionContext, document, arg, optArg, exceptionStat e); 285 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::createForJ SConstructor(scriptState, executionContext, document, arg, optArg, exceptionStat e);
260 if (exceptionState.hadException()) { 286 if (exceptionState.hadException()) {
261 exceptionState.throwIfNeeded(); 287 exceptionState.throwIfNeeded();
262 return; 288 return;
263 } 289 }
264 v8::Local<v8::Object> wrapper = info.Holder(); 290 v8::Local<v8::Object> wrapper = info.Holder();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 { 371 {
346 scriptWrappable->toImpl<TestInterfaceConstructor>()->ref(); 372 scriptWrappable->toImpl<TestInterfaceConstructor>()->ref();
347 } 373 }
348 374
349 void V8TestInterfaceConstructor::derefObject(ScriptWrappable* scriptWrappable) 375 void V8TestInterfaceConstructor::derefObject(ScriptWrappable* scriptWrappable)
350 { 376 {
351 scriptWrappable->toImpl<TestInterfaceConstructor>()->deref(); 377 scriptWrappable->toImpl<TestInterfaceConstructor>()->deref();
352 } 378 }
353 379
354 } // namespace blink 380 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698