OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/internal_api/syncapi_internal.h" | 5 #include "sync/internal_api/syncapi_internal.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "sync/protocol/attachments.pb.h" |
8 #include "sync/protocol/password_specifics.pb.h" | 9 #include "sync/protocol/password_specifics.pb.h" |
9 #include "sync/protocol/sync.pb.h" | 10 #include "sync/protocol/sync.pb.h" |
10 #include "sync/util/cryptographer.h" | 11 #include "sync/util/cryptographer.h" |
11 | 12 |
12 namespace syncer { | 13 namespace syncer { |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 bool EndsWithSpace(const std::string& string) { | 17 bool EndsWithSpace(const std::string& string) { |
17 return !string.empty() && *string.rbegin() == ' '; | 18 return !string.empty() && *string.rbegin() == ' '; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 right_plaintext = cryptographer->DecryptToString(right.encrypted()); | 98 right_plaintext = cryptographer->DecryptToString(right.encrypted()); |
98 } else { | 99 } else { |
99 right_plaintext = right.SerializeAsString(); | 100 right_plaintext = right.SerializeAsString(); |
100 } | 101 } |
101 if (left_plaintext == right_plaintext) { | 102 if (left_plaintext == right_plaintext) { |
102 return true; | 103 return true; |
103 } | 104 } |
104 return false; | 105 return false; |
105 } | 106 } |
106 | 107 |
| 108 bool AreAttachmentMetadataEqual(const sync_pb::AttachmentMetadata& left, |
| 109 const sync_pb::AttachmentMetadata& right) { |
| 110 if (left.SerializeAsString() == right.SerializeAsString()) { |
| 111 return true; |
| 112 } |
| 113 return false; |
| 114 } |
| 115 |
107 } // namespace syncer | 116 } // namespace syncer |
OLD | NEW |