summaryrefslogtreecommitdiffstats
path: root/chrome/utility
diff options
context:
space:
mode:
authorviettrungluu <viettrungluu@chromium.org>2014-10-13 18:40:02 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-14 01:40:19 +0000
commiteb552d78ea8a447dcecc5d828bc11eae7a2121d3 (patch)
tree60d80d11fcfecccc532e355eeda59986a69f9f30 /chrome/utility
parentb162ec76520509a254b13360e908c312758dd264 (diff)
downloadchromium_src-eb552d78ea8a447dcecc5d828bc11eae7a2121d3.zip
chromium_src-eb552d78ea8a447dcecc5d828bc11eae7a2121d3.tar.gz
chromium_src-eb552d78ea8a447dcecc5d828bc11eae7a2121d3.tar.bz2
Make ARRAYSIZE_UNSAFE() just use arraysize().
For every two problems that C++11 causes, it fixes at least one. R=thestig@chromium.org,tsepez@chromium.org BUG=423134 Review URL: https://codereview.chromium.org/647753003 Cr-Commit-Position: refs/heads/master@{#299419}
Diffstat (limited to 'chrome/utility')
-rw-r--r--chrome/utility/chrome_content_utility_ipc_whitelist.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/utility/chrome_content_utility_ipc_whitelist.cc b/chrome/utility/chrome_content_utility_ipc_whitelist.cc
index 7e2376a..253974e 100644
--- a/chrome/utility/chrome_content_utility_ipc_whitelist.cc
+++ b/chrome/utility/chrome_content_utility_ipc_whitelist.cc
@@ -8,15 +8,18 @@
#include "chrome/common/extensions/chrome_utility_extensions_messages.h"
#endif
-const uint32 kMessageWhitelist[] = {
#if defined(ENABLE_EXTENSIONS)
+const uint32 kMessageWhitelist[] = {
#if defined(OS_WIN)
ChromeUtilityHostMsg_GetWiFiCredentials::ID,
#endif // defined(OS_WIN)
ChromeUtilityMsg_ImageWriter_Cancel::ID,
ChromeUtilityMsg_ImageWriter_Write::ID,
ChromeUtilityMsg_ImageWriter_Verify::ID
-#endif // defined(ENABLE_EXTENSIONS)
};
-
-const size_t kMessageWhitelistSize = ARRAYSIZE_UNSAFE(kMessageWhitelist);
+const size_t kMessageWhitelistSize = arraysize(kMessageWhitelist);
+#else
+// Note: Zero-size arrays are not valid C++.
+const uint32 kMessageWhitelist[] = { 0 };
+const size_t kMessageWhitelistSize = 0;
+#endif // defined(ENABLE_EXTENSIONS)