Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: chrome/utility/chrome_content_utility_ipc_whitelist.cc

Issue 647753003: Make ARRAYSIZE_UNSAFE() just use arraysize(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added bug Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/spellchecker/spelling_service_client_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/chrome_content_utility_ipc_whitelist.cc
diff --git a/chrome/utility/chrome_content_utility_ipc_whitelist.cc b/chrome/utility/chrome_content_utility_ipc_whitelist.cc
index 7e2376a1ce055b3a62e15f41fbd38b83495fd487..253974eeb7fcbc4f493a41cbc84358387b378ea9 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;
Tom Sepez 2014/10/13 23:07:12 Alternatively, It looks like this is used only in
+#endif // defined(ENABLE_EXTENSIONS)
« no previous file with comments | « chrome/browser/spellchecker/spelling_service_client_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698