| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/dom_distiller/core/dom_distiller_store.h" | 5 #include "components/dom_distiller/core/dom_distiller_store.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 DomDistillerObserver::ArticleUpdate::REMOVE; | 340 DomDistillerObserver::ArticleUpdate::REMOVE; |
| 341 break; | 341 break; |
| 342 case SyncChange::ACTION_INVALID: | 342 case SyncChange::ACTION_INVALID: |
| 343 NOTREACHED(); | 343 NOTREACHED(); |
| 344 break; | 344 break; |
| 345 } | 345 } |
| 346 const ArticleEntry& entry = GetEntryFromChange(*it); | 346 const ArticleEntry& entry = GetEntryFromChange(*it); |
| 347 article_update.entry_id = entry.entry_id(); | 347 article_update.entry_id = entry.entry_id(); |
| 348 article_changes.push_back(article_update); | 348 article_changes.push_back(article_update); |
| 349 } | 349 } |
| 350 FOR_EACH_OBSERVER(DomDistillerObserver, observers_, | 350 for (DomDistillerObserver& observer : observers_) |
| 351 ArticleEntriesUpdated(article_changes)); | 351 observer.ArticleEntriesUpdated(article_changes); |
| 352 } | 352 } |
| 353 } | 353 } |
| 354 | 354 |
| 355 void DomDistillerStore::ApplyChangesToModel(const SyncChangeList& changes, | 355 void DomDistillerStore::ApplyChangesToModel(const SyncChangeList& changes, |
| 356 SyncChangeList* changes_applied, | 356 SyncChangeList* changes_applied, |
| 357 SyncChangeList* changes_missing) { | 357 SyncChangeList* changes_missing) { |
| 358 model_.ApplyChangesToModel(changes, changes_applied, changes_missing); | 358 model_.ApplyChangesToModel(changes, changes_applied, changes_missing); |
| 359 NotifyObservers(*changes_applied); | 359 NotifyObservers(*changes_applied); |
| 360 } | 360 } |
| 361 | 361 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 result.set_num_items_deleted(0); | 485 result.set_num_items_deleted(0); |
| 486 | 486 |
| 487 result.set_pre_association_version(0); | 487 result.set_pre_association_version(0); |
| 488 result.set_num_items_after_association(model_.GetNumEntries()); | 488 result.set_num_items_after_association(model_.GetNumEntries()); |
| 489 result.set_error(error); | 489 result.set_error(error); |
| 490 | 490 |
| 491 return result; | 491 return result; |
| 492 } | 492 } |
| 493 | 493 |
| 494 } // namespace dom_distiller | 494 } // namespace dom_distiller |
| OLD | NEW |