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

Side by Side Diff: chrome/browser/sync/internal_api/base_node.h

Issue 8396022: [Sync] Add HasChildren() function and use it instead of GetFirstChildId() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_ 5 #ifndef CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_
6 #define CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_ 6 #define CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 // Getter specific to the SESSIONS datatype. Returns protobuf 150 // Getter specific to the SESSIONS datatype. Returns protobuf
151 // data. Can only be called if GetModelType() == SESSIONS. 151 // data. Can only be called if GetModelType() == SESSIONS.
152 const sync_pb::SessionSpecifics& GetSessionSpecifics() const; 152 const sync_pb::SessionSpecifics& GetSessionSpecifics() const;
153 153
154 const sync_pb::EntitySpecifics& GetEntitySpecifics() const; 154 const sync_pb::EntitySpecifics& GetEntitySpecifics() const;
155 155
156 // Returns the local external ID associated with the node. 156 // Returns the local external ID associated with the node.
157 int64 GetExternalId() const; 157 int64 GetExternalId() const;
158 158
159 // Returns true iff this node has children.
160 bool HasChildren() const;
161
159 // Return the ID of the node immediately before this in the sibling order. 162 // Return the ID of the node immediately before this in the sibling order.
160 // For the first node in the ordering, return 0. 163 // For the first node in the ordering, return 0.
161 int64 GetPredecessorId() const; 164 int64 GetPredecessorId() const;
162 165
163 // Return the ID of the node immediately after this in the sibling order. 166 // Return the ID of the node immediately after this in the sibling order.
164 // For the last node in the ordering, return 0. 167 // For the last node in the ordering, return 0.
165 virtual int64 GetSuccessorId() const; 168 int64 GetSuccessorId() const;
166 169
167 // Return the ID of the first child of this node. If this node has no 170 // Return the ID of the first child of this node. If this node has no
168 // children, return 0. 171 // children, return 0.
169 virtual int64 GetFirstChildId() const; 172 int64 GetFirstChildId() const;
170 173
171 // These virtual accessors provide access to data members of derived classes. 174 // These virtual accessors provide access to data members of derived classes.
172 virtual const syncable::Entry* GetEntry() const = 0; 175 virtual const syncable::Entry* GetEntry() const = 0;
173 virtual const BaseTransaction* GetTransaction() const = 0; 176 virtual const BaseTransaction* GetTransaction() const = 0;
174 177
175 // Dumps a summary of node info into a DictionaryValue and returns it. 178 // Dumps a summary of node info into a DictionaryValue and returns it.
176 // Transfers ownership of the DictionaryValue to the caller. 179 // Transfers ownership of the DictionaryValue to the caller.
177 base::DictionaryValue* GetSummaryAsValue() const; 180 base::DictionaryValue* GetSummaryAsValue() const;
178 181
179 // Dumps all node details into a DictionaryValue and returns it. 182 // Dumps all node details into a DictionaryValue and returns it.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 218
216 friend class SyncApiTest; 219 friend class SyncApiTest;
217 FRIEND_TEST_ALL_PREFIXES(SyncApiTest, GenerateSyncableHash); 220 FRIEND_TEST_ALL_PREFIXES(SyncApiTest, GenerateSyncableHash);
218 221
219 DISALLOW_COPY_AND_ASSIGN(BaseNode); 222 DISALLOW_COPY_AND_ASSIGN(BaseNode);
220 }; 223 };
221 224
222 } // namespace sync_api 225 } // namespace sync_api
223 226
224 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_ 227 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_BASE_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698