refactor: run clang-tidy (#20231)

* refactor: clang-tidy modernize-use-nullptr

* refactor: clang-tidy modernize-use-equals-default

* refactor: clang-tidy modernize-make-unique

* refactor: omit nullptr arg from unique_ptr.reset()

As per comment by @miniak
This commit is contained in:
Charles Kerr 2019-09-16 18:12:00 -04:00 committed by GitHub
parent 660e566201
commit 2b316f3843
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
93 changed files with 261 additions and 223 deletions

View file

@ -106,10 +106,9 @@ class RefCountedGlobal
SafeV8Function::SafeV8Function(v8::Isolate* isolate, v8::Local<v8::Value> value)
: v8_function_(new RefCountedGlobal<v8::Function>(isolate, value)) {}
SafeV8Function::SafeV8Function(const SafeV8Function& other)
: v8_function_(other.v8_function_) {}
SafeV8Function::SafeV8Function(const SafeV8Function& other) = default;
SafeV8Function::~SafeV8Function() {}
SafeV8Function::~SafeV8Function() = default;
bool SafeV8Function::IsAlive() const {
return v8_function_.get() && v8_function_->IsAlive();

View file

@ -122,7 +122,7 @@ class V8ValueConverter::ScopedUniquenessGuard {
DISALLOW_COPY_AND_ASSIGN(ScopedUniquenessGuard);
};
V8ValueConverter::V8ValueConverter() {}
V8ValueConverter::V8ValueConverter() = default;
void V8ValueConverter::SetRegExpAllowed(bool val) {
reg_exp_allowed_ = val;
@ -386,7 +386,7 @@ std::unique_ptr<base::Value> V8ValueConverter::FromV8Array(
// that context, but change back after val is converted.
if (!val->CreationContext().IsEmpty() &&
val->CreationContext() != isolate->GetCurrentContext())
scope.reset(new v8::Context::Scope(val->CreationContext()));
scope = std::make_unique<v8::Context::Scope>(val->CreationContext());
std::unique_ptr<base::ListValue> result(new base::ListValue());
@ -442,7 +442,7 @@ std::unique_ptr<base::Value> V8ValueConverter::FromV8Object(
// that context, but change back after val is converted.
if (!val->CreationContext().IsEmpty() &&
val->CreationContext() != isolate->GetCurrentContext())
scope.reset(new v8::Context::Scope(val->CreationContext()));
scope = std::make_unique<v8::Context::Scope>(val->CreationContext());
auto result = std::make_unique<base::DictionaryValue>();
v8::Local<v8::Array> property_names;