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

Unified Diff: ui/app_list/app_list_item_list.cc

Issue 487853003: Add additional CHECKs to AppListModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + feedback Created 6 years, 4 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 | « no previous file | ui/app_list/app_list_item_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/app_list_item_list.cc
diff --git a/ui/app_list/app_list_item_list.cc b/ui/app_list/app_list_item_list.cc
index 801f923ae2880c961e1776802db5f38f1cac6f7f..c8d96e2aec1a7c35ffd54ebf6079fbdd45f21b98 100644
--- a/ui/app_list/app_list_item_list.cc
+++ b/ui/app_list/app_list_item_list.cc
@@ -166,17 +166,15 @@ void AppListItemList::DeleteItem(const std::string& id) {
// |item| will be deleted on destruction.
}
-scoped_ptr<AppListItem> AppListItemList::RemoveItem(
- const std::string& id) {
+scoped_ptr<AppListItem> AppListItemList::RemoveItem(const std::string& id) {
size_t index;
- if (FindItemIndex(id, &index))
- return RemoveItemAt(index);
-
- return scoped_ptr<AppListItem>();
+ if (!FindItemIndex(id, &index))
+ LOG(FATAL) << "RemoveItem: Not found: " << id;
+ return RemoveItemAt(index);
}
scoped_ptr<AppListItem> AppListItemList::RemoveItemAt(size_t index) {
- DCHECK_LT(index, item_count());
+ CHECK_LT(index, item_count());
AppListItem* item = app_list_items_[index];
app_list_items_.weak_erase(app_list_items_.begin() + index);
FOR_EACH_OBSERVER(AppListItemListObserver,
« no previous file with comments | « no previous file | ui/app_list/app_list_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698