| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ | 5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
| 6 #define COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ | 6 #define COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/threading/non_thread_safe.h" | 13 #include "base/sequence_checker.h" |
| 14 #include "components/sync/device_info/device_info.h" | 14 #include "components/sync/device_info/device_info.h" |
| 15 #include "components/sync/device_info/local_device_info_provider.h" | 15 #include "components/sync/device_info/local_device_info_provider.h" |
| 16 #include "components/version_info/version_info.h" | 16 #include "components/version_info/version_info.h" |
| 17 | 17 |
| 18 namespace syncer { | 18 namespace syncer { |
| 19 | 19 |
| 20 class LocalDeviceInfoProviderImpl : public LocalDeviceInfoProvider, | 20 class LocalDeviceInfoProviderImpl : public LocalDeviceInfoProvider { |
| 21 public base::NonThreadSafe { | |
| 22 public: | 21 public: |
| 23 LocalDeviceInfoProviderImpl(version_info::Channel channel, | 22 LocalDeviceInfoProviderImpl(version_info::Channel channel, |
| 24 const std::string& version, | 23 const std::string& version, |
| 25 bool is_tablet); | 24 bool is_tablet); |
| 26 ~LocalDeviceInfoProviderImpl() override; | 25 ~LocalDeviceInfoProviderImpl() override; |
| 27 | 26 |
| 28 // LocalDeviceInfoProvider implementation. | 27 // LocalDeviceInfoProvider implementation. |
| 29 const DeviceInfo* GetLocalDeviceInfo() const override; | 28 const DeviceInfo* GetLocalDeviceInfo() const override; |
| 30 std::string GetSyncUserAgent() const override; | 29 std::string GetSyncUserAgent() const override; |
| 31 std::string GetLocalSyncCacheGUID() const override; | 30 std::string GetLocalSyncCacheGUID() const override; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 48 // The version string for the current client. | 47 // The version string for the current client. |
| 49 const std::string version_; | 48 const std::string version_; |
| 50 | 49 |
| 51 // Whether this device has a tablet form factor (only used on Android | 50 // Whether this device has a tablet form factor (only used on Android |
| 52 // devices). | 51 // devices). |
| 53 const bool is_tablet_; | 52 const bool is_tablet_; |
| 54 | 53 |
| 55 std::string cache_guid_; | 54 std::string cache_guid_; |
| 56 std::unique_ptr<DeviceInfo> local_device_info_; | 55 std::unique_ptr<DeviceInfo> local_device_info_; |
| 57 base::CallbackList<void(void)> callback_list_; | 56 base::CallbackList<void(void)> callback_list_; |
| 57 |
| 58 SEQUENCE_CHECKER(sequence_checker_); |
| 59 |
| 58 base::WeakPtrFactory<LocalDeviceInfoProviderImpl> weak_factory_; | 60 base::WeakPtrFactory<LocalDeviceInfoProviderImpl> weak_factory_; |
| 59 | 61 |
| 60 DISALLOW_COPY_AND_ASSIGN(LocalDeviceInfoProviderImpl); | 62 DISALLOW_COPY_AND_ASSIGN(LocalDeviceInfoProviderImpl); |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 } // namespace syncer | 65 } // namespace syncer |
| 64 | 66 |
| 65 #endif // COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ | 67 #endif // COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
| OLD | NEW |