diff --git a/shell/common/api/electron_api_v8_util.cc b/shell/common/api/electron_api_v8_util.cc index 8c55a47919b7..07396528851a 100644 --- a/shell/common/api/electron_api_v8_util.cc +++ b/shell/common/api/electron_api_v8_util.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. +#include #include #include "base/hash/hash.h" @@ -106,9 +107,11 @@ void RequestGarbageCollectionForTesting(v8::Isolate* isolate) { // This causes a fatal error by creating a circular extension dependency. void TriggerFatalErrorForTesting(v8::Isolate* isolate) { static const char* aDeps[] = {"B"}; - v8::RegisterExtension(std::make_unique("A", "", 1, aDeps)); + v8::RegisterExtension( + std::make_unique("A", "", std::size(aDeps), aDeps)); static const char* bDeps[] = {"A"}; - v8::RegisterExtension(std::make_unique("B", "", 1, bDeps)); + v8::RegisterExtension( + std::make_unique("B", "", std::size(aDeps), bDeps)); v8::ExtensionConfiguration config(1, bDeps); v8::Context::New(isolate, &config); } diff --git a/shell/common/v8_value_converter.cc b/shell/common/v8_value_converter.cc index a46c4fb1a4b3..9dc372414bc3 100644 --- a/shell/common/v8_value_converter.cc +++ b/shell/common/v8_value_converter.cc @@ -4,6 +4,7 @@ #include "shell/common/v8_value_converter.h" +#include #include #include #include @@ -285,7 +286,7 @@ v8::Local V8ValueConverter::ToArrayBuffer( v8::Local args[] = {array_buffer}; auto func = from_value.As(); - auto result = func->Call(context, v8::Null(isolate), 1, args); + auto result = func->Call(context, v8::Null(isolate), std::size(args), args); if (!result.IsEmpty()) { return result.ToLocalChecked(); } diff --git a/shell/renderer/api/electron_api_spell_check_client.cc b/shell/renderer/api/electron_api_spell_check_client.cc index 48d9e38e0d15..21374c965b3f 100644 --- a/shell/renderer/api/electron_api_spell_check_client.cc +++ b/shell/renderer/api/electron_api_spell_check_client.cc @@ -4,6 +4,7 @@ #include "shell/renderer/api/electron_api_spell_check_client.h" +#include #include #include #include @@ -229,7 +230,8 @@ void SpellCheckClient::SpellCheckWords(const SpellCheckScope& scope, v8::Local args[] = {gin::ConvertToV8(isolate_, words), templ->GetFunction(context).ToLocalChecked()}; // Call javascript with the words and the callback function - scope.spell_check_->Call(context, scope.provider_, 2, args).IsEmpty(); + scope.spell_check_->Call(context, scope.provider_, std::size(args), args) + .IsEmpty(); } // Returns whether or not the given string is a contraction.