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

Side by Side Diff: components/sync/device_info/device_info_sync_bridge.cc

Issue 2621373004: [Sync] Renamed OnMetadataLoaded to ModelReadyToSync. (Closed)
Patch Set: Rebase. Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/sync/device_info/device_info_sync_bridge.h" 5 #include "components/sync/device_info/device_info_sync_bridge.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 380 }
381 381
382 void DeviceInfoSyncBridge::OnReadAllMetadata( 382 void DeviceInfoSyncBridge::OnReadAllMetadata(
383 base::Optional<ModelError> error, 383 base::Optional<ModelError> error,
384 std::unique_ptr<MetadataBatch> metadata_batch) { 384 std::unique_ptr<MetadataBatch> metadata_batch) {
385 if (error) { 385 if (error) {
386 change_processor()->ReportError(error.value()); 386 change_processor()->ReportError(error.value());
387 return; 387 return;
388 } 388 }
389 389
390 change_processor()->OnMetadataLoaded(std::move(metadata_batch)); 390 change_processor()->ModelReadyToSync(std::move(metadata_batch));
391 ReconcileLocalAndStored(); 391 ReconcileLocalAndStored();
392 } 392 }
393 393
394 void DeviceInfoSyncBridge::OnCommit(Result result) { 394 void DeviceInfoSyncBridge::OnCommit(Result result) {
395 if (result != Result::SUCCESS) { 395 if (result != Result::SUCCESS) {
396 change_processor()->ReportError(FROM_HERE, "Failed a write to store."); 396 change_processor()->ReportError(FROM_HERE, "Failed a write to store.");
397 } 397 }
398 } 398 }
399 399
400 void DeviceInfoSyncBridge::ReconcileLocalAndStored() { 400 void DeviceInfoSyncBridge::ReconcileLocalAndStored() {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 473
474 int DeviceInfoSyncBridge::CountActiveDevices(const Time now) const { 474 int DeviceInfoSyncBridge::CountActiveDevices(const Time now) const {
475 return std::count_if(all_data_.begin(), all_data_.end(), 475 return std::count_if(all_data_.begin(), all_data_.end(),
476 [now](ClientIdToSpecifics::const_reference pair) { 476 [now](ClientIdToSpecifics::const_reference pair) {
477 return DeviceInfoUtil::IsActive( 477 return DeviceInfoUtil::IsActive(
478 GetLastUpdateTime(*pair.second), now); 478 GetLastUpdateTime(*pair.second), now);
479 }); 479 });
480 } 480 }
481 481
482 } // namespace syncer 482 } // namespace syncer
OLDNEW
« no previous file with comments | « components/reading_list/ios/reading_list_store.cc ('k') | components/sync/device_info/device_info_sync_bridge_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698