OLD | NEW |
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 // This file defines the "sync API", an interface to the syncer | 5 // This file defines the "sync API", an interface to the syncer |
6 // backend that exposes (1) the core functionality of maintaining a consistent | 6 // backend that exposes (1) the core functionality of maintaining a consistent |
7 // local snapshot of a hierarchical object set; (2) a means to transactionally | 7 // local snapshot of a hierarchical object set; (2) a means to transactionally |
8 // access and modify those objects; (3) a means to control client/server | 8 // access and modify those objects; (3) a means to control client/server |
9 // synchronization tasks, namely: pushing local object modifications to a | 9 // synchronization tasks, namely: pushing local object modifications to a |
10 // server, pulling nonlocal object modifications from a server to this client, | 10 // server, pulling nonlocal object modifications from a server to this client, |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 const sync_pb::TypedUrlSpecifics& GetTypedUrlSpecifics() const; | 247 const sync_pb::TypedUrlSpecifics& GetTypedUrlSpecifics() const; |
248 | 248 |
249 // Getter specific to the EXTENSIONS datatype. Returns protobuf | 249 // Getter specific to the EXTENSIONS datatype. Returns protobuf |
250 // data. Can only be called if GetModelType() == EXTENSIONS. | 250 // data. Can only be called if GetModelType() == EXTENSIONS. |
251 const sync_pb::ExtensionSpecifics& GetExtensionSpecifics() const; | 251 const sync_pb::ExtensionSpecifics& GetExtensionSpecifics() const; |
252 | 252 |
253 // Getter specific to the SESSIONS datatype. Returns protobuf | 253 // Getter specific to the SESSIONS datatype. Returns protobuf |
254 // data. Can only be called if GetModelType() == SESSIONS. | 254 // data. Can only be called if GetModelType() == SESSIONS. |
255 const sync_pb::SessionSpecifics& GetSessionSpecifics() const; | 255 const sync_pb::SessionSpecifics& GetSessionSpecifics() const; |
256 | 256 |
| 257 const sync_pb::EntitySpecifics& GetEntitySpecifics() const; |
| 258 |
257 // Returns the local external ID associated with the node. | 259 // Returns the local external ID associated with the node. |
258 int64 GetExternalId() const; | 260 int64 GetExternalId() const; |
259 | 261 |
260 // Return the ID of the node immediately before this in the sibling order. | 262 // Return the ID of the node immediately before this in the sibling order. |
261 // For the first node in the ordering, return 0. | 263 // For the first node in the ordering, return 0. |
262 int64 GetPredecessorId() const; | 264 int64 GetPredecessorId() const; |
263 | 265 |
264 // Return the ID of the node immediately after this in the sibling order. | 266 // Return the ID of the node immediately after this in the sibling order. |
265 // For the last node in the ordering, return 0. | 267 // For the last node in the ordering, return 0. |
266 virtual int64 GetSuccessorId() const; | 268 virtual int64 GetSuccessorId() const; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 void SetTypedUrlSpecifics(const sync_pb::TypedUrlSpecifics& specifics); | 420 void SetTypedUrlSpecifics(const sync_pb::TypedUrlSpecifics& specifics); |
419 | 421 |
420 // Set the extension specifics (id, update url, enabled state, etc). | 422 // Set the extension specifics (id, update url, enabled state, etc). |
421 // Should only be called if GetModelType() == EXTENSIONS. | 423 // Should only be called if GetModelType() == EXTENSIONS. |
422 void SetExtensionSpecifics(const sync_pb::ExtensionSpecifics& specifics); | 424 void SetExtensionSpecifics(const sync_pb::ExtensionSpecifics& specifics); |
423 | 425 |
424 // Set the session specifics (windows, tabs, navigations etc.). | 426 // Set the session specifics (windows, tabs, navigations etc.). |
425 // Should only be called if GetModelType() == SESSIONS. | 427 // Should only be called if GetModelType() == SESSIONS. |
426 void SetSessionSpecifics(const sync_pb::SessionSpecifics& specifics); | 428 void SetSessionSpecifics(const sync_pb::SessionSpecifics& specifics); |
427 | 429 |
| 430 // Generic set specifics method. Will extract the model type from |specifics|. |
| 431 void SetEntitySpecifics(const sync_pb::EntitySpecifics& specifics); |
| 432 |
428 // Resets the EntitySpecifics for this node based on the unencrypted data. | 433 // Resets the EntitySpecifics for this node based on the unencrypted data. |
429 // Will encrypt if necessary. | 434 // Will encrypt if necessary. |
430 void ResetFromSpecifics(); | 435 void ResetFromSpecifics(); |
431 | 436 |
432 // Implementation of BaseNode's abstract virtual accessors. | 437 // Implementation of BaseNode's abstract virtual accessors. |
433 virtual const syncable::Entry* GetEntry() const; | 438 virtual const syncable::Entry* GetEntry() const; |
434 | 439 |
435 virtual const BaseTransaction* GetTransaction() const; | 440 virtual const BaseTransaction* GetTransaction() const; |
436 | 441 |
437 private: | 442 private: |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 private: | 1046 private: |
1042 // An opaque pointer to the nested private class. | 1047 // An opaque pointer to the nested private class. |
1043 SyncInternal* data_; | 1048 SyncInternal* data_; |
1044 | 1049 |
1045 DISALLOW_COPY_AND_ASSIGN(SyncManager); | 1050 DISALLOW_COPY_AND_ASSIGN(SyncManager); |
1046 }; | 1051 }; |
1047 | 1052 |
1048 } // namespace sync_api | 1053 } // namespace sync_api |
1049 | 1054 |
1050 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 1055 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
OLD | NEW |