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

Unified Diff: components/sync_driver/local_device_info_provider.h

Issue 1951703002: [Sync] Clear LocalDeviceInfoProvider cache on sync DB destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move NonThreadSafe to LocalDeviceInfoProviderImpl. 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
Index: components/sync_driver/local_device_info_provider.h
diff --git a/components/sync_driver/local_device_info_provider.h b/components/sync_driver/local_device_info_provider.h
index 69ac03a3562ef19adc2accaedf636674240d4812..2c7c283ab1fa03ed4c2fb33f437efcf0d2666c32 100644
--- a/components/sync_driver/local_device_info_provider.h
+++ b/components/sync_driver/local_device_info_provider.h
@@ -26,11 +26,10 @@ class LocalDeviceInfoProvider {
virtual ~LocalDeviceInfoProvider() {}
- // Returns sync's representation of the local device info;
- // NULL if the device info is unavailable.
- // The returned object is fully owned by LocalDeviceInfoProvider (must not
- // be freed by the caller). It remains valid until LocalDeviceInfoProvider
- // is destroyed.
+ // Returns sync's representation of the local device info, or nullptr if the
+ // device info is unavailable. The returned object is fully owned by
+ // LocalDeviceInfoProvider; it must not be freed by the caller and should not
+ // be stored.
virtual const DeviceInfo* GetLocalDeviceInfo() const = 0;
// Constructs a user agent string (ASCII) suitable for use by the syncapi
@@ -55,6 +54,9 @@ class LocalDeviceInfoProvider {
// CallbackList is destroyed.
virtual std::unique_ptr<Subscription> RegisterOnInitializedCallback(
const base::Closure& callback) = 0;
+
+ // Clears all cached data, returning to an uninitialized state.
+ virtual void Clear() = 0;
};
} // namespace sync_driver

Powered by Google App Engine
This is Rietveld 408576698