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_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 // Used by SyncManager::OnConnectionStatusChange(). | 55 // Used by SyncManager::OnConnectionStatusChange(). |
56 enum ConnectionStatus { | 56 enum ConnectionStatus { |
57 CONNECTION_OK, | 57 CONNECTION_OK, |
58 CONNECTION_AUTH_ERROR, | 58 CONNECTION_AUTH_ERROR, |
59 CONNECTION_SERVER_ERROR | 59 CONNECTION_SERVER_ERROR |
60 }; | 60 }; |
61 | 61 |
62 // Contains everything needed to talk to and identify a user account. | 62 // Contains everything needed to talk to and identify a user account. |
63 struct SyncCredentials { | 63 struct SyncCredentials { |
| 64 // The email associated with this account. |
64 std::string email; | 65 std::string email; |
| 66 // The raw authentication token's bytes. |
65 std::string sync_token; | 67 std::string sync_token; |
| 68 // (optional) The time at which the token was fetched/refreshed. |
| 69 base::Time sync_token_time; |
66 }; | 70 }; |
67 | 71 |
68 // SyncManager encapsulates syncable::Directory and serves as the parent of all | 72 // SyncManager encapsulates syncable::Directory and serves as the parent of all |
69 // other objects in the sync API. If multiple threads interact with the same | 73 // other objects in the sync API. If multiple threads interact with the same |
70 // local sync repository (i.e. the same sqlite database), they should share a | 74 // local sync repository (i.e. the same sqlite database), they should share a |
71 // single SyncManager instance. The caller should typically create one | 75 // single SyncManager instance. The caller should typically create one |
72 // SyncManager for the lifetime of a user session. | 76 // SyncManager for the lifetime of a user session. |
73 // | 77 // |
74 // Unless stated otherwise, all methods of SyncManager should be called on the | 78 // Unless stated otherwise, all methods of SyncManager should be called on the |
75 // same thread. | 79 // same thread. |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 // Returns the SyncManager's encryption handler. | 439 // Returns the SyncManager's encryption handler. |
436 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; | 440 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; |
437 | 441 |
438 // Ask the SyncManager to fetch updates for the given types. | 442 // Ask the SyncManager to fetch updates for the given types. |
439 virtual void RefreshTypes(ModelTypeSet types) = 0; | 443 virtual void RefreshTypes(ModelTypeSet types) = 0; |
440 }; | 444 }; |
441 | 445 |
442 } // namespace syncer | 446 } // namespace syncer |
443 | 447 |
444 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 448 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
OLD | NEW |