diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 4 | ||||
-rw-r--r-- | chrome/browser/automation/ui_controls_win.cc | 8 | ||||
-rw-r--r-- | chrome/browser/debugger/devtools_remote_listen_socket_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_uitest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/importer/importer_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/sync/syncable/syncable.cc | 11 | ||||
-rw-r--r-- | chrome/browser/views/select_profile_dialog.cc | 18 |
7 files changed, 27 insertions, 28 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index edfadd9..ca682a5 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.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. @@ -524,7 +524,7 @@ int ChromeMain(int argc, char** argv) { browser_pid = static_cast<base::ProcessId>(StringToInt(WideToASCII(channel_name))); - DCHECK_NE(browser_pid, 0); + DCHECK_NE(browser_pid, 0u); #else browser_pid = base::GetCurrentProcId(); #endif diff --git a/chrome/browser/automation/ui_controls_win.cc b/chrome/browser/automation/ui_controls_win.cc index 4e9f673..85aafec 100644 --- a/chrome/browser/automation/ui_controls_win.cc +++ b/chrome/browser/automation/ui_controls_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -183,7 +183,7 @@ bool SendKeyPressImpl(base::KeyboardCode key, INPUT input[8] = { 0 }; // 8, assuming all the modifiers are activated - int i = 0; + UINT i = 0; if (control) { if (!FillKeyboardInput(base::VKEY_CONTROL, &input[i], false)) return false; @@ -228,9 +228,7 @@ bool SendKeyPressImpl(base::KeyboardCode key, i++; } - unsigned int rv = ::SendInput(i, input, sizeof(INPUT)); - - if (rv != i) + if (::SendInput(i, input, sizeof(INPUT) != i)) return false; if (dispatcher.get()) diff --git a/chrome/browser/debugger/devtools_remote_listen_socket_unittest.cc b/chrome/browser/debugger/devtools_remote_listen_socket_unittest.cc index 79755e9..be08b4c6 100644 --- a/chrome/browser/debugger/devtools_remote_listen_socket_unittest.cc +++ b/chrome/browser/debugger/devtools_remote_listen_socket_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -79,7 +79,7 @@ void DevToolsRemoteListenSocketTester::SetUp() { // verify the connect/accept and setup test_socket_ test_socket_ = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - ASSERT_NE(-1, test_socket_); + ASSERT_NE(INVALID_SOCKET, test_socket_); struct sockaddr_in client; client.sin_family = AF_INET; client.sin_addr.s_addr = inet_addr(kLoopback); diff --git a/chrome/browser/extensions/extension_uitest.cc b/chrome/browser/extensions/extension_uitest.cc index 6457728..9adb732 100644 --- a/chrome/browser/extensions/extension_uitest.cc +++ b/chrome/browser/extensions/extension_uitest.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. @@ -163,7 +163,7 @@ TEST_F(ExtensionTestSimpleApiCall, FLAKY_RunTest) { int callback_id = 0xBAADF00D; message_dict->GetInteger(keys::kAutomationRequestIdKey, &callback_id); - EXPECT_NE(callback_id, 0xBAADF00D); + EXPECT_NE(callback_id, static_cast<int>(0xBAADF00D)); bool has_callback = true; EXPECT_TRUE(message_dict->GetBoolean(keys::kAutomationHasCallbackKey, @@ -246,7 +246,7 @@ public: std::string args; EXPECT_TRUE(request_dict->GetString(keys::kAutomationArgsKey, &args)); - EXPECT_NE(args.find("42"), -1); + EXPECT_NE(std::string::npos, args.find("42")); loop_.Quit(); } else { FAIL(); diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc index eac9bed..3da8361 100644 --- a/chrome/browser/importer/importer_unittest.cc +++ b/chrome/browser/importer/importer_unittest.cc @@ -122,7 +122,7 @@ const int kMaxPathSize = 5; typedef struct { const bool in_toolbar; - const int path_size; + const size_t path_size; const wchar_t* path[kMaxPathSize]; const wchar_t* title; const char* url; @@ -184,7 +184,7 @@ bool FindBookmarkEntry(const ProfileWriter::BookmarkEntry& entry, list[i].url == entry.url.spec() && list[i].title == entry.title) { bool equal = true; - for (int k = 0; k < list[i].path_size; ++k) + for (size_t k = 0; k < list[i].path_size; ++k) if (list[i].path[k] != entry.path[k]) { equal = false; break; diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc index 01c2fc7..ae0307c 100644 --- a/chrome/browser/sync/syncable/syncable.cc +++ b/chrome/browser/sync/syncable/syncable.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. @@ -586,12 +586,13 @@ void Directory::VacuumAfterSaveChanges(const SaveChangesSnapshot& snapshot) { size_t num_erased = 0; kernel_->flushed_metahandles.Push(entry->ref(META_HANDLE)); num_erased = kernel_->ids_index->erase(entry); - DCHECK(1 == num_erased); + DCHECK_EQ(1u, num_erased); num_erased = kernel_->metahandles_index->erase(entry); - DCHECK(1 == num_erased); + DCHECK_EQ(1u, num_erased); - num_erased = kernel_->client_tag_index->erase(entry); // Might not be in it - DCHECK(!entry->ref(UNIQUE_CLIENT_TAG).empty() == num_erased); + // Might not be in it + num_erased = kernel_->client_tag_index->erase(entry); + DCHECK_EQ(entry->ref(UNIQUE_CLIENT_TAG).empty(), !num_erased); delete entry; } } diff --git a/chrome/browser/views/select_profile_dialog.cc b/chrome/browser/views/select_profile_dialog.cc index d4af82e..c92c2f8 100644 --- a/chrome/browser/views/select_profile_dialog.cc +++ b/chrome/browser/views/select_profile_dialog.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -83,8 +83,8 @@ std::wstring SelectProfileDialog::GetWindowTitle() const { } bool SelectProfileDialog::Accept() { - int index = profile_combobox_->selected_item(); - if (index < 0) { + size_t index = profile_combobox_->selected_item(); + if (index > profiles_.size()) { NOTREACHED(); return true; } @@ -93,11 +93,10 @@ bool SelectProfileDialog::Accept() { // new profile dialog to the user. if (index == profiles_.size()) { NewProfileDialog::RunDialog(); - return true; + } else { + std::wstring profile_name = profiles_[index]; + UserDataManager::Get()->LaunchChromeForProfile(profile_name); } - - std::wstring profile_name = profiles_[index]; - UserDataManager::Get()->LaunchChromeForProfile(profile_name); return true; } @@ -116,10 +115,11 @@ int SelectProfileDialog::GetItemCount() { } std::wstring SelectProfileDialog::GetItemAt(int index) { - DCHECK(index >= 0 && index <= static_cast<int>(profiles_.size())); + size_t index_size_t = index; + DCHECK_LE(index_size_t, profiles_.size()); // For the last item in the drop down, return the <New Profile> text, // otherwise return the corresponding profile name from the vector. - return index == profiles_.size() ? + return index_size_t == profiles_.size() ? l10n_util::GetString(IDS_SELECT_PROFILE_DIALOG_NEW_PROFILE_ENTRY) : profiles_[index]; } |