summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 21:03:47 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 21:03:47 +0000
commit6775e40aeb887f15dc9182b250cdc4100aa79ce0 (patch)
tree858e3064689861a9ad85975154ce653418aaf3d8 /chrome
parent5bd8d1716b3f27664348c7fcb2c33f2e3a4573a7 (diff)
downloadchromium_src-6775e40aeb887f15dc9182b250cdc4100aa79ce0.zip
chromium_src-6775e40aeb887f15dc9182b250cdc4100aa79ce0.tar.gz
chromium_src-6775e40aeb887f15dc9182b250cdc4100aa79ce0.tar.bz2
Change other usages of .size() to .empty() when applicable.
BUG=carnitas TEST=compiles Review URL: http://codereview.chromium.org/6609008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/accessibility/browser_accessibility_win.cc25
-rw-r--r--chrome/browser/autocomplete/autocomplete_match.cc2
-rw-r--r--chrome/browser/autocomplete/history_contents_provider.cc2
-rw-r--r--chrome/browser/automation/automation_provider_observers.cc2
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_controller.cc2
-rw-r--r--chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm4
-rw-r--r--chrome/browser/chromeos/login/wizard_accessibility_handler.cc6
-rw-r--r--chrome/browser/debugger/devtools_remote_listen_socket.cc2
-rw-r--r--chrome/browser/debugger/extension_ports_remote_service.cc2
-rw-r--r--chrome/browser/debugger/inspectable_tab_proxy.cc2
-rw-r--r--chrome/browser/download/download_util.cc4
-rw-r--r--chrome/browser/extensions/extension_updater.cc4
-rw-r--r--chrome/browser/extensions/extension_updater_unittest.cc2
-rw-r--r--chrome/browser/external_tab_container_win.cc2
-rw-r--r--chrome/browser/gpu_process_host_ui_shim.cc6
-rw-r--r--chrome/browser/history/history_publisher_win.cc2
-rw-r--r--chrome/browser/history/history_types.cc2
-rw-r--r--chrome/browser/history/query_parser.cc2
-rw-r--r--chrome/browser/importer/firefox2_importer.cc2
-rw-r--r--chrome/browser/importer/ie_importer.cc4
-rw-r--r--chrome/browser/password_manager/password_store_mac.cc2
-rw-r--r--chrome/browser/plugin_exceptions_table_model_unittest.cc2
-rw-r--r--chrome/browser/prerender/prerender_manager.cc4
-rw-r--r--chrome/browser/renderer_host/web_cache_manager.cc2
-rw-r--r--chrome/browser/sync/engine/syncapi.cc2
-rw-r--r--chrome/browser/sync/glue/data_type_manager_impl.cc2
-rw-r--r--chrome/browser/sync/glue/data_type_manager_impl2.cc2
-rw-r--r--chrome/browser/sync/glue/foreign_session_tracker.cc7
-rw-r--r--chrome/browser/sync/profile_sync_service.cc2
-rw-r--r--chrome/browser/sync/profile_sync_service_unittest.cc2
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc2
-rw-r--r--chrome/browser/ui/cocoa/clear_browsing_data_controller.mm3
-rw-r--r--chrome/browser/ui/cocoa/cocoa_test_helper.mm2
-rw-r--r--chrome/browser/ui/cocoa/task_manager_mac.mm2
-rw-r--r--chrome/browser/ui/gtk/dialogs_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc4
-rw-r--r--chrome/browser/ui/gtk/options/passwords_page_gtk.cc4
-rw-r--r--chrome/browser/ui/gtk/rounded_window.cc2
-rw-r--r--chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc2
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc2
-rw-r--r--chrome/browser/ui/views/download_shelf_view.cc2
-rw-r--r--chrome/browser/ui/webui/bug_report_ui.cc3
-rw-r--r--chrome/browser/ui/window_snapshot/window_snapshot_mac.mm2
-rw-r--r--chrome/browser/webdata/web_data_service.cc2
-rw-r--r--chrome/browser/webdata/web_database_unittest.cc2
-rw-r--r--chrome/common/extensions/extension.cc6
-rw-r--r--chrome/common/extensions/extension_icon_set.cc2
-rw-r--r--chrome/common/extensions/update_manifest.cc2
-rw-r--r--chrome/common/extensions/user_script.cc6
-rw-r--r--chrome/common/unix_domain_socket_posix.cc11
-rw-r--r--chrome/common/web_apps_unittest.cc2
-rw-r--r--chrome/renderer/render_thread.cc2
-rw-r--r--chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc2
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc2
-rw-r--r--chrome/renderer/webworker_base.h2
-rw-r--r--chrome/test/reliability/page_load_test.cc2
-rw-r--r--chrome/test/url_fetch_test/url_fetch_test.cc4
-rw-r--r--chrome/tools/crash_service/crash_service.cc2
58 files changed, 89 insertions, 98 deletions
diff --git a/chrome/browser/accessibility/browser_accessibility_win.cc b/chrome/browser/accessibility/browser_accessibility_win.cc
index b5bf894..050cea0 100644
--- a/chrome/browser/accessibility/browser_accessibility_win.cc
+++ b/chrome/browser/accessibility/browser_accessibility_win.cc
@@ -66,8 +66,9 @@ HRESULT BrowserAccessibilityWin::accDoDefaultAction(VARIANT var_id) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibilityWin::accHitTest(
- LONG x_left, LONG y_top, VARIANT* child) {
+STDMETHODIMP BrowserAccessibilityWin::accHitTest(LONG x_left,
+ LONG y_top,
+ VARIANT* child) {
if (!instance_active_)
return E_FAIL;
@@ -136,12 +137,12 @@ STDMETHODIMP BrowserAccessibilityWin::accNavigate(
// These directions are not implemented, matching Mozilla and IE.
return E_NOTIMPL;
case NAVDIR_FIRSTCHILD:
- if (target->children_.size() > 0)
- result = target->children_[0];
+ if (!target->children_.empty())
+ result = target->children_.front();
break;
case NAVDIR_LASTCHILD:
- if (target->children_.size() > 0)
- result = target->children_[target->children_.size() - 1];
+ if (!target->children_.empty())
+ result = target->children_.back();
break;
case NAVDIR_NEXT:
result = target->GetNextSibling();
@@ -162,7 +163,7 @@ STDMETHODIMP BrowserAccessibilityWin::accNavigate(
}
STDMETHODIMP BrowserAccessibilityWin::get_accChild(VARIANT var_child,
- IDispatch** disp_child) {
+ IDispatch** disp_child) {
if (!instance_active_)
return E_FAIL;
@@ -191,7 +192,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accChildCount(LONG* child_count) {
}
STDMETHODIMP BrowserAccessibilityWin::get_accDefaultAction(VARIANT var_id,
- BSTR* def_action) {
+ BSTR* def_action) {
if (!instance_active_)
return E_FAIL;
@@ -207,7 +208,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accDefaultAction(VARIANT var_id,
}
STDMETHODIMP BrowserAccessibilityWin::get_accDescription(VARIANT var_id,
- BSTR* desc) {
+ BSTR* desc) {
if (!instance_active_)
return E_FAIL;
@@ -258,7 +259,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accHelp(VARIANT var_id, BSTR* help) {
}
STDMETHODIMP BrowserAccessibilityWin::get_accKeyboardShortcut(VARIANT var_id,
- BSTR* acc_key) {
+ BSTR* acc_key) {
if (!instance_active_)
return E_FAIL;
@@ -304,7 +305,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accParent(IDispatch** disp_parent) {
// This happens if we're the root of the tree;
// return the IAccessible for the window.
parent = manager_->toBrowserAccessibilityManagerWin()->
- GetParentWindowIAccessible();
+ GetParentWindowIAccessible();
}
parent->AddRef();
@@ -335,7 +336,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accRole(
}
STDMETHODIMP BrowserAccessibilityWin::get_accState(VARIANT var_id,
- VARIANT* state) {
+ VARIANT* state) {
if (!instance_active_)
return E_FAIL;
diff --git a/chrome/browser/autocomplete/autocomplete_match.cc b/chrome/browser/autocomplete/autocomplete_match.cc
index f05892e..e19f156 100644
--- a/chrome/browser/autocomplete/autocomplete_match.cc
+++ b/chrome/browser/autocomplete/autocomplete_match.cc
@@ -166,7 +166,7 @@ void AutocompleteMatch::ValidateClassifications(
}
// The classifications should always cover the whole string.
- DCHECK(classifications.size() > 0) << "No classification for text";
+ DCHECK(!classifications.empty()) << "No classification for text";
DCHECK(classifications[0].offset == 0) << "Classification misses beginning";
if (classifications.size() == 1)
return;
diff --git a/chrome/browser/autocomplete/history_contents_provider.cc b/chrome/browser/autocomplete/history_contents_provider.cc
index 44d24e8d..91c3078 100644
--- a/chrome/browser/autocomplete/history_contents_provider.cc
+++ b/chrome/browser/autocomplete/history_contents_provider.cc
@@ -113,7 +113,7 @@ void HistoryContentsProvider::Start(const AutocompleteInput& input,
return;
}
- if (results_.size() != 0) {
+ if (!results_.empty()) {
// Clear the results. We swap in an empty one as the easy way to clear it.
history::QueryResults empty_results;
results_.Swap(&empty_results);
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 7afc0d0..bbbebf2 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -636,7 +636,7 @@ void ExtensionTestResultNotificationObserver::MaybeSendResult() {
if (!automation_)
return;
- if (results_.size() > 0) {
+ if (!results_.empty()) {
// This release method should return the automation's current
// reply message, or NULL if there is no current one. If it is not
// NULL, we are stating that we will handle this reply message.
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
index 52145bd..32dba74 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
+++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
@@ -269,7 +269,7 @@ bool BookmarkContextMenuController::IsCommandIdEnabled(int command_id) const {
case IDC_COPY:
case IDC_CUT:
- return selection_.size() > 0 && !is_root_node;
+ return !selection_.empty() && !is_root_node;
case IDC_PASTE:
// Paste to selection from the Bookmark Bar, to parent_ everywhere else
diff --git a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm
index bfb6a7a..76fc372 100644
--- a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm
+++ b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm
@@ -224,9 +224,9 @@ void WriteToClipboardPrivate(
const std::vector<BookmarkNodeData::Element>& elements,
NSPasteboard* pb,
FilePath::StringType profile_path) {
- if (elements.empty()) {
+ if (elements.empty())
return;
- }
+
NSArray* types = [NSArray arrayWithObjects:kBookmarkDictionaryListPboardType,
kWebURLsWithTitlesPboardType,
NSStringPboardType,
diff --git a/chrome/browser/chromeos/login/wizard_accessibility_handler.cc b/chrome/browser/chromeos/login/wizard_accessibility_handler.cc
index 16bb99b..539b0bd 100644
--- a/chrome/browser/chromeos/login/wizard_accessibility_handler.cc
+++ b/chrome/browser/chromeos/login/wizard_accessibility_handler.cc
@@ -430,13 +430,13 @@ void WizardAccessibilityHandler::DescribeTextContentsChanged(
new_indices[prefix_char_len],
new_indices[new_suffix_char_start] - new_indices[prefix_char_len]);
- if (inserted.size() > 0 && deleted.size() > 0) {
+ if (!inserted.empty() && !deleted.empty()) {
// Replace one substring with another, speak inserted text.
AppendUtterance(inserted, out_spoken_description);
- } else if (inserted.size() > 0) {
+ } else if (!inserted.empty()) {
// Speak inserted text.
AppendUtterance(inserted, out_spoken_description);
- } else if (deleted.size() > 0) {
+ } else if (!deleted.empty()) {
// Speak deleted text.
AppendUtterance(deleted, out_spoken_description);
}
diff --git a/chrome/browser/debugger/devtools_remote_listen_socket.cc b/chrome/browser/debugger/devtools_remote_listen_socket.cc
index 6e2a2ae..19234e5 100644
--- a/chrome/browser/debugger/devtools_remote_listen_socket.cc
+++ b/chrome/browser/debugger/devtools_remote_listen_socket.cc
@@ -164,7 +164,7 @@ void DevToolsRemoteListenSocket::DispatchField() {
}
break;
case HEADERS: {
- if (protocol_field_.size() > 0) { // not end-of-headers
+ if (!protocol_field_.empty()) { // not end-of-headers
std::string::size_type colon_pos = protocol_field_.find_first_of(":");
if (colon_pos == std::string::npos) {
// TODO(apavlov): handle the error (malformed header)
diff --git a/chrome/browser/debugger/extension_ports_remote_service.cc b/chrome/browser/debugger/extension_ports_remote_service.cc
index 1f8247b..711e3f8 100644
--- a/chrome/browser/debugger/extension_ports_remote_service.cc
+++ b/chrome/browser/debugger/extension_ports_remote_service.cc
@@ -174,7 +174,7 @@ void ExtensionPortsRemoteService::HandleMessage(
}
int destination = -1;
- if (destinationString.size() != 0)
+ if (!destinationString.empty())
base::StringToInt(destinationString, &destination);
if (command == kConnect) {
diff --git a/chrome/browser/debugger/inspectable_tab_proxy.cc b/chrome/browser/debugger/inspectable_tab_proxy.cc
index 499b39a..0f31b0a 100644
--- a/chrome/browser/debugger/inspectable_tab_proxy.cc
+++ b/chrome/browser/debugger/inspectable_tab_proxy.cc
@@ -105,7 +105,7 @@ DevToolsClientHost* InspectableTabProxy::NewClientHost(
}
void InspectableTabProxy::OnRemoteDebuggerDetached() {
- while (id_to_client_host_map_.size() > 0) {
+ while (!id_to_client_host_map_.empty()) {
IdToClientHostMap::iterator it = id_to_client_host_map_.begin();
it->second->debugger_remote_service()->DetachFromTab(
base::IntToString(it->first), NULL);
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 180c768..292362e 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -114,8 +114,8 @@ bool IsShellIntegratedExtension(const string16& extension) {
// See <http://www.juniper.net/security/auto/vulnerabilities/vuln2612.html>.
// That vulnerability report is not exactly on point, but files become magical
// if their end in a CLSID. Here we block extensions that look like CLSIDs.
- if (extension_lower.size() > 0 && extension_lower.at(0) == L'{' &&
- extension_lower.at(extension_lower.length() - 1) == L'}')
+ if (!extension_lower.empty() && extension_lower[0] == L'{' &&
+ extension_lower[extension_lower.length() - 1] == L'}')
return true;
return false;
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc
index c15f77f..c4ab498 100644
--- a/chrome/browser/extensions/extension_updater.cc
+++ b/chrome/browser/extensions/extension_updater.cc
@@ -121,7 +121,7 @@ bool ManifestFetchData::AddExtension(std::string id, std::string version,
// Check against our max url size, exempting the first extension added.
int new_size = full_url_.possibly_invalid_spec().size() + extra.size();
- if (extension_ids_.size() > 0 && new_size > kExtensionsManifestMaxURLSize) {
+ if (!extension_ids_.empty() && new_size > kExtensionsManifestMaxURLSize) {
UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 1);
return false;
}
@@ -690,7 +690,7 @@ void ExtensionUpdater::OnCRXFetchComplete(const GURL& url,
current_extension_fetch_ = ExtensionFetch();
// If there are any pending downloads left, start one.
- if (extensions_pending_.size() > 0) {
+ if (!extensions_pending_.empty()) {
ExtensionFetch next = extensions_pending_.front();
extensions_pending_.pop_front();
FetchUpdatedExtension(next.id, next.url, next.package_hash, next.version);
diff --git a/chrome/browser/extensions/extension_updater_unittest.cc b/chrome/browser/extensions/extension_updater_unittest.cc
index 74de7f7..92b9ebb 100644
--- a/chrome/browser/extensions/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/extension_updater_unittest.cc
@@ -278,7 +278,7 @@ static void ExtractParameters(const std::string& params,
for (size_t i = 0; i < pairs.size(); i++) {
std::vector<std::string> key_val;
base::SplitString(pairs[i], '=', &key_val);
- if (key_val.size() > 0) {
+ if (!key_val.empty()) {
std::string key = key_val[0];
EXPECT_TRUE(result->find(key) == result->end());
(*result)[key] = (key_val.size() == 2) ? key_val[1] : "";
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index 80c753f..5888100 100644
--- a/chrome/browser/external_tab_container_win.cc
+++ b/chrome/browser/external_tab_container_win.cc
@@ -916,7 +916,7 @@ scoped_refptr<ExternalTabContainer> ExternalTabContainer::RemovePendingTab(
void ExternalTabContainer::SetEnableExtensionAutomation(
const std::vector<std::string>& functions_enabled) {
- if (functions_enabled.size() > 0) {
+ if (!functions_enabled.empty()) {
if (!tab_contents_.get()) {
NOTREACHED() << "Being invoked via tab so should have TabContents";
return;
diff --git a/chrome/browser/gpu_process_host_ui_shim.cc b/chrome/browser/gpu_process_host_ui_shim.cc
index b5ad05b..ac0ea32 100644
--- a/chrome/browser/gpu_process_host_ui_shim.cc
+++ b/chrome/browser/gpu_process_host_ui_shim.cc
@@ -416,7 +416,7 @@ void GpuProcessHostUIShim::OnChannelEstablished(
// Currently if any of the GPU features are blacklisted, we don't establish a
// GPU channel.
- if (channel_handle.name.size() != 0 &&
+ if (!channel_handle.name.empty() &&
gpu_data_manager_->GetGpuFeatureFlags().flags() != 0) {
Send(new GpuMsg_CloseChannel(channel_handle));
EstablishChannelError(callback.release(),
@@ -433,7 +433,7 @@ void GpuProcessHostUIShim::OnChannelEstablished(
void GpuProcessHostUIShim::OnSynchronizeReply() {
// Guard against race conditions in abrupt GPU process termination.
- if (synchronize_requests_.size() > 0) {
+ if (!synchronize_requests_.empty()) {
linked_ptr<SynchronizeCallback> callback(synchronize_requests_.front());
synchronize_requests_.pop();
callback->Run();
@@ -441,7 +441,7 @@ void GpuProcessHostUIShim::OnSynchronizeReply() {
}
void GpuProcessHostUIShim::OnCommandBufferCreated(const int32 route_id) {
- if (create_command_buffer_requests_.size() > 0) {
+ if (!create_command_buffer_requests_.empty()) {
linked_ptr<CreateCommandBufferCallback> callback =
create_command_buffer_requests_.front();
create_command_buffer_requests_.pop();
diff --git a/chrome/browser/history/history_publisher_win.cc b/chrome/browser/history/history_publisher_win.cc
index 4aeb333..f54be58 100644
--- a/chrome/browser/history/history_publisher_win.cc
+++ b/chrome/browser/history/history_publisher_win.cc
@@ -105,7 +105,7 @@ bool HistoryPublisher::ReadRegisteredIndexersFromRegistry() {
kRegKeyRegisteredIndexersInfo, &indexers_);
AddRegisteredIndexers(HKEY_LOCAL_MACHINE,
kRegKeyRegisteredIndexersInfo, &indexers_);
- return indexers_.size() > 0;
+ return !indexers_.empty();
}
void HistoryPublisher::PublishDataToIndexers(const PageData& page_data)
diff --git a/chrome/browser/history/history_types.cc b/chrome/browser/history/history_types.cc
index 65b1935..9f56ff0 100644
--- a/chrome/browser/history/history_types.cc
+++ b/chrome/browser/history/history_types.cc
@@ -174,7 +174,7 @@ const size_t* QueryResults::MatchesForURL(const GURL& url,
// All entries in the map should have at least one index, otherwise it
// shouldn't be in the map.
- DCHECK(found->second->size() > 0);
+ DCHECK(!found->second->empty());
if (num_matches)
*num_matches = found->second->size();
return &found->second->front();
diff --git a/chrome/browser/history/query_parser.cc b/chrome/browser/history/query_parser.cc
index 1037b6c..a5447f6 100644
--- a/chrome/browser/history/query_parser.cc
+++ b/chrome/browser/history/query_parser.cc
@@ -245,7 +245,7 @@ QueryParser::QueryParser() {
// static
bool QueryParser::IsWordLongEnoughForPrefixSearch(const string16& word) {
- DCHECK(word.size() > 0);
+ DCHECK(!word.empty());
size_t minimum_length = 3;
// We intentionally exclude Hangul Jamos (both Conjoining and compatibility)
// because they 'behave like' Latin letters. Moreover, we should
diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc
index bf68af0..31ea3a3 100644
--- a/chrome/browser/importer/firefox2_importer.cc
+++ b/chrome/browser/importer/firefox2_importer.cc
@@ -205,7 +205,7 @@ void Firefox2Importer::ImportBookmarksFile(
post_data.empty() &&
CanImportURL(GURL(url)) &&
default_urls.find(url) == default_urls.end()) {
- if (toolbar_folder > path.size() && path.size() > 0) {
+ if (toolbar_folder > path.size() && !path.empty()) {
NOTREACHED(); // error in parsing.
break;
}
diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc
index abdce9c..d051967 100644
--- a/chrome/browser/importer/ie_importer.cc
+++ b/chrome/browser/importer/ie_importer.cc
@@ -532,7 +532,7 @@ void IEImporter::ParseFavoritesFolder(const FavoritesInfo& info,
// C:\Users\Foo\Favorites\Links\Bar\Baz.url -> "Links\Bar"
FilePath::StringType relative_string =
shortcut.DirName().value().substr(favorites_path_len);
- if (relative_string.size() > 0 && FilePath::IsSeparator(relative_string[0]))
+ if (!relative_string.empty() && FilePath::IsSeparator(relative_string[0]))
relative_string = relative_string.substr(1);
FilePath relative_path(relative_string);
@@ -547,7 +547,7 @@ void IEImporter::ParseFavoritesFolder(const FavoritesInfo& info,
// Flatten the bookmarks in Link folder onto bookmark toolbar. Otherwise,
// put it into "Other bookmarks".
if (import_to_bookmark_bar() &&
- (entry.path.size() > 0 && entry.path[0] == info.links_folder)) {
+ (!entry.path.empty() && entry.path[0] == info.links_folder)) {
entry.in_toolbar = true;
entry.path.erase(entry.path.begin());
toolbar_bookmarks.push_back(entry);
diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc
index f53d1de..b5a4b0f 100644
--- a/chrome/browser/password_manager/password_store_mac.cc
+++ b/chrome/browser/password_manager/password_store_mac.cc
@@ -516,7 +516,7 @@ bool MacKeychainPasswordFormAdapter::HasPasswordsMergeableWithForm(
keychain_->Free(*i);
}
- return matches.size() != 0;
+ return !matches.empty();
}
std::vector<PasswordForm*>
diff --git a/chrome/browser/plugin_exceptions_table_model_unittest.cc b/chrome/browser/plugin_exceptions_table_model_unittest.cc
index cdfd537..ac14c86b 100644
--- a/chrome/browser/plugin_exceptions_table_model_unittest.cc
+++ b/chrome/browser/plugin_exceptions_table_model_unittest.cc
@@ -137,7 +137,7 @@ class PluginExceptionsTableModelTest : public testing::Test {
last_plugin = it->plugin_id;
}
}
- if (row_counts.size() > 0)
+ if (!row_counts.empty())
EXPECT_EQ(count, row_counts[last_plugin]);
}
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc
index dcc6c89..f857c70 100644
--- a/chrome/browser/prerender/prerender_manager.cc
+++ b/chrome/browser/prerender/prerender_manager.cc
@@ -62,7 +62,7 @@ PrerenderManager::PrerenderManager(Profile* profile)
}
PrerenderManager::~PrerenderManager() {
- while (prerender_list_.size() > 0) {
+ while (!prerender_list_.empty()) {
PrerenderContentsData data = prerender_list_.front();
prerender_list_.pop_front();
data.contents_->set_final_status(FINAL_STATUS_MANAGER_SHUTDOWN);
@@ -108,7 +108,7 @@ bool PrerenderManager::AddPreload(const GURL& url,
}
void PrerenderManager::DeleteOldEntries() {
- while (prerender_list_.size() > 0) {
+ while (!prerender_list_.empty()) {
PrerenderContentsData data = prerender_list_.front();
if (IsPrerenderElementFresh(data.start_time_))
return;
diff --git a/chrome/browser/renderer_host/web_cache_manager.cc b/chrome/browser/renderer_host/web_cache_manager.cc
index a555207..d422c33 100644
--- a/chrome/browser/renderer_host/web_cache_manager.cc
+++ b/chrome/browser/renderer_host/web_cache_manager.cc
@@ -232,7 +232,7 @@ bool WebCacheManager::AttemptTactic(
// The inactive renderers get one share of the extra memory to be divided
// among themselves.
size_t inactive_extra = 0;
- if (inactive_renderers_.size() > 0) {
+ if (!inactive_renderers_.empty()) {
++shares;
inactive_extra = total_extra / shares;
}
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index bff4026..81d57de 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -2458,7 +2458,7 @@ void SyncManager::SyncInternal::OnSyncEngineEvent(
// If passwords are enabled, they're automatically considered encrypted.
if (enabled_types.count(syncable::PASSWORDS) > 0)
encrypted_types.insert(syncable::PASSWORDS);
- if (encrypted_types.size() > 0) {
+ if (!encrypted_types.empty()) {
Cryptographer* cryptographer =
GetUserShare()->dir_manager->cryptographer();
if (!cryptographer->is_ready() && !cryptographer->has_pending_keys()) {
diff --git a/chrome/browser/sync/glue/data_type_manager_impl.cc b/chrome/browser/sync/glue/data_type_manager_impl.cc
index 2d06f80..bb89c6e 100644
--- a/chrome/browser/sync/glue/data_type_manager_impl.cc
+++ b/chrome/browser/sync/glue/data_type_manager_impl.cc
@@ -226,7 +226,7 @@ void DataTypeManagerImpl::DownloadReady() {
void DataTypeManagerImpl::StartNextType() {
// If there are any data types left to start, start the one at the
// front of the list.
- if (needs_start_.size() > 0) {
+ if (!needs_start_.empty()) {
current_dtc_ = needs_start_[0];
VLOG(1) << "Starting " << current_dtc_->name();
current_dtc_->Start(
diff --git a/chrome/browser/sync/glue/data_type_manager_impl2.cc b/chrome/browser/sync/glue/data_type_manager_impl2.cc
index b4276d1..af816fb 100644
--- a/chrome/browser/sync/glue/data_type_manager_impl2.cc
+++ b/chrome/browser/sync/glue/data_type_manager_impl2.cc
@@ -186,7 +186,7 @@ void DataTypeManagerImpl2::DownloadReady() {
void DataTypeManagerImpl2::StartNextType() {
// If there are any data types left to start, start the one at the
// front of the list.
- if (needs_start_.size() > 0) {
+ if (!needs_start_.empty()) {
current_dtc_ = needs_start_[0];
VLOG(1) << "Starting " << current_dtc_->name();
current_dtc_->Start(
diff --git a/chrome/browser/sync/glue/foreign_session_tracker.cc b/chrome/browser/sync/glue/foreign_session_tracker.cc
index 6db5c9c..e9bc9c6 100644
--- a/chrome/browser/sync/glue/foreign_session_tracker.cc
+++ b/chrome/browser/sync/glue/foreign_session_tracker.cc
@@ -23,17 +23,14 @@ bool ForeignSessionTracker::LookupAllForeignSessions(
foreign_session_map_.begin(); i != foreign_session_map_.end(); ++i) {
// Only include sessions with open tabs.
ForeignSession* foreign_session = i->second;
- if (foreign_session->windows.size() > 0 &&
+ if (!foreign_session->windows.empty() &&
!SessionModelAssociator::SessionWindowHasNoTabsToSync(
*foreign_session->windows[0])) {
sessions->push_back(foreign_session);
}
}
- if (sessions->size() > 0)
- return true;
- else
- return false;
+ return !sessions->empty();
}
bool ForeignSessionTracker::LookupSessionWindows(
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index b085d58..3815541 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -433,7 +433,7 @@ void ProfileSyncService::CreateBackend() {
}
bool ProfileSyncService::IsEncryptedDatatypeEnabled() const {
- return encrypted_types_.size() > 0;
+ return !encrypted_types_.empty();
}
void ProfileSyncService::StartUp() {
diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc
index 14a404e..5226715 100644
--- a/chrome/browser/sync/profile_sync_service_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc
@@ -271,7 +271,7 @@ class FakeServerChange {
// of the changelist.
void SetModified(int64 id) {
// Coalesce multi-property edits.
- if (changes_.size() > 0 && changes_.back().id == id &&
+ if (!changes_.empty() && changes_.back().id == id &&
changes_.back().action ==
sync_api::SyncManager::ChangeRecord::ACTION_UPDATE)
return;
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 19cb00e..372c703 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -715,7 +715,7 @@ void RenderViewContextMenu::AppendEditableItems() {
menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i),
params_.dictionary_suggestions[i]);
}
- if (params_.dictionary_suggestions.size() > 0)
+ if (!params_.dictionary_suggestions.empty())
menu_model_.AddSeparator();
// If word is misspelled, give option for "Add to dictionary"
diff --git a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm
index 9251763..ae57e26 100644
--- a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm
+++ b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm
@@ -83,9 +83,8 @@ static base::LazyInstance<ProfileControllerMap> g_profile_controller_map(
if (it == map->end()) {
// Since we don't currently support multiple profiles, this class
// has not been tested against this case.
- if (map->size() != 0) {
+ if (!map->empty())
return nil;
- }
ClearBrowsingDataController* controller =
[[self alloc] initWithProfile:profile];
diff --git a/chrome/browser/ui/cocoa/cocoa_test_helper.mm b/chrome/browser/ui/cocoa/cocoa_test_helper.mm
index b4c68d9..de9c040 100644
--- a/chrome/browser/ui/cocoa/cocoa_test_helper.mm
+++ b/chrome/browser/ui/cocoa/cocoa_test_helper.mm
@@ -111,7 +111,7 @@ void CocoaTest::TearDown() {
// started.
std::set<NSWindow*> windows_left(WindowsLeft());
- while (windows_left.size() > 0) {
+ while (!windows_left.empty()) {
// Cover delayed actions by spinning the loop at least once after
// this timeout.
const NSTimeInterval kCloseTimeoutSeconds =
diff --git a/chrome/browser/ui/cocoa/task_manager_mac.mm b/chrome/browser/ui/cocoa/task_manager_mac.mm
index 45fcea6..9ad68e3 100644
--- a/chrome/browser/ui/cocoa/task_manager_mac.mm
+++ b/chrome/browser/ui/cocoa/task_manager_mac.mm
@@ -161,7 +161,7 @@ class SortHelper {
// Use the model indices to get the new view indices of the selection, and
// set selection to that. This assumes that no rows were added or removed
// (in that case, the selection is cleared before -reloadData is called).
- if (modelSelection.size() > 0)
+ if (!modelSelection.empty())
DCHECK_EQ([tableView_ numberOfRows], model_->ResourceCount());
NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet];
for (size_t i = 0; i < modelSelection.size(); ++i)
diff --git a/chrome/browser/ui/gtk/dialogs_gtk.cc b/chrome/browser/ui/gtk/dialogs_gtk.cc
index 5c18ddb..10d9d57 100644
--- a/chrome/browser/ui/gtk/dialogs_gtk.cc
+++ b/chrome/browser/ui/gtk/dialogs_gtk.cc
@@ -299,7 +299,7 @@ void SelectFileDialogImpl::AddFilters(GtkFileChooser* chooser) {
// Add the *.* filter, but only if we have added other filters (otherwise it
// is implied).
- if (file_types_.include_all_files && file_types_.extensions.size() > 0) {
+ if (file_types_.include_all_files && !file_types_.extensions.empty()) {
GtkFileFilter* filter = gtk_file_filter_new();
gtk_file_filter_add_pattern(filter, "*");
gtk_file_filter_set_name(filter,
diff --git a/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc b/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc
index 2d21122..13d77f2 100644
--- a/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc
+++ b/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc
@@ -122,7 +122,7 @@ void PasswordsExceptionsPageGtk::SetExceptionList(
COL_SITE,
UTF16ToUTF8(net::FormatUrl(result[i]->origin, languages)).c_str(), -1);
}
- gtk_widget_set_sensitive(remove_all_button_, result.size() > 0);
+ gtk_widget_set_sensitive(remove_all_button_, !result.empty());
}
void PasswordsExceptionsPageGtk::OnRemoveButtonClicked(GtkWidget* widget) {
@@ -149,7 +149,7 @@ void PasswordsExceptionsPageGtk::OnRemoveButtonClicked(GtkWidget* widget) {
delete exception_list_[index];
exception_list_.erase(exception_list_.begin() + index);
- gtk_widget_set_sensitive(remove_all_button_, exception_list_.size() > 0);
+ gtk_widget_set_sensitive(remove_all_button_, !exception_list_.empty());
}
void PasswordsExceptionsPageGtk::OnRemoveAllButtonClicked(GtkWidget* widget) {
diff --git a/chrome/browser/ui/gtk/options/passwords_page_gtk.cc b/chrome/browser/ui/gtk/options/passwords_page_gtk.cc
index 6eb3b0b..e26cea0 100644
--- a/chrome/browser/ui/gtk/options/passwords_page_gtk.cc
+++ b/chrome/browser/ui/gtk/options/passwords_page_gtk.cc
@@ -165,7 +165,7 @@ void PasswordsPageGtk::SetPasswordList(
UTF16ToUTF8(net::FormatUrl(result[i]->origin, languages)).c_str(),
COL_USERNAME, UTF16ToUTF8(result[i]->username_value).c_str(), -1);
}
- gtk_widget_set_sensitive(remove_all_button_, result.size() > 0);
+ gtk_widget_set_sensitive(remove_all_button_, !result.empty());
}
void PasswordsPageGtk::HidePassword() {
@@ -222,7 +222,7 @@ void PasswordsPageGtk::OnRemoveButtonClicked(GtkWidget* widget) {
delete password_list_[index];
password_list_.erase(password_list_.begin() + index);
- gtk_widget_set_sensitive(remove_all_button_, password_list_.size() > 0);
+ gtk_widget_set_sensitive(remove_all_button_, !password_list_.empty());
}
void PasswordsPageGtk::OnRemoveAllButtonClicked(GtkWidget* widget) {
diff --git a/chrome/browser/ui/gtk/rounded_window.cc b/chrome/browser/ui/gtk/rounded_window.cc
index 3f8b6e4..79e38e7 100644
--- a/chrome/browser/ui/gtk/rounded_window.cc
+++ b/chrome/browser/ui/gtk/rounded_window.cc
@@ -232,7 +232,7 @@ gboolean OnRoundedWindowExpose(GtkWidget* widget,
// If we want to have borders everywhere, we need to draw a polygon instead
// of a set of lines.
gdk_draw_polygon(drawable, gc, FALSE, &points[0], points.size());
- } else if (points.size() > 0) {
+ } else if (!points.empty()) {
gdk_draw_lines(drawable, gc, &points[0], points.size());
}
diff --git a/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc b/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc
index 13fa63c..00a42b1 100644
--- a/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc
+++ b/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc
@@ -52,7 +52,7 @@ TEST_F(EncodingMenuControllerTest, ListEncodingMenuItems) {
controller.GetEncodingMenuItems(&profile_en, &english_items);
// Make sure there are items in the lists.
- ASSERT_TRUE(english_items.size() > 0);
+ ASSERT_FALSE(english_items.empty());
// Make sure that autodetect is the first item on both menus
ASSERT_EQ(english_items[0].first, IDC_ENCODING_AUTO_DETECT);
}
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
index 1a5eadb..84bc69d 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
@@ -256,7 +256,7 @@ bool BookmarkContextMenuControllerViews::IsCommandEnabled(int id) const {
case IDC_COPY:
case IDC_CUT:
- return selection_.size() > 0 && !is_root_node;
+ return !selection_.empty() && !is_root_node;
case IDC_PASTE:
// Paste to selection from the Bookmark Bar, to parent_ everywhere else
diff --git a/chrome/browser/ui/views/download_shelf_view.cc b/chrome/browser/ui/views/download_shelf_view.cc
index 04c713d..b37804f 100644
--- a/chrome/browser/ui/views/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download_shelf_view.cc
@@ -211,7 +211,7 @@ gfx::Size DownloadShelfView::GetPreferredSize() {
AdjustSize(close_button_, &prefsize);
AdjustSize(show_all_view_, &prefsize);
// Add one download view to the preferred size.
- if (download_views_.size() > 0) {
+ if (!download_views_.empty()) {
AdjustSize(*download_views_.begin(), &prefsize);
prefsize.Enlarge(kDownloadPadding, 0);
}
diff --git a/chrome/browser/ui/webui/bug_report_ui.cc b/chrome/browser/ui/webui/bug_report_ui.cc
index 82ced3a..1b459bf 100644
--- a/chrome/browser/ui/webui/bug_report_ui.cc
+++ b/chrome/browser/ui/webui/bug_report_ui.cc
@@ -633,9 +633,8 @@ void BugReportHandler::HandleSendReport(const ListValue* list_value) {
// Get the image to send in the report.
std::vector<unsigned char> image;
- if (screenshot_path.size() > 0) {
+ if (!screenshot_path.empty())
image = screenshot_source_->GetScreenshot(screenshot_path);
- }
#if defined(OS_CHROMEOS)
if (++i == list_value->end()) {
diff --git a/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm b/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm
index d3f7c50..5c3253f 100644
--- a/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm
+++ b/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm
@@ -35,7 +35,7 @@ gfx::Rect GrabWindowSnapshot(gfx::NativeWindow window,
return gfx::Rect();
png_representation->assign(buf, buf + length);
- DCHECK(png_representation->size() > 0);
+ DCHECK(!png_representation->empty());
return gfx::Rect(static_cast<int>([rep pixelsWide]),
static_cast<int>([rep pixelsHigh]));
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index ac635fa..35f4d49 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -948,7 +948,7 @@ void WebDataService::RemoveFormElementsAddedBetweenImpl(
if (db_->RemoveFormElementsAddedBetween(request->GetArgument1(),
request->GetArgument2(),
&changes)) {
- if (changes.size() > 0) {
+ if (!changes.empty()) {
request->SetResult(
new WDResult<AutofillChangeList>(AUTOFILL_CHANGES, changes));
diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc
index d9d19ae..0e7827b 100644
--- a/chrome/browser/webdata/web_database_unittest.cc
+++ b/chrome/browser/webdata/web_database_unittest.cc
@@ -91,7 +91,7 @@ bool CompareAutofillEntries(const AutofillEntry& a, const AutofillEntry& b) {
timestamps2.erase(*it);
}
- return timestamps2.size() != 0U;
+ return !timestamps2.empty();
}
void AutoFillProfile31FromStatement(const sql::Statement& s,
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index eecf6a9..c979d24 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -349,7 +349,7 @@ bool Extension::IsElevatedHostList(
old_hosts_set.begin(), old_hosts_set.end(),
std::inserter(new_hosts_only, new_hosts_only.begin()));
- return new_hosts_only.size() > 0;
+ return !new_hosts_only.empty();
}
// static
@@ -1434,7 +1434,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
return false;
}
- if (icon_path.size() > 0 && icon_path[0] == '/')
+ if (!icon_path.empty() && icon_path[0] == '/')
icon_path = icon_path.substr(1);
if (icon_path.empty()) {
@@ -2318,7 +2318,7 @@ bool Extension::HasEffectiveAccessToAllHosts() const {
}
bool Extension::HasFullPermissions() const {
- return plugins().size() > 0;
+ return !plugins().empty();
}
bool Extension::ShowConfigureContextMenus() const {
diff --git a/chrome/common/extensions/extension_icon_set.cc b/chrome/common/extensions/extension_icon_set.cc
index fc1ac58..9b47c7d 100644
--- a/chrome/common/extensions/extension_icon_set.cc
+++ b/chrome/common/extensions/extension_icon_set.cc
@@ -15,7 +15,7 @@ void ExtensionIconSet::Clear() {
}
void ExtensionIconSet::Add(int size, const std::string& path) {
- CHECK(path.size() > 0 && path[0] != '/');
+ CHECK(!path.empty() && path[0] != '/');
map_[size] = path;
}
diff --git a/chrome/common/extensions/update_manifest.cc b/chrome/common/extensions/update_manifest.cc
index 4e1cdd5..8970aa5 100644
--- a/chrome/common/extensions/update_manifest.cc
+++ b/chrome/common/extensions/update_manifest.cc
@@ -242,7 +242,7 @@ bool UpdateManifest::Parse(const std::string& manifest_xml) {
// Parse the first <daystart> if it's present.
std::vector<xmlNode*> daystarts = GetChildren(root, gupdate_ns, "daystart");
- if (daystarts.size() > 0) {
+ if (!daystarts.empty()) {
xmlNode* first = daystarts[0];
std::string elapsed_seconds = GetAttribute(first, "elapsed_seconds");
int parsed_elapsed = kNoDaystart;
diff --git a/chrome/common/extensions/user_script.cc b/chrome/common/extensions/user_script.cc
index f71de5c..b66dee94 100644
--- a/chrome/common/extensions/user_script.cc
+++ b/chrome/common/extensions/user_script.cc
@@ -79,17 +79,17 @@ void UserScript::add_url_pattern(const URLPattern& pattern) {
void UserScript::clear_url_patterns() { url_patterns_.clear(); }
bool UserScript::MatchesUrl(const GURL& url) const {
- if (url_patterns_.size() > 0) {
+ if (!url_patterns_.empty()) {
if (!UrlMatchesPatterns(&url_patterns_, url))
return false;
}
- if (globs_.size() > 0) {
+ if (!globs_.empty()) {
if (!UrlMatchesGlobs(&globs_, url))
return false;
}
- if (exclude_globs_.size() > 0) {
+ if (!exclude_globs_.empty()) {
if (UrlMatchesGlobs(&exclude_globs_, url))
return false;
}
diff --git a/chrome/common/unix_domain_socket_posix.cc b/chrome/common/unix_domain_socket_posix.cc
index 7621b7e..6bd387b 100644
--- a/chrome/common/unix_domain_socket_posix.cc
+++ b/chrome/common/unix_domain_socket_posix.cc
@@ -127,7 +127,7 @@ ssize_t UnixDomainSocket::SendRecvMsg(int fd,
if (reply_len == -1)
return -1;
- if ((fd_vector.size() > 0 && result_fd == NULL) || fd_vector.size() > 1) {
+ if ((!fd_vector.empty() && result_fd == NULL) || fd_vector.size() > 1) {
for (std::vector<int>::const_iterator
i = fd_vector.begin(); i != fd_vector.end(); ++i) {
close(*i);
@@ -138,13 +138,8 @@ ssize_t UnixDomainSocket::SendRecvMsg(int fd,
return -1;
}
- if (result_fd) {
- if (fd_vector.empty()) {
- *result_fd = -1;
- } else {
- *result_fd = fd_vector[0];
- }
- }
+ if (result_fd)
+ *result_fd = fd_vector.empty() ? -1 : fd_vector[0];
return reply_len;
}
diff --git a/chrome/common/web_apps_unittest.cc b/chrome/common/web_apps_unittest.cc
index fc8b121..de332ac 100644
--- a/chrome/common/web_apps_unittest.cc
+++ b/chrome/common/web_apps_unittest.cc
@@ -178,7 +178,7 @@ TEST(WebAppInfo, ParseIconSizes) {
if (result) {
ASSERT_EQ(data[i].is_any, is_any);
ASSERT_EQ(data[i].expected_size_count, sizes.size());
- if (sizes.size() > 0) {
+ if (!sizes.empty()) {
ASSERT_EQ(data[i].width1, sizes[0].width());
ASSERT_EQ(data[i].height1, sizes[0].height());
}
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index d1eeaf1..31771cd 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -1083,7 +1083,7 @@ void RenderThread::OnGpuChannelEstablished(
const GPUInfo& gpu_info) {
gpu_channel_->set_gpu_info(gpu_info);
- if (channel_handle.name.size() != 0) {
+ if (!channel_handle.name.empty()) {
// Connect to the GPU process if a channel name was received.
gpu_channel_->Connect(channel_handle, renderer_process_for_gpu);
} else {
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
index 52f8440..dfcfad9 100644
--- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
+++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
@@ -631,7 +631,7 @@ WebGraphicsContext3DCommandBufferImpl::getContextAttributes() {
}
WGC3Denum WebGraphicsContext3DCommandBufferImpl::getError() {
- if (synthetic_errors_.size() > 0) {
+ if (!synthetic_errors_.empty()) {
std::vector<WGC3Denum>::iterator iter = synthetic_errors_.begin();
WGC3Denum err = *iter;
synthetic_errors_.erase(iter);
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index bc65843..340b81a 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -1341,7 +1341,7 @@ void WebPluginDelegateProxy::CopyFromTransportToBacking(const gfx::Rect& rect) {
rect.y() * stride + 4 * rect.x();
// The two bitmaps are flipped relative to each other.
int dest_starting_row = plugin_rect_.height() - rect.y() - 1;
- DCHECK(backing_store_.size() > 0);
+ DCHECK(!backing_store_.empty());
uint8* target_data = &(backing_store_[0]) + dest_starting_row * stride +
4 * rect.x();
for (int row = 0; row < rect.height(); ++row) {
diff --git a/chrome/renderer/webworker_base.h b/chrome/renderer/webworker_base.h
index d8814ca..1acdb8f 100644
--- a/chrome/renderer/webworker_base.h
+++ b/chrome/renderer/webworker_base.h
@@ -53,7 +53,7 @@ class WebWorkerBase : public IPC::Channel::Listener {
bool Send(IPC::Message*);
// Returns true if there are queued messages.
- bool HasQueuedMessages() { return queued_messages_.size() != 0; }
+ bool HasQueuedMessages() { return !queued_messages_.empty(); }
// Sends any messages currently in the queue.
void SendQueuedMessages();
diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc
index bed39d3..e4c1161 100644
--- a/chrome/test/reliability/page_load_test.cc
+++ b/chrome/test/reliability/page_load_test.cc
@@ -291,7 +291,7 @@ class PageLoadTest : public UITest {
bool do_log = log_file.is_open() &&
(!log_only_error ||
metrics.result != NAVIGATION_SUCCESS ||
- new_crash_dumps.size() > 0);
+ !new_crash_dumps.empty());
if (do_log) {
log_file << url_string;
switch (metrics.result) {
diff --git a/chrome/test/url_fetch_test/url_fetch_test.cc b/chrome/test/url_fetch_test/url_fetch_test.cc
index 5f1607c..d9f028b 100644
--- a/chrome/test/url_fetch_test/url_fetch_test.cc
+++ b/chrome/test/url_fetch_test/url_fetch_test.cc
@@ -177,13 +177,13 @@ TEST_F(UrlFetchTest, UrlFetch) {
// Write out the cookie if requested
FilePath cookie_output_path =
cmd_line->GetSwitchValuePath("wait_cookie_output");
- if (cookie_output_path.value().size() > 0) {
+ if (!cookie_output_path.value().empty()) {
ASSERT_TRUE(WriteValueToFile(result.cookie_value, cookie_output_path));
}
// Write out the JS Variable if requested
FilePath jsvar_output_path = cmd_line->GetSwitchValuePath("jsvar_output");
- if (jsvar_output_path.value().size() > 0) {
+ if (!jsvar_output_path.value().empty()) {
ASSERT_TRUE(WriteValueToFile(result.javascript_variable,
jsvar_output_path));
}
diff --git a/chrome/tools/crash_service/crash_service.cc b/chrome/tools/crash_service/crash_service.cc
index e672880..ed31107 100644
--- a/chrome/tools/crash_service/crash_service.cc
+++ b/chrome/tools/crash_service/crash_service.cc
@@ -40,7 +40,7 @@ bool CustomInfoToMap(const google_breakpad::ClientInfo* client_info,
(*map)[L"rept"] = reporter_tag;
- return (map->size() > 0);
+ return !map->empty();
}
bool WriteCustomInfoToFile(const std::wstring& dump_path, const CrashMap& map) {