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

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

Issue 2446213002: [Bindings] [Reformat] Reformat template files (Closed)
Patch Set: Rebase (Split out Callbackfunctions) 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/V8TestInterfaceConstructor4.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp
index c5626151a0b71d9cf519f03fb2e67ee7c1869ecf..ed93242114aa85ae809feb4c01faee94f053e07b 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp
@@ -50,108 +50,99 @@ static_assert(
namespace TestInterfaceConstructor4V8Internal {
-static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- TestInterfaceConstructor4* testInterface4Arg;
- testInterface4Arg = V8TestInterfaceConstructor4::toImplWithTypeCheck(info.GetIsolate(), info[0]);
- if (!testInterface4Arg) {
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToConstruct("TestInterfaceConstructor4", "parameter 1 is not of type 'TestInterfaceConstructor4'."));
-
- return;
- }
-
- TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(testInterface4Arg);
- v8::Local<v8::Object> wrapper = info.Holder();
- wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor4::wrapperTypeInfo, wrapper);
- v8SetReturnValue(info, wrapper);
+static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ TestInterfaceConstructor4* testInterface4Arg;
+ testInterface4Arg = V8TestInterfaceConstructor4::toImplWithTypeCheck(info.GetIsolate(), info[0]);
+ if (!testInterface4Arg) {
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToConstruct("TestInterfaceConstructor4", "parameter 1 is not of type 'TestInterfaceConstructor4'."));
+
+ return;
+ }
+
+ TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(testInterface4Arg);
+ v8::Local<v8::Object> wrapper = info.Holder();
+ wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor4::wrapperTypeInfo, wrapper);
+ v8SetReturnValue(info, wrapper);
}
-static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor4");
+static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor4");
- V8StringResource<> usvStringArg;
- usvStringArg = toUSVString(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.hadException())
- return;
+ V8StringResource<> usvStringArg;
+ usvStringArg = toUSVString(info.GetIsolate(), info[0], exceptionState);
+ if (exceptionState.hadException())
+ return;
- TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(usvStringArg);
- v8::Local<v8::Object> wrapper = info.Holder();
- wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor4::wrapperTypeInfo, wrapper);
- v8SetReturnValue(info, wrapper);
+ TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(usvStringArg);
+ v8::Local<v8::Object> wrapper = info.Holder();
+ wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceConstructor4::wrapperTypeInfo, wrapper);
+ v8SetReturnValue(info, wrapper);
}
-static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor4");
- switch (std::min(1, info.Length())) {
+static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceConstructor4");
+ switch (std::min(1, info.Length())) {
case 1:
- if (V8TestInterfaceConstructor4::hasInstance(info[0], info.GetIsolate())) {
- TestInterfaceConstructor4V8Internal::constructor1(info);
- return;
- }
- if (true) {
- TestInterfaceConstructor4V8Internal::constructor2(info);
- return;
- }
- break;
- default:
- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+ if (V8TestInterfaceConstructor4::hasInstance(info[0], info.GetIsolate())) {
+ TestInterfaceConstructor4V8Internal::constructor1(info);
return;
- }
- exceptionState.throwTypeError("No matching constructor signature.");
+ }
+ if (true) {
+ TestInterfaceConstructor4V8Internal::constructor2(info);
+ return;
+ }
+ break;
+ default:
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+ return;
+ }
+ exceptionState.throwTypeError("No matching constructor signature.");
}
} // namespace TestInterfaceConstructor4V8Internal
-void V8TestInterfaceConstructor4::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- if (!info.IsConstructCall()) {
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("TestInterfaceConstructor4"));
- return;
- }
+void V8TestInterfaceConstructor4::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ if (!info.IsConstructCall()) {
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("TestInterfaceConstructor4"));
+ return;
+ }
- if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
- v8SetReturnValue(info, info.Holder());
- return;
- }
+ if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
+ v8SetReturnValue(info, info.Holder());
+ return;
+ }
- TestInterfaceConstructor4V8Internal::constructor(info);
+ TestInterfaceConstructor4V8Internal::constructor(info);
}
-static void installV8TestInterfaceConstructor4Template(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate)
-{
- // Initialize the interface object's template.
- V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestInterfaceConstructor4::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTemplate>(), V8TestInterfaceConstructor4::internalFieldCount);
- interfaceTemplate->SetCallHandler(V8TestInterfaceConstructor4::constructorCallback);
- interfaceTemplate->SetLength(1);
- v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
- ALLOW_UNUSED_LOCAL(signature);
- v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate();
- ALLOW_UNUSED_LOCAL(instanceTemplate);
- v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate();
- ALLOW_UNUSED_LOCAL(prototypeTemplate);
- // Register DOM constants, attributes and operations.
+static void installV8TestInterfaceConstructor4Template(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) {
+ // Initialize the interface object's template.
+ V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestInterfaceConstructor4::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTemplate>(), V8TestInterfaceConstructor4::internalFieldCount);
+ interfaceTemplate->SetCallHandler(V8TestInterfaceConstructor4::constructorCallback);
+ interfaceTemplate->SetLength(1);
+ v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
+ ALLOW_UNUSED_LOCAL(signature);
+ v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate();
+ ALLOW_UNUSED_LOCAL(instanceTemplate);
+ v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate();
+ ALLOW_UNUSED_LOCAL(prototypeTemplate);
+ // Register DOM constants, attributes and operations.
}
-v8::Local<v8::FunctionTemplate> V8TestInterfaceConstructor4::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world)
-{
- return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterfaceConstructor4Template);
+v8::Local<v8::FunctionTemplate> V8TestInterfaceConstructor4::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) {
+ return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterfaceConstructor4Template);
}
-bool V8TestInterfaceConstructor4::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
-{
- return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
+bool V8TestInterfaceConstructor4::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
+ return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
}
-v8::Local<v8::Object> V8TestInterfaceConstructor4::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
-{
- return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
+v8::Local<v8::Object> V8TestInterfaceConstructor4::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
+ return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
}
-TestInterfaceConstructor4* V8TestInterfaceConstructor4::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
-{
- return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : nullptr;
+TestInterfaceConstructor4* V8TestInterfaceConstructor4::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) {
+ return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : nullptr;
}
-} // namespace blink
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698