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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp

Issue 2460563002: [Bindings] Reformat methods.cpp.tmpl (2/4) (Closed)
Patch Set: Rebase Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
index ddba15c8e0e509590759c607e0c47dd1368fa680..16a2d16c1a59f43e0801a595790e1d76b46ae8e6 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
@@ -54,172 +54,168 @@ static_assert(
namespace TestInterfaceConstructorV8Internal {
-static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
+ ScriptState* scriptState = ScriptState::forReceiverObject(info);
- ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
- Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
- TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, exceptionState);
- if (exceptionState.hadException()) {
- return;
- }
- v8::Local<v8::Object> wrapper = info.Holder();
- wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper);
- v8SetReturnValue(info, wrapper);
+ ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
+ Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
+ TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, exceptionState);
+ if (exceptionState.hadException()) {
+ return;
+ }
+ v8::Local<v8::Object> wrapper = info.Holder();
+ wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper);
+ v8SetReturnValue(info, wrapper);
}
-static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
-
- double doubleArg;
- V8StringResource<> stringArg;
- TestInterfaceEmpty* testInterfaceEmptyArg;
- Dictionary dictionaryArg;
- Vector<String> sequenceStringArg;
- Vector<Dictionary> sequenceDictionaryArg;
- HeapVector<LongOrTestDictionary> sequenceLongOrTestDictionaryArg;
- Dictionary optionalDictionaryArg;
- TestInterfaceEmpty* optionalTestInterfaceEmptyArg;
- doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.hadException())
- return;
+static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
+ ScriptState* scriptState = ScriptState::forReceiverObject(info);
+
+ double doubleArg;
+ V8StringResource<> stringArg;
+ TestInterfaceEmpty* testInterfaceEmptyArg;
+ Dictionary dictionaryArg;
+ Vector<String> sequenceStringArg;
+ Vector<Dictionary> sequenceDictionaryArg;
+ HeapVector<LongOrTestDictionary> sequenceLongOrTestDictionaryArg;
+ Dictionary optionalDictionaryArg;
+ TestInterfaceEmpty* optionalTestInterfaceEmptyArg;
+ doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState);
+ if (exceptionState.hadException())
+ return;
- stringArg = info[1];
- if (!stringArg.prepare())
- return;
+ stringArg = info[1];
+ if (!stringArg.prepare())
+ return;
- testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[2]);
- if (!testInterfaceEmptyArg) {
- exceptionState.throwTypeError("parameter 3 is not of type 'TestInterfaceEmpty'.");
+ testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[2]);
+ if (!testInterfaceEmptyArg) {
+ exceptionState.throwTypeError("parameter 3 is not of type 'TestInterfaceEmpty'.");
- return;
- }
+ return;
+ }
- if (!isUndefinedOrNull(info[3]) && !info[3]->IsObject()) {
- exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an object.");
+ if (!isUndefinedOrNull(info[3]) && !info[3]->IsObject()) {
+ exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an object.");
- return;
- }
- dictionaryArg = Dictionary(info[3], info.GetIsolate(), exceptionState);
- if (exceptionState.hadException())
- return;
+ return;
+ }
+ dictionaryArg = Dictionary(info[3], info.GetIsolate(), exceptionState);
+ if (exceptionState.hadException())
+ return;
- sequenceStringArg = toImplArray<Vector<String>>(info[4], 5, info.GetIsolate(), exceptionState);
- if (exceptionState.hadException())
- return;
+ sequenceStringArg = toImplArray<Vector<String>>(info[4], 5, info.GetIsolate(), exceptionState);
+ if (exceptionState.hadException())
+ return;
- sequenceDictionaryArg = toImplArray<Vector<Dictionary>>(info[5], 6, info.GetIsolate(), exceptionState);
- if (exceptionState.hadException())
- return;
+ sequenceDictionaryArg = toImplArray<Vector<Dictionary>>(info[5], 6, info.GetIsolate(), exceptionState);
+ if (exceptionState.hadException())
+ return;
- sequenceLongOrTestDictionaryArg = toImplArray<HeapVector<LongOrTestDictionary>>(info[6], 7, info.GetIsolate(), exceptionState);
- if (exceptionState.hadException())
- return;
+ sequenceLongOrTestDictionaryArg = toImplArray<HeapVector<LongOrTestDictionary>>(info[6], 7, info.GetIsolate(), exceptionState);
+ if (exceptionState.hadException())
+ return;
- if (!isUndefinedOrNull(info[7]) && !info[7]->IsObject()) {
- exceptionState.throwTypeError("parameter 8 ('optionalDictionaryArg') is not an object.");
+ if (!isUndefinedOrNull(info[7]) && !info[7]->IsObject()) {
+ exceptionState.throwTypeError("parameter 8 ('optionalDictionaryArg') is not an object.");
- return;
- }
- optionalDictionaryArg = Dictionary(info[7], info.GetIsolate(), exceptionState);
- if (exceptionState.hadException())
- return;
+ return;
+ }
+ optionalDictionaryArg = Dictionary(info[7], info.GetIsolate(), exceptionState);
+ if (exceptionState.hadException())
+ return;
- optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[8]);
- if (!optionalTestInterfaceEmptyArg) {
- exceptionState.throwTypeError("parameter 9 is not of type 'TestInterfaceEmpty'.");
+ optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[8]);
+ if (!optionalTestInterfaceEmptyArg) {
+ exceptionState.throwTypeError("parameter 9 is not of type 'TestInterfaceEmpty'.");
- return;
- }
+ return;
+ }
- ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
- Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
- TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequenceStringArg, sequenceDictionaryArg, sequenceLongOrTestDictionaryArg, optionalDictionaryArg, optionalTestInterfaceEmptyArg, exceptionState);
- if (exceptionState.hadException()) {
- return;
- }
- v8::Local<v8::Object> wrapper = info.Holder();
- wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper);
- v8SetReturnValue(info, wrapper);
+ ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
+ Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
+ TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequenceStringArg, sequenceDictionaryArg, sequenceLongOrTestDictionaryArg, optionalDictionaryArg, optionalTestInterfaceEmptyArg, exceptionState);
+ if (exceptionState.hadException()) {
+ return;
+ }
+ v8::Local<v8::Object> wrapper = info.Holder();
+ wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper);
+ v8SetReturnValue(info, wrapper);
}
-static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
-
- V8StringResource<> arg;
- V8StringResource<> optArg;
- int numArgsPassed = info.Length();
- while (numArgsPassed > 0) {
- if (!info[numArgsPassed - 1]->IsUndefined())
- break;
- --numArgsPassed;
- }
- arg = info[0];
- if (!arg.prepare())
- return;
+static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
+ ScriptState* scriptState = ScriptState::forReceiverObject(info);
- if (UNLIKELY(numArgsPassed <= 1)) {
- ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
- Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
- TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, arg, exceptionState);
- if (exceptionState.hadException()) {
- return;
- }
- v8::Local<v8::Object> wrapper = info.Holder();
- wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper);
- v8SetReturnValue(info, wrapper);
- return;
- }
- optArg = info[1];
- if (!optArg.prepare())
- return;
+ V8StringResource<> arg;
+ V8StringResource<> optArg;
+ int numArgsPassed = info.Length();
+ while (numArgsPassed > 0) {
+ if (!info[numArgsPassed - 1]->IsUndefined())
+ break;
+ --numArgsPassed;
+ }
+ arg = info[0];
+ if (!arg.prepare())
+ return;
+ if (UNLIKELY(numArgsPassed <= 1)) {
ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
- TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, arg, optArg, exceptionState);
+ TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, arg, exceptionState);
if (exceptionState.hadException()) {
- return;
+ return;
}
v8::Local<v8::Object> wrapper = info.Holder();
wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper);
v8SetReturnValue(info, wrapper);
+ return;
+ }
+ optArg = info[1];
+ if (!optArg.prepare())
+ return;
+
+ ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
+ Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
+ TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, arg, optArg, exceptionState);
+ if (exceptionState.hadException()) {
+ return;
+ }
+ v8::Local<v8::Object> wrapper = info.Holder();
+ wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper);
+ v8SetReturnValue(info, wrapper);
}
-static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
+ ScriptState* scriptState = ScriptState::forReceiverObject(info);
- V8StringResource<> arg;
- V8StringResource<> arg2;
- V8StringResource<> arg3;
- arg = info[0];
- if (!arg.prepare())
- return;
+ V8StringResource<> arg;
+ V8StringResource<> arg2;
+ V8StringResource<> arg3;
+ arg = info[0];
+ if (!arg.prepare())
+ return;
- arg2 = info[1];
- if (!arg2.prepare())
- return;
+ arg2 = info[1];
+ if (!arg2.prepare())
+ return;
- arg3 = info[2];
- if (!arg3.prepare())
- return;
+ arg3 = info[2];
+ if (!arg3.prepare())
+ return;
- ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
- Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
- TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, arg, arg2, arg3, exceptionState);
- if (exceptionState.hadException()) {
- return;
- }
- v8::Local<v8::Object> wrapper = info.Holder();
- wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper);
- v8SetReturnValue(info, wrapper);
+ ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
+ Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
+ TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptState, executionContext, document, arg, arg2, arg3, exceptionState);
+ if (exceptionState.hadException()) {
+ return;
+ }
+ v8::Local<v8::Object> wrapper = info.Holder();
+ wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper);
+ v8SetReturnValue(info, wrapper);
}
static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) {
@@ -291,63 +287,62 @@ const WrapperTypeInfo V8TestInterfaceConstructorConstructor::wrapperTypeInfo = {
#pragma clang diagnostic pop
#endif
-static void V8TestInterfaceConstructorConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- if (!info.IsConstructCall()) {
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("Audio"));
- return;
- }
-
- if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
- v8SetReturnValue(info, info.Holder());
- return;
- }
+static void V8TestInterfaceConstructorConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ if (!info.IsConstructCall()) {
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("Audio"));
+ return;
+ }
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+ if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
+ v8SetReturnValue(info, info.Holder());
+ return;
+ }
- if (UNLIKELY(info.Length() < 1)) {
- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- return;
- }
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor");
+ ScriptState* scriptState = ScriptState::forReceiverObject(info);
- V8StringResource<> arg;
- V8StringResource<> optArg;
- int numArgsPassed = info.Length();
- while (numArgsPassed > 0) {
- if (!info[numArgsPassed - 1]->IsUndefined())
- break;
- --numArgsPassed;
- }
- arg = info[0];
- if (!arg.prepare())
- return;
+ if (UNLIKELY(info.Length() < 1)) {
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+ return;
+ }
- if (UNLIKELY(numArgsPassed <= 1)) {
- ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
- Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
- TestInterfaceConstructor* impl = TestInterfaceConstructor::createForJSConstructor(scriptState, executionContext, document, arg, exceptionState);
- if (exceptionState.hadException()) {
- return;
- }
- v8::Local<v8::Object> wrapper = info.Holder();
- wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructorConstructor::wrapperTypeInfo, wrapper);
- v8SetReturnValue(info, wrapper);
- return;
- }
- optArg = info[1];
- if (!optArg.prepare())
- return;
+ V8StringResource<> arg;
+ V8StringResource<> optArg;
+ int numArgsPassed = info.Length();
+ while (numArgsPassed > 0) {
+ if (!info[numArgsPassed - 1]->IsUndefined())
+ break;
+ --numArgsPassed;
+ }
+ arg = info[0];
+ if (!arg.prepare())
+ return;
+ if (UNLIKELY(numArgsPassed <= 1)) {
ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
- TestInterfaceConstructor* impl = TestInterfaceConstructor::createForJSConstructor(scriptState, executionContext, document, arg, optArg, exceptionState);
+ TestInterfaceConstructor* impl = TestInterfaceConstructor::createForJSConstructor(scriptState, executionContext, document, arg, exceptionState);
if (exceptionState.hadException()) {
- return;
+ return;
}
v8::Local<v8::Object> wrapper = info.Holder();
wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructorConstructor::wrapperTypeInfo, wrapper);
v8SetReturnValue(info, wrapper);
+ return;
+ }
+ optArg = info[1];
+ if (!optArg.prepare())
+ return;
+
+ ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
+ Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
+ TestInterfaceConstructor* impl = TestInterfaceConstructor::createForJSConstructor(scriptState, executionContext, document, arg, optArg, exceptionState);
+ if (exceptionState.hadException()) {
+ return;
+ }
+ v8::Local<v8::Object> wrapper = info.Holder();
+ wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructorConstructor::wrapperTypeInfo, wrapper);
+ v8SetReturnValue(info, wrapper);
}
v8::Local<v8::FunctionTemplate> V8TestInterfaceConstructorConstructor::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) {

Powered by Google App Engine
This is Rietveld 408576698