Chromium Code Reviews| 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 |