diff options
author | skym <skym@chromium.org> | 2016-02-18 08:49:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-18 16:50:14 +0000 |
commit | 7768f7921b58b662eae42803534c3efa9a88c1a7 (patch) | |
tree | 51dee692747830458fdd88d6713bfbffdf4d0882 | |
parent | 957c61bfcaf782c29902e2a1373881f582760de3 (diff) | |
download | chromium_src-7768f7921b58b662eae42803534c3efa9a88c1a7.zip chromium_src-7768f7921b58b662eae42803534c3efa9a88c1a7.tar.gz chromium_src-7768f7921b58b662eae42803534c3efa9a88c1a7.tar.bz2 |
Removing USS DeviceInfo backup time.
Spoke with zea@, sounds like we're not ready to remove the rollback logic, but with the assumption this is imminent, lets simplify the USS implementation.
BUG=543404
Review URL: https://codereview.chromium.org/1694643002
Cr-Commit-Position: refs/heads/master@{#376180}
-rw-r--r-- | components/sync_driver/device_info_service.cc | 37 | ||||
-rw-r--r-- | components/sync_driver/device_info_service.h | 20 |
2 files changed, 1 insertions, 56 deletions
diff --git a/components/sync_driver/device_info_service.cc b/components/sync_driver/device_info_service.cc index 50b0d1a..012040d 100644 --- a/components/sync_driver/device_info_service.cc +++ b/components/sync_driver/device_info_service.cc @@ -12,7 +12,6 @@ #include "sync/api/sync_error.h" #include "sync/protocol/data_type_state.pb.h" #include "sync/protocol/sync.pb.h" -#include "sync/util/time.h" namespace sync_driver_v2 { @@ -34,8 +33,7 @@ using Result = ModelTypeStore::Result; DeviceInfoService::DeviceInfoService( sync_driver::LocalDeviceInfoProvider* local_device_info_provider, const StoreFactoryFunction& callback) - : local_device_backup_time_(-1), - local_device_info_provider_(local_device_info_provider), + : local_device_info_provider_(local_device_info_provider), weak_factory_(this) { DCHECK(local_device_info_provider); @@ -128,45 +126,12 @@ void DeviceInfoService::NotifyObservers() { FOR_EACH_OBSERVER(Observer, observers_, OnDeviceInfoChange()); } -void DeviceInfoService::UpdateLocalDeviceBackupTime(base::Time backup_time) { - // TODO(skym): crbug.com/582460: Replace with is initialized check, we've - // already started syncing, provider is ready, make sure we have processor. - - // Local device info must be available in advance. - DCHECK(local_device_info_provider_->GetLocalDeviceInfo()); - - // TODO(skym): crbug.com/582460: Less than instead of not equal check? - if (GetLocalDeviceBackupTime() != backup_time) { - // TODO(skym): crbug.com/582460: Storing this field doesn't really make - // sense. - set_local_device_backup_time(syncer::TimeToProtoTime(backup_time)); - scoped_ptr<DeviceInfoSpecifics> new_specifics = CreateLocalSpecifics(); - - // TODO(skym): crbug.com/543406: Create EntityChange and pass to SMTP - // through ProcessChanges. - // TODO(skym): crbug.com/543405: Persist metadata and data. - StoreSpecifics(std::move(new_specifics)); - } - - // Don't call NotifyObservers() because backup time is not part of - // DeviceInfoTracker interface. -} - -base::Time DeviceInfoService::GetLocalDeviceBackupTime() const { - return has_local_device_backup_time() - ? syncer::ProtoTimeToTime(local_device_backup_time()) - : base::Time(); -} - // TODO(skym): crbug.com/543406: It might not make sense for this to be a // scoped_ptr. scoped_ptr<DeviceInfoSpecifics> DeviceInfoService::CreateLocalSpecifics() { const DeviceInfo* info = local_device_info_provider_->GetLocalDeviceInfo(); DCHECK(info); scoped_ptr<DeviceInfoSpecifics> specifics = CreateSpecifics(*info); - if (has_local_device_backup_time()) { - specifics->set_backup_timestamp(local_device_backup_time()); - } // TODO(skym): crbug.com:543406: Local tag and non unique name have no place // to be set now. return specifics; diff --git a/components/sync_driver/device_info_service.h b/components/sync_driver/device_info_service.h index f6ab854..ec5f99e 100644 --- a/components/sync_driver/device_info_service.h +++ b/components/sync_driver/device_info_service.h @@ -70,11 +70,6 @@ class DeviceInfoService : public syncer_v2::ModelTypeService, void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override; - // Called to update local device backup time. - void UpdateLocalDeviceBackupTime(base::Time backup_time); - // Gets the most recently set local device backup time. - base::Time GetLocalDeviceBackupTime() const; - private: friend class DeviceInfoServiceTest; @@ -118,21 +113,6 @@ class DeviceInfoService : public syncer_v2::ModelTypeService, // current processor if able. void TryLoadAllMetadata(); - // |local_device_backup_time_| accessors. - int64_t local_device_backup_time() const { return local_device_backup_time_; } - bool has_local_device_backup_time() const { - return local_device_backup_time_ >= 0; - } - void set_local_device_backup_time(int64_t value) { - local_device_backup_time_ = value; - } - void clear_local_device_backup_time() { local_device_backup_time_ = -1; } - - // TODO(skym): crbug.com/582460: Remove once we remove local provider. - // Local device last set backup time (in proto format). - // -1 if the value hasn't been specified - int64_t local_device_backup_time_; - // |local_device_info_provider_| isn't owned. const sync_driver::LocalDeviceInfoProvider* const local_device_info_provider_; |