OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "components/sync/device_info/device_info_util.h" | 5 #include "components/sync/device_info/device_info_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "components/sync/protocol/sync.pb.h" | 10 #include "components/sync/protocol/sync.pb.h" |
11 | 11 |
12 namespace sync_driver { | 12 namespace syncer { |
13 | 13 |
14 using base::Time; | 14 using base::Time; |
15 using base::TimeDelta; | 15 using base::TimeDelta; |
16 using sync_pb::DeviceInfoSpecifics; | 16 using sync_pb::DeviceInfoSpecifics; |
17 | 17 |
18 const char DeviceInfoUtil::kClientTagPrefix[] = "DeviceInfo_"; | 18 const char DeviceInfoUtil::kClientTagPrefix[] = "DeviceInfo_"; |
19 const TimeDelta DeviceInfoUtil::kPulseInterval = TimeDelta::FromDays(1); | 19 const TimeDelta DeviceInfoUtil::kPulseInterval = TimeDelta::FromDays(1); |
20 const TimeDelta DeviceInfoUtil::kActiveThreshold = TimeDelta::FromDays(14); | 20 const TimeDelta DeviceInfoUtil::kActiveThreshold = TimeDelta::FromDays(14); |
21 | 21 |
22 namespace { | 22 namespace { |
(...skipping 23 matching lines...) Expand all Loading... |
46 const sync_pb::DeviceInfoSpecifics& specifics) { | 46 const sync_pb::DeviceInfoSpecifics& specifics) { |
47 return kClientTagPrefix + specifics.cache_guid(); | 47 return kClientTagPrefix + specifics.cache_guid(); |
48 } | 48 } |
49 | 49 |
50 // static | 50 // static |
51 std::string DeviceInfoUtil::TagToCacheGuid(const std::string& tag) { | 51 std::string DeviceInfoUtil::TagToCacheGuid(const std::string& tag) { |
52 DCHECK(base::StartsWith(tag, kClientTagPrefix, base::CompareCase::SENSITIVE)); | 52 DCHECK(base::StartsWith(tag, kClientTagPrefix, base::CompareCase::SENSITIVE)); |
53 return tag.substr(strlen(kClientTagPrefix)); | 53 return tag.substr(strlen(kClientTagPrefix)); |
54 } | 54 } |
55 | 55 |
56 } // namespace sync_driver | 56 } // namespace syncer |
OLD | NEW |