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

Unified Diff: components/sync_driver/device_info_service.h

Issue 1991023002: [Sync] USS: Fix race condition in DeviceInfoService + add error handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/sync_driver/device_info_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_driver/device_info_service.h
diff --git a/components/sync_driver/device_info_service.h b/components/sync_driver/device_info_service.h
index 5fa503154dcd82eec73335f04cfe907e9332a828..d42461a1e69b7b92cb6632138b928854c121c0d3 100644
--- a/components/sync_driver/device_info_service.h
+++ b/components/sync_driver/device_info_service.h
@@ -119,11 +119,13 @@ class DeviceInfoService : public syncer_v2::ModelTypeService,
const std::string& global_metadata);
void OnCommit(syncer_v2::ModelTypeStore::Result result);
- // Checks if conditions have been met to perform reconciliation between the
- // locally provide device info and the stored device info data. If conditions
- // are met and the sets of data differ, than we condier this a local change
- // and we send it to the processor.
- void TryReconcileLocalAndStored();
+ // Load metadata if the data is loaded and the provider is initialized.
+ void LoadMetadataIfReady();
+
+ // Performs reconciliation between the locally provided device info and the
+ // stored device info data. If the sets of data differ, then we consider this
+ // a local change and we send it to the processor.
+ void ReconcileLocalAndStored();
// Stores the updated version of the local copy of device info in durable
// storage, in memory, and informs sync of the change. Should not be called
@@ -143,6 +145,10 @@ class DeviceInfoService : public syncer_v2::ModelTypeService,
// allow unit tests to control expected results.
int CountActiveDevices(const base::Time now) const;
+ // Report an error starting up to sync if it tries to connect to this
+ // datatype, since these errors prevent us from knowing if sync is enabled.
+ void ReportStartupErrorToSync(const std::string& msg);
+
// Find the timestamp for the last time this |device_info| was edited.
static base::Time GetLastUpdateTime(
const sync_pb::DeviceInfoSpecifics& specifics);
@@ -165,6 +171,8 @@ class DeviceInfoService : public syncer_v2::ModelTypeService,
// If |local_device_info_provider_| has initialized.
bool has_provider_initialized_ = false;
+ // If data has been loaded from the store.
+ bool has_data_loaded_ = false;
// if |change_processor()| has been given metadata.
bool has_metadata_loaded_ = false;
« no previous file with comments | « no previous file | components/sync_driver/device_info_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698