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

Side by Side Diff: sync/internal_api/public/sync_manager.h

Issue 15421011: Use OAuth2 token for sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove token prefetch. Move UMA counters. Fix some tests. Etc. Created 7 years, 6 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
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // The email associated with this account.
65 std::string email; 65 std::string email;
66 // The raw authentication token's bytes. 66 // The raw authentication token's bytes.
67 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;
70 }; 68 };
71 69
72 // SyncManager encapsulates syncable::Directory and serves as the parent of all 70 // SyncManager encapsulates syncable::Directory and serves as the parent of all
73 // other objects in the sync API. If multiple threads interact with the same 71 // other objects in the sync API. If multiple threads interact with the same
74 // local sync repository (i.e. the same sqlite database), they should share a 72 // local sync repository (i.e. the same sqlite database), they should share a
75 // single SyncManager instance. The caller should typically create one 73 // single SyncManager instance. The caller should typically create one
76 // SyncManager for the lifetime of a user session. 74 // SyncManager for the lifetime of a user session.
77 // 75 //
78 // Unless stated otherwise, all methods of SyncManager should be called on the 76 // Unless stated otherwise, all methods of SyncManager should be called on the
79 // same thread. 77 // same thread.
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 // Returns the SyncManager's encryption handler. 437 // Returns the SyncManager's encryption handler.
440 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; 438 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0;
441 439
442 // Ask the SyncManager to fetch updates for the given types. 440 // Ask the SyncManager to fetch updates for the given types.
443 virtual void RefreshTypes(ModelTypeSet types) = 0; 441 virtual void RefreshTypes(ModelTypeSet types) = 0;
444 }; 442 };
445 443
446 } // namespace syncer 444 } // namespace syncer
447 445
448 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ 446 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698