| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 280 |
| 281 // syncer::SyncableService implementation. | 281 // syncer::SyncableService implementation. |
| 282 SyncMergeResult DomDistillerStore::MergeDataAndStartSyncing( | 282 SyncMergeResult DomDistillerStore::MergeDataAndStartSyncing( |
| 283 ModelType type, | 283 ModelType type, |
| 284 const SyncDataList& initial_sync_data, | 284 const SyncDataList& initial_sync_data, |
| 285 std::unique_ptr<syncer::SyncChangeProcessor> sync_processor, | 285 std::unique_ptr<syncer::SyncChangeProcessor> sync_processor, |
| 286 std::unique_ptr<syncer::SyncErrorFactory> error_handler) { | 286 std::unique_ptr<syncer::SyncErrorFactory> error_handler) { |
| 287 DCHECK_EQ(syncer::ARTICLES, type); | 287 DCHECK_EQ(syncer::ARTICLES, type); |
| 288 DCHECK(!sync_processor_); | 288 DCHECK(!sync_processor_); |
| 289 DCHECK(!error_factory_); | 289 DCHECK(!error_factory_); |
| 290 sync_processor_.reset(sync_processor.release()); | 290 sync_processor_ = std::move(sync_processor); |
| 291 error_factory_.reset(error_handler.release()); | 291 error_factory_ = std::move(error_handler); |
| 292 | 292 |
| 293 SyncChangeList database_changes; | 293 SyncChangeList database_changes; |
| 294 SyncChangeList sync_changes; | 294 SyncChangeList sync_changes; |
| 295 SyncMergeResult result = | 295 SyncMergeResult result = |
| 296 MergeDataWithModel(initial_sync_data, &database_changes, &sync_changes); | 296 MergeDataWithModel(initial_sync_data, &database_changes, &sync_changes); |
| 297 ApplyChangesToDatabase(database_changes); | 297 ApplyChangesToDatabase(database_changes); |
| 298 ApplyChangesToSync(FROM_HERE, sync_changes); | 298 ApplyChangesToSync(FROM_HERE, sync_changes); |
| 299 | 299 |
| 300 return result; | 300 return result; |
| 301 } | 301 } |
| (...skipping 183 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 |