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

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: Created 4 years, 8 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..538991f1ba503d65a07478ca569232b45eb6b076 100644
--- a/components/sync_driver/local_device_info_provider.h
+++ b/components/sync_driver/local_device_info_provider.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/callback_list.h"
+#include "base/threading/non_thread_safe.h"
namespace base {
class TaskRunner;
@@ -20,17 +21,16 @@ class DeviceInfo;
// Interface for providing sync specific information about the
// local device.
-class LocalDeviceInfoProvider {
+class LocalDeviceInfoProvider : public base::NonThreadSafe {
pavely 2016/05/04 22:22:10 LocalDeviceInfoProvider is an interface while NonT
maxbogue 2016/05/04 23:19:47 Done.
public:
typedef base::CallbackList<void(void)>::Subscription Subscription;
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 +55,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