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 #include "components/sync/model_impl/processor_entity_tracker.h" | 5 #include "components/sync/model_impl/processor_entity_tracker.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/sha1.h" | 8 #include "base/sha1.h" |
9 #include "components/sync/base/time.h" | 9 #include "components/sync/base/time.h" |
10 #include "components/sync/core/non_blocking_sync_common.h" | 10 #include "components/sync/engine/non_blocking_sync_common.h" |
11 #include "components/sync/syncable/syncable_util.h" | 11 #include "components/sync/syncable/syncable_util.h" |
12 | 12 |
13 namespace syncer { | 13 namespace syncer { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 void HashSpecifics(const sync_pb::EntitySpecifics& specifics, | 17 void HashSpecifics(const sync_pb::EntitySpecifics& specifics, |
18 std::string* hash) { | 18 std::string* hash) { |
19 DCHECK_GT(specifics.ByteSize(), 0); | 19 DCHECK_GT(specifics.ByteSize(), 0); |
20 base::Base64Encode(base::SHA1HashString(specifics.SerializeAsString()), hash); | 20 base::Base64Encode(base::SHA1HashString(specifics.SerializeAsString()), hash); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 void ProcessorEntityTracker::UpdateSpecificsHash( | 241 void ProcessorEntityTracker::UpdateSpecificsHash( |
242 const sync_pb::EntitySpecifics& specifics) { | 242 const sync_pb::EntitySpecifics& specifics) { |
243 if (specifics.ByteSize() > 0) { | 243 if (specifics.ByteSize() > 0) { |
244 HashSpecifics(specifics, metadata_.mutable_specifics_hash()); | 244 HashSpecifics(specifics, metadata_.mutable_specifics_hash()); |
245 } else { | 245 } else { |
246 metadata_.clear_specifics_hash(); | 246 metadata_.clear_specifics_hash(); |
247 } | 247 } |
248 } | 248 } |
249 | 249 |
250 } // namespace syncer | 250 } // namespace syncer |
OLD | NEW |