| Index: ios/chrome/browser/reading_list/reading_list_download_service.cc
|
| diff --git a/ios/chrome/browser/reading_list/reading_list_download_service.cc b/ios/chrome/browser/reading_list/reading_list_download_service.cc
|
| index fcd385128e65480e6f957abe59b51327a6e11042..e7e0ce69c65bc3dd4262f95c32519a8b86608aef 100644
|
| --- a/ios/chrome/browser/reading_list/reading_list_download_service.cc
|
| +++ b/ios/chrome/browser/reading_list/reading_list_download_service.cc
|
| @@ -58,28 +58,16 @@ void ReadingListDownloadService::ReadingListModelLoaded(
|
| DownloadAllEntries();
|
| }
|
|
|
| -void ReadingListDownloadService::ReadingListWillRemoveReadEntry(
|
| +void ReadingListDownloadService::ReadingListWillRemoveEntry(
|
| const ReadingListModel* model,
|
| - size_t index) {
|
| + const GURL& url) {
|
| DCHECK_EQ(reading_list_model_, model);
|
| - RemoveDownloadedEntry(model->GetReadEntryAtIndex(index));
|
| + const ReadingListEntry* entry = model->GetEntryFromURL(url);
|
| + DCHECK(entry);
|
| + RemoveDownloadedEntry(*entry);
|
| }
|
|
|
| -void ReadingListDownloadService::ReadingListWillRemoveUnreadEntry(
|
| - const ReadingListModel* model,
|
| - size_t index) {
|
| - DCHECK_EQ(reading_list_model_, model);
|
| - RemoveDownloadedEntry(model->GetUnreadEntryAtIndex(index));
|
| -}
|
| -
|
| -void ReadingListDownloadService::ReadingListWillAddUnreadEntry(
|
| - const ReadingListModel* model,
|
| - const ReadingListEntry& entry) {
|
| - DCHECK_EQ(reading_list_model_, model);
|
| - ScheduleDownloadEntry(entry);
|
| -}
|
| -
|
| -void ReadingListDownloadService::ReadingListWillAddReadEntry(
|
| +void ReadingListDownloadService::ReadingListWillAddEntry(
|
| const ReadingListModel* model,
|
| const ReadingListEntry& entry) {
|
| DCHECK_EQ(reading_list_model_, model);
|
| @@ -90,14 +78,15 @@ void ReadingListDownloadService::DownloadAllEntries() {
|
| DCHECK(reading_list_model_->loaded());
|
| size_t size = reading_list_model_->unread_size();
|
| for (size_t i = 0; i < size; i++) {
|
| - const ReadingListEntry& entry =
|
| - reading_list_model_->GetUnreadEntryAtIndex(i);
|
| - this->ScheduleDownloadEntry(entry);
|
| + const ReadingListEntry* entry = reading_list_model_->GetUnreadEntryAt(i);
|
| + DCHECK(entry);
|
| + this->ScheduleDownloadEntry(*entry);
|
| }
|
| size = reading_list_model_->read_size();
|
| for (size_t i = 0; i < size; i++) {
|
| - const ReadingListEntry& entry = reading_list_model_->GetReadEntryAtIndex(i);
|
| - this->ScheduleDownloadEntry(entry);
|
| + const ReadingListEntry* entry = reading_list_model_->GetReadEntryAt(i);
|
| + DCHECK(entry);
|
| + this->ScheduleDownloadEntry(*entry);
|
| }
|
| }
|
|
|
|
|