Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: sync/syncable/syncable_id.h

Issue 11636006: WIP: The Bookmark Position Megapatch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Various updates, including switch suffix to unique_client_tag style Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/syncable/syncable_enum_conversions_unittest.cc ('k') | sync/syncable/syncable_id.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <limits> 9 #include <limits>
10 #include <sstream> 10 #include <sstream>
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // by operator<. 95 // by operator<.
96 Id GetLexicographicSuccessor() const; 96 Id GetLexicographicSuccessor() const;
97 97
98 // Dumps the ID as a value and returns it. Transfers ownership of 98 // Dumps the ID as a value and returns it. Transfers ownership of
99 // the StringValue to the caller. 99 // the StringValue to the caller.
100 base::StringValue* ToValue() const; 100 base::StringValue* ToValue() const;
101 101
102 // Three functions are used to work with our proto buffers. 102 // Three functions are used to work with our proto buffers.
103 std::string GetServerId() const; 103 std::string GetServerId() const;
104 static Id CreateFromServerId(const std::string& server_id); 104 static Id CreateFromServerId(const std::string& server_id);
105
105 // This should only be used if you get back a reference to a local 106 // This should only be used if you get back a reference to a local
106 // id from the server. Returns a client only opaque id. 107 // id from the server. Returns a client only opaque id.
107 static Id CreateFromClientString(const std::string& local_id); 108 static Id CreateFromClientString(const std::string& local_id);
108 109
109 // This method returns an ID that will compare less than any valid ID. 110 // This method returns an ID that will compare less than any valid ID.
110 // The returned ID is not a valid ID itself. This is useful for 111 // The returned ID is not a valid ID itself. This is useful for
111 // computing lower bounds on std::sets that are ordered by operator<. 112 // computing lower bounds on std::sets that are ordered by operator<.
112 static Id GetLeastIdForLexicographicComparison(); 113 static Id GetLeastIdForLexicographicComparison();
113 114
114 private: 115 private:
115 friend scoped_ptr<EntryKernel> UnpackEntry(sql::Statement* statement); 116 friend scoped_ptr<EntryKernel> UnpackEntry(sql::Statement* statement);
116 friend void BindFields(const EntryKernel& entry, 117 friend void BindFields(const EntryKernel& entry,
117 sql::Statement* statement); 118 sql::Statement* statement);
118 friend std::ostream& operator<<(std::ostream& out, const Id& id); 119 friend std::ostream& operator<<(std::ostream& out, const Id& id);
119 friend class MockConnectionManager; 120 friend class MockConnectionManager;
120 friend class SyncableIdTest; 121 friend class SyncableIdTest;
121 122
122 std::string s_; 123 std::string s_;
123 }; 124 };
124 125
125 Id GetNullId(); 126 Id GetNullId();
126 127
127 } // namespace syncable 128 } // namespace syncable
128 } // namespace syncer 129 } // namespace syncer
129 130
130 #endif // SYNC_SYNCABLE_SYNCABLE_ID_H_ 131 #endif // SYNC_SYNCABLE_SYNCABLE_ID_H_
OLDNEW
« no previous file with comments | « sync/syncable/syncable_enum_conversions_unittest.cc ('k') | sync/syncable/syncable_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698