summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-01 21:56:17 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-01 21:56:17 +0000
commit576269a709da2e61481c7e1a5a3ac7771949d168 (patch)
treeb94236270a79f7b241e5d615b5d66e70ca651cc5
parent27ed3baee75f2dd28eb837dafdb41c5bddc759cd (diff)
downloadchromium_src-576269a709da2e61481c7e1a5a3ac7771949d168.zip
chromium_src-576269a709da2e61481c7e1a5a3ac7771949d168.tar.gz
chromium_src-576269a709da2e61481c7e1a5a3ac7771949d168.tar.bz2
Use arraysize() instead of ARRAYSIZE_UNSAFE() where possible. Remove pointless comment about use of ARRAYSIZE_UNSAFE().
BUG=none TEST=none Review URL: http://codereview.chromium.org/2364003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48663 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/mock_keyboard_driver_win.cc5
-rw-r--r--chrome_frame/chrome_active_document.cc2
-rw-r--r--net/http/http_cache_transaction.cc8
3 files changed, 6 insertions, 9 deletions
diff --git a/chrome/renderer/mock_keyboard_driver_win.cc b/chrome/renderer/mock_keyboard_driver_win.cc
index 151cb0b..ea88007 100644
--- a/chrome/renderer/mock_keyboard_driver_win.cc
+++ b/chrome/renderer/mock_keyboard_driver_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -155,8 +155,7 @@ int MockKeyboardDriverWin::GetCharacters(int key_code,
CHECK(output);
wchar_t code[16];
int length = ToUnicodeEx(key_code, MapVirtualKey(key_code, 0),
- &keyboard_states_[0], &code[0],
- ARRAYSIZE_UNSAFE(code), 0,
+ &keyboard_states_[0], &code[0], arraysize(code), 0,
active_keyboard_layout_);
if (length > 0)
output->assign(code);
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index d850240..d9fa792 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -1131,8 +1131,6 @@ HRESULT ChromeActiveDocument::OnEncodingChange(const GUID* cmd_group_guid,
return E_FAIL;
}
- // Using ARRAYSIZE_UNSAFE in here is because we define the struct
- // EncodingMapData inside function.
const char* chrome_encoding_name = NULL;
for (int i = 0; i < ARRAYSIZE_UNSAFE(kEncodingTestDatas); ++i) {
const struct EncodingMapData* encoding_data = &kEncodingTestDatas[i];
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index cf7af5d..b62c5a2 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -119,7 +119,7 @@ HttpCache::Transaction::Transaction(HttpCache* cache, bool enable_range_support)
write_headers_callback_(new CancelableCompletionCallback<Transaction>(
this, &Transaction::OnIOComplete))) {
COMPILE_ASSERT(HttpCache::Transaction::kNumValidationHeaders ==
- ARRAYSIZE_UNSAFE(kValidationHeaders),
+ arraysize(kValidationHeaders),
Invalid_number_of_validation_headers);
}
@@ -1244,7 +1244,7 @@ void HttpCache::Transaction::SetRequest(const BoundNetLog& net_log,
// Check for conditionalization headers which may correspond with a
// cache validation request.
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kValidationHeaders); ++i) {
+ for (size_t i = 0; i < arraysize(kValidationHeaders); ++i) {
const ValidationHeaderInfo& info = kValidationHeaders[i];
std::string validation_value;
if (request_->extra_headers.GetHeader(
@@ -1407,7 +1407,7 @@ int HttpCache::Transaction::BeginExternallyConditionalizedRequest() {
DCHECK_EQ(UPDATE, mode_);
DCHECK(external_validation_.initialized);
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kValidationHeaders); i++) {
+ for (size_t i = 0; i < arraysize(kValidationHeaders); i++) {
if (external_validation_.values[i].empty())
continue;
// Retrieve either the cached response's "etag" or "last-modified" header.