OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> |
10 #include <sstream> | 11 #include <sstream> |
11 #include <string> | 12 #include <string> |
12 | 13 |
13 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "sync/base/sync_export.h" | 15 #include "sync/base/sync_export.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class StringValue; | 18 class StringValue; |
19 } | 19 } |
20 | 20 |
21 namespace sql { | 21 namespace sql { |
22 class Statement; | 22 class Statement; |
23 } | 23 } |
24 | 24 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 // This method returns an ID that will compare less than any valid ID. | 100 // This method returns an ID that will compare less than any valid ID. |
101 // The returned ID is not a valid ID itself. This is useful for | 101 // The returned ID is not a valid ID itself. This is useful for |
102 // computing lower bounds on std::sets that are ordered by operator<. | 102 // computing lower bounds on std::sets that are ordered by operator<. |
103 static Id GetLeastIdForLexicographicComparison(); | 103 static Id GetLeastIdForLexicographicComparison(); |
104 | 104 |
105 // Gets root ID. | 105 // Gets root ID. |
106 static Id GetRoot(); | 106 static Id GetRoot(); |
107 | 107 |
108 private: | 108 private: |
109 friend scoped_ptr<EntryKernel> UnpackEntry(sql::Statement* statement, | 109 friend std::unique_ptr<EntryKernel> UnpackEntry(sql::Statement* statement, |
110 int* total_created_entries); | 110 int* total_created_entries); |
111 friend void BindFields(const EntryKernel& entry, | 111 friend void BindFields(const EntryKernel& entry, |
112 sql::Statement* statement); | 112 sql::Statement* statement); |
113 SYNC_EXPORT friend std::ostream& operator<<(std::ostream& out, const Id& id); | 113 SYNC_EXPORT friend std::ostream& operator<<(std::ostream& out, const Id& id); |
114 friend class SyncableIdTest; | 114 friend class SyncableIdTest; |
115 | 115 |
116 std::string s_; | 116 std::string s_; |
117 }; | 117 }; |
118 | 118 |
119 } // namespace syncable | 119 } // namespace syncable |
120 } // namespace syncer | 120 } // namespace syncer |
121 | 121 |
122 #endif // SYNC_SYNCABLE_SYNCABLE_ID_H_ | 122 #endif // SYNC_SYNCABLE_SYNCABLE_ID_H_ |
OLD | NEW |