| 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 #ifndef SYNC_SYNCABLE_SYNCABLE_ID_H_ | 5 #ifndef SYNC_SYNCABLE_SYNCABLE_ID_H_ |
| 6 #define SYNC_SYNCABLE_SYNCABLE_ID_H_ | 6 #define SYNC_SYNCABLE_SYNCABLE_ID_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 #include <limits> | 10 #include <limits> |
| 11 #include <sstream> | 11 #include <sstream> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/hash_tables.h" | 14 #include "base/hash_tables.h" |
| 15 | 15 |
| 16 class MockConnectionManager; | 16 class MockConnectionManager; |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class StringValue; | 19 class StringValue; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace sql { | 22 namespace sql { |
| 23 class Statement; | 23 class Statement; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace syncer { |
| 26 namespace syncable { | 27 namespace syncable { |
| 27 struct EntryKernel; | 28 struct EntryKernel; |
| 28 class Id; | 29 class Id; |
| 29 } | |
| 30 | |
| 31 namespace syncable { | |
| 32 | 30 |
| 33 std::ostream& operator<<(std::ostream& out, const Id& id); | 31 std::ostream& operator<<(std::ostream& out, const Id& id); |
| 34 | 32 |
| 35 // For historical reasons, 3 concepts got everloaded into the Id: | 33 // For historical reasons, 3 concepts got everloaded into the Id: |
| 36 // 1. A unique, opaque identifier for the object. | 34 // 1. A unique, opaque identifier for the object. |
| 37 // 2. Flag specifing whether server know about this object. | 35 // 2. Flag specifing whether server know about this object. |
| 38 // 3. Flag for root. | 36 // 3. Flag for root. |
| 39 // | 37 // |
| 40 // We originally wrapped an integer for this information, but now we use a | 38 // We originally wrapped an integer for this information, but now we use a |
| 41 // string. It will have one of three forms: | 39 // string. It will have one of three forms: |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 friend std::ostream& operator<<(std::ostream& out, const Id& id); | 118 friend std::ostream& operator<<(std::ostream& out, const Id& id); |
| 121 friend class MockConnectionManager; | 119 friend class MockConnectionManager; |
| 122 friend class SyncableIdTest; | 120 friend class SyncableIdTest; |
| 123 | 121 |
| 124 std::string s_; | 122 std::string s_; |
| 125 }; | 123 }; |
| 126 | 124 |
| 127 Id GetNullId(); | 125 Id GetNullId(); |
| 128 | 126 |
| 129 } // namespace syncable | 127 } // namespace syncable |
| 128 } // namespace syncer |
| 130 | 129 |
| 131 #endif // SYNC_SYNCABLE_SYNCABLE_ID_H_ | 130 #endif // SYNC_SYNCABLE_SYNCABLE_ID_H_ |
| OLD | NEW |