From 80a039ec40c68ff98302c657e02b2b0b2cc15887 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 31 May 2021 21:00:09 -0700 Subject: [PATCH] chore: move destructors to header so they can be trivially destructible (#29379) --- shell/common/gin_helper/error_thrower.cc | 2 -- shell/common/gin_helper/error_thrower.h | 3 +-- shell/common/gin_helper/object_template_builder.cc | 2 -- shell/common/gin_helper/object_template_builder.h | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/shell/common/gin_helper/error_thrower.cc b/shell/common/gin_helper/error_thrower.cc index 52f5f1a863ff..d555b69a26c6 100644 --- a/shell/common/gin_helper/error_thrower.cc +++ b/shell/common/gin_helper/error_thrower.cc @@ -15,8 +15,6 @@ ErrorThrower::ErrorThrower(v8::Isolate* isolate) : isolate_(isolate) {} // costly to invoke ErrorThrower::ErrorThrower() : isolate_(v8::Isolate::GetCurrent()) {} -ErrorThrower::~ErrorThrower() = default; - void ErrorThrower::ThrowError(base::StringPiece err_msg) const { Throw(v8::Exception::Error, err_msg); } diff --git a/shell/common/gin_helper/error_thrower.h b/shell/common/gin_helper/error_thrower.h index bebc9b7ae42e..057874e93cc1 100644 --- a/shell/common/gin_helper/error_thrower.h +++ b/shell/common/gin_helper/error_thrower.h @@ -14,8 +14,7 @@ class ErrorThrower { public: explicit ErrorThrower(v8::Isolate* isolate); ErrorThrower(); - - ~ErrorThrower(); + ~ErrorThrower() = default; void ThrowError(base::StringPiece err_msg) const; void ThrowTypeError(base::StringPiece err_msg) const; diff --git a/shell/common/gin_helper/object_template_builder.cc b/shell/common/gin_helper/object_template_builder.cc index 7f80db038ac9..832f09057f0f 100644 --- a/shell/common/gin_helper/object_template_builder.cc +++ b/shell/common/gin_helper/object_template_builder.cc @@ -11,8 +11,6 @@ ObjectTemplateBuilder::ObjectTemplateBuilder( v8::Local templ) : isolate_(isolate), template_(templ) {} -ObjectTemplateBuilder::~ObjectTemplateBuilder() = default; - ObjectTemplateBuilder& ObjectTemplateBuilder::SetImpl( const base::StringPiece& name, v8::Local val) { diff --git a/shell/common/gin_helper/object_template_builder.h b/shell/common/gin_helper/object_template_builder.h index 8c9207dc9c4e..722d6f78bfa7 100644 --- a/shell/common/gin_helper/object_template_builder.h +++ b/shell/common/gin_helper/object_template_builder.h @@ -21,7 +21,7 @@ class ObjectTemplateBuilder { public: ObjectTemplateBuilder(v8::Isolate* isolate, v8::Local templ); - ~ObjectTemplateBuilder(); + ~ObjectTemplateBuilder() = default; // It's against Google C++ style to return a non-const ref, but we take some // poetic license here in order that all calls to Set() can be via the '.'