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

Unified Diff: chrome/browser/ui/app_list/fast_show_pickler.cc

Issue 148403007: Protect AppListItemList Add/Remove and fix sync bugs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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
Index: chrome/browser/ui/app_list/fast_show_pickler.cc
diff --git a/chrome/browser/ui/app_list/fast_show_pickler.cc b/chrome/browser/ui/app_list/fast_show_pickler.cc
index d9568b8d6868e44fdfada4c043dd9ba978107a62..1473080e45f6faf8aec2d24c6cb4152e71f311d5 100644
--- a/chrome/browser/ui/app_list/fast_show_pickler.cc
+++ b/chrome/browser/ui/app_list/fast_show_pickler.cc
@@ -208,12 +208,12 @@ scoped_ptr<Pickle> FastShowPickler::PickleAppListModelForFastShow(
}
void FastShowPickler::CopyOver(AppListModel* src, AppListModel* dest) {
- dest->item_list()->DeleteItemsByType(NULL /* all items */);
+ DCHECK_EQ(0u, dest->item_list()->item_count());
for (size_t i = 0; i < src->item_list()->item_count(); i++) {
AppListItem* src_item = src->item_list()->item_at(i);
AppListItem* dest_item = new AppListItem(src_item->id());
CopyOverItem(src_item, dest_item);
- dest->item_list()->AddItem(dest_item);
+ dest->AddItem(dest_item);
}
}
@@ -234,7 +234,7 @@ FastShowPickler::UnpickleAppListModelForFastShow(Pickle* pickle) {
scoped_ptr<AppListItem> item(UnpickleAppListItem(&it).Pass());
if (!item)
return scoped_ptr<AppListModel>();
- model->item_list()->AddItem(item.release());
+ model->AddItem(item.release());
}
return model.Pass();

Powered by Google App Engine
This is Rietveld 408576698