Use base::size rather than arraysize in content/.
This is purely a mechanical change; there is no intended behavior change.
BUG=837308
[email protected]
Change-Id: I5ce196bbb75462a0967a95d1b5fd2e72df2c86f4
Reviewed-on: https://chromium-review.googlesource.com/c/1390894
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Avi Drissman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#618881}
diff --git a/content/shell/app/blink_test_platform_support_win.cc b/content/shell/app/blink_test_platform_support_win.cc
index 0252431..22d3e5c3 100644
--- a/content/shell/app/blink_test_platform_support_win.cc
+++ b/content/shell/app/blink_test_platform_support_win.cc
@@ -14,8 +14,8 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/macros.h"
#include "base/path_service.h"
+#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/gfx/win/direct_write.h"
@@ -59,7 +59,7 @@
{&metrics.lfStatusFont, &metrics.lfMenuFont, &metrics.lfSmCaptionFont};
const wchar_t required_font[] = L"Segoe UI";
int required_font_size = -12;
- for (size_t i = 0; i < arraysize(system_fonts); ++i) {
+ for (size_t i = 0; i < base::size(system_fonts); ++i) {
if (system_fonts[i]->lfHeight != required_font_size ||
wcscmp(required_font, system_fonts[i]->lfFaceName)) {
errors.push_back("Must use either the Aero or Basic theme.");
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc
index a1647a127..02225da 100644
--- a/content/shell/browser/shell_content_browser_client.cc
+++ b/content/shell/browser/shell_content_browser_client.cc
@@ -13,8 +13,8 @@
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
-#include "base/macros.h"
#include "base/path_service.h"
+#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "content/public/browser/client_certificate_delegate.h"
@@ -182,7 +182,7 @@
url::kDataScheme,
url::kFileScheme,
};
- for (size_t i = 0; i < arraysize(kProtocolList); ++i) {
+ for (size_t i = 0; i < base::size(kProtocolList); ++i) {
if (url.scheme() == kProtocolList[i])
return true;
}
diff --git a/content/shell/browser/shell_download_manager_delegate.cc b/content/shell/browser/shell_download_manager_delegate.cc
index 65731c2..2ca93dab 100644
--- a/content/shell/browser/shell_download_manager_delegate.cc
+++ b/content/shell/browser/shell_download_manager_delegate.cc
@@ -15,7 +15,7 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/macros.h"
+#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
@@ -165,7 +165,7 @@
#if defined(OS_WIN)
std::wstring file_part = base::FilePath(suggested_path).BaseName().value();
wchar_t file_name[MAX_PATH];
- base::wcslcpy(file_name, file_part.c_str(), arraysize(file_name));
+ base::wcslcpy(file_name, file_part.c_str(), base::size(file_name));
OPENFILENAME save_as;
ZeroMemory(&save_as, sizeof(save_as));
save_as.lStructSize = sizeof(OPENFILENAME);
@@ -174,7 +174,7 @@
->GetHost()
->GetAcceleratedWidget();
save_as.lpstrFile = file_name;
- save_as.nMaxFile = arraysize(file_name);
+ save_as.nMaxFile = base::size(file_name);
std::wstring directory;
if (!suggested_path.empty())
diff --git a/content/shell/browser/shell_views.cc b/content/shell/browser/shell_views.cc
index ef4da07..cb407fb8 100644
--- a/content/shell/browser/shell_views.cc
+++ b/content/shell/browser/shell_views.cc
@@ -7,7 +7,7 @@
#include <stddef.h>
#include "base/command_line.h"
-#include "base/macros.h"
+#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "content/public/browser/context_factory.h"
@@ -209,7 +209,7 @@
static const ui::KeyboardCode keys[] = { ui::VKEY_F5,
ui::VKEY_BROWSER_BACK,
ui::VKEY_BROWSER_FORWARD };
- for (size_t i = 0; i < arraysize(keys); ++i) {
+ for (size_t i = 0; i < base::size(keys); ++i) {
GetFocusManager()->RegisterAccelerator(
ui::Accelerator(keys[i], ui::EF_NONE),
ui::AcceleratorManager::kNormalPriority,
diff --git a/content/shell/browser/web_test/web_test_push_messaging_service.cc b/content/shell/browser/web_test/web_test_push_messaging_service.cc
index 1c5e704..4d7cb1d 100644
--- a/content/shell/browser/web_test/web_test_push_messaging_service.cc
+++ b/content/shell/browser/web_test/web_test_push_messaging_service.cc
@@ -6,7 +6,7 @@
#include "base/callback.h"
#include "base/logging.h"
-#include "base/macros.h"
+#include "base/stl_util.h"
#include "content/common/service_worker/service_worker_types.h"
#include "content/public/browser/permission_type.h"
#include "content/public/common/push_messaging_status.mojom.h"
@@ -83,9 +83,9 @@
if (permission_status == blink::mojom::PermissionStatus::GRANTED) {
std::vector<uint8_t> p256dh(kTestP256Key,
- kTestP256Key + arraysize(kTestP256Key));
+ kTestP256Key + base::size(kTestP256Key));
std::vector<uint8_t> auth(kAuthentication,
- kAuthentication + arraysize(kAuthentication));
+ kAuthentication + base::size(kAuthentication));
subscribed_service_worker_registration_ = service_worker_registration_id;
callback.Run("layoutTestRegistrationId", p256dh, auth,
@@ -104,9 +104,9 @@
const std::string& subscription_id,
const SubscriptionInfoCallback& callback) {
std::vector<uint8_t> p256dh(kTestP256Key,
- kTestP256Key + arraysize(kTestP256Key));
+ kTestP256Key + base::size(kTestP256Key));
std::vector<uint8_t> auth(kAuthentication,
- kAuthentication + arraysize(kAuthentication));
+ kAuthentication + base::size(kAuthentication));
callback.Run(true /* is_valid */, p256dh, auth);
}
diff --git a/content/shell/common/shell_origin_trial_policy.cc b/content/shell/common/shell_origin_trial_policy.cc
index b6e31223..64b20eb 100644
--- a/content/shell/common/shell_origin_trial_policy.cc
+++ b/content/shell/common/shell_origin_trial_policy.cc
@@ -5,6 +5,7 @@
#include "content/shell/common/shell_origin_trial_policy.h"
#include "base/feature_list.h"
+#include "base/stl_util.h"
#include "content/public/common/content_features.h"
#include "content/public/common/origin_util.h"
@@ -27,7 +28,7 @@
ShellOriginTrialPolicy::ShellOriginTrialPolicy()
: public_key_(base::StringPiece(
reinterpret_cast<const char*>(kOriginTrialPublicKey),
- arraysize(kOriginTrialPublicKey))) {}
+ base::size(kOriginTrialPublicKey))) {}
ShellOriginTrialPolicy::~ShellOriginTrialPolicy() {}
diff --git a/content/shell/test_runner/accessibility_controller.cc b/content/shell/test_runner/accessibility_controller.cc
index 2c2c0fb..146b573 100644
--- a/content/shell/test_runner/accessibility_controller.cc
+++ b/content/shell/test_runner/accessibility_controller.cc
@@ -6,7 +6,7 @@
#include <string>
-#include "base/macros.h"
+#include "base/stl_util.h"
#include "content/shell/test_runner/web_view_test_proxy.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"
@@ -199,7 +199,7 @@
};
local_frame->CallFunctionEvenIfScriptDisabled(
v8::Local<v8::Function>::New(isolate, notification_callback_),
- context->Global(), arraysize(argv), argv);
+ context->Global(), base::size(argv), argv);
}
void AccessibilityController::LogAccessibilityEvents() {
diff --git a/content/shell/test_runner/mock_grammar_check.cc b/content/shell/test_runner/mock_grammar_check.cc
index a3971ef..83c1def 100644
--- a/content/shell/test_runner/mock_grammar_check.cc
+++ b/content/shell/test_runner/mock_grammar_check.cc
@@ -9,7 +9,7 @@
#include <algorithm>
#include "base/logging.h"
-#include "base/macros.h"
+#include "base/stl_util.h"
#include "content/shell/test_runner/test_common.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/web_text_checking_result.h"
@@ -46,7 +46,7 @@
{"the the adlj adaasj sdklj. there there", 33, 5},
{"zz apple orange.", 0, 16},
};
- for (size_t i = 0; i < arraysize(kGrammarErrors); ++i) {
+ for (size_t i = 0; i < base::size(kGrammarErrors); ++i) {
size_t offset = 0;
base::string16 error(
kGrammarErrors[i].text,
diff --git a/content/shell/test_runner/mock_spell_check.cc b/content/shell/test_runner/mock_spell_check.cc
index cfd7242a..db07974 100644
--- a/content/shell/test_runner/mock_spell_check.cc
+++ b/content/shell/test_runner/mock_spell_check.cc
@@ -9,7 +9,7 @@
#include <algorithm>
#include "base/logging.h"
-#include "base/macros.h"
+#include "base/stl_util.h"
#include "content/shell/test_runner/test_common.h"
namespace test_runner {
@@ -158,7 +158,7 @@
"ifmmp", "qwertyuiopasd", "qwertyuiopasdf", "upper case", "wellcome"};
misspelled_words_.clear();
- for (size_t i = 0; i < arraysize(misspelled_words); ++i)
+ for (size_t i = 0; i < base::size(misspelled_words); ++i)
misspelled_words_.push_back(
base::string16(misspelled_words[i],
misspelled_words[i] + strlen(misspelled_words[i])));
diff --git a/content/shell/test_runner/test_runner_for_specific_view.cc b/content/shell/test_runner/test_runner_for_specific_view.cc
index 8d34f2d..e01f88e 100644
--- a/content/shell/test_runner/test_runner_for_specific_view.cc
+++ b/content/shell/test_runner/test_runner_for_specific_view.cc
@@ -11,7 +11,7 @@
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/logging.h"
-#include "base/macros.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "cc/paint/paint_canvas.h"
@@ -290,7 +290,7 @@
argv[2] = blink::WebArrayBufferConverter::ToV8Value(
&buffer, context->Global(), isolate);
- PostV8CallbackWithArgs(std::move(callback), arraysize(argv), argv);
+ PostV8CallbackWithArgs(std::move(callback), base::size(argv), argv);
}
void TestRunnerForSpecificView::CopyImageAtAndCapturePixelsAsyncThen(
diff --git a/content/shell/test_runner/web_ax_object_proxy.cc b/content/shell/test_runner/web_ax_object_proxy.cc
index 695b6b6..2860354 100644
--- a/content/shell/test_runner/web_ax_object_proxy.cc
+++ b/content/shell/test_runner/web_ax_object_proxy.cc
@@ -6,7 +6,7 @@
#include <stddef.h>
-#include "base/macros.h"
+#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "gin/handle.h"
#include "third_party/blink/public/platform/web_float_rect.h"
@@ -851,7 +851,7 @@
};
frame->CallFunctionEvenIfScriptDisabled(
v8::Local<v8::Function>::New(isolate, notification_callback_),
- context->Global(), arraysize(argv), argv);
+ context->Global(), base::size(argv), argv);
}
void WebAXObjectProxy::Reset() {