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/engine/sync_scheduler.h

Issue 10455012: [Sync] Add support for performing a GetKey on startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fred's comments Created 8 years, 4 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) 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 // A class to schedule syncer tasks intelligently. 5 // A class to schedule syncer tasks intelligently.
6 #ifndef SYNC_ENGINE_SYNC_SCHEDULER_H_ 6 #ifndef SYNC_ENGINE_SYNC_SCHEDULER_H_
7 #define SYNC_ENGINE_SYNC_SCHEDULER_H_ 7 #define SYNC_ENGINE_SYNC_SCHEDULER_H_
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/time.h" 13 #include "base/time.h"
14 #include "sync/engine/nudge_source.h" 14 #include "sync/engine/nudge_source.h"
15 #include "sync/internal_api/public/base/model_type_payload_map.h" 15 #include "sync/internal_api/public/base/model_type_payload_map.h"
16 #include "sync/sessions/sync_session.h" 16 #include "sync/sessions/sync_session.h"
17 17
18 class MessageLoop; 18 class MessageLoop;
19 19
20 namespace tracked_objects { 20 namespace tracked_objects {
21 class Location; 21 class Location;
22 } // namespace tracked_objects 22 } // namespace tracked_objects
23 23
24 namespace syncer { 24 namespace syncer {
25 25
26 struct ServerConnectionEvent; 26 struct ServerConnectionEvent;
27 27
28 struct ConfigurationParams { 28 struct ConfigurationParams {
29 enum KeystoreKeyStatus {
30 KEYSTORE_KEY_UNNECESSARY,
31 KEYSTORE_KEY_NEEDED
32 };
33 ConfigurationParams(); 29 ConfigurationParams();
34 ConfigurationParams( 30 ConfigurationParams(
35 const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& source, 31 const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& source,
36 const ModelTypeSet& types_to_download, 32 const ModelTypeSet& types_to_download,
37 const ModelSafeRoutingInfo& routing_info, 33 const ModelSafeRoutingInfo& routing_info,
38 KeystoreKeyStatus keystore_key_status,
39 const base::Closure& ready_task); 34 const base::Closure& ready_task);
40 ~ConfigurationParams(); 35 ~ConfigurationParams();
41 36
42 // Source for the configuration. 37 // Source for the configuration.
43 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source; 38 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source;
44 // The types that should be downloaded. 39 // The types that should be downloaded.
45 ModelTypeSet types_to_download; 40 ModelTypeSet types_to_download;
46 // The new routing info (superset of types to be downloaded). 41 // The new routing info (superset of types to be downloaded).
47 ModelSafeRoutingInfo routing_info; 42 ModelSafeRoutingInfo routing_info;
48 // Whether we need to perform a GetKey command.
49 KeystoreKeyStatus keystore_key_status;
50 // Callback to invoke on configuration completion. 43 // Callback to invoke on configuration completion.
51 base::Closure ready_task; 44 base::Closure ready_task;
52 }; 45 };
53 46
54 class SyncScheduler : public sessions::SyncSession::Delegate { 47 class SyncScheduler : public sessions::SyncSession::Delegate {
55 public: 48 public:
56 enum Mode { 49 enum Mode {
57 // In this mode, the thread only performs configuration tasks. This is 50 // In this mode, the thread only performs configuration tasks. This is
58 // designed to make the case where we want to download updates for a 51 // designed to make the case where we want to download updates for a
59 // specific type only, and not continue syncing until we are moved into 52 // specific type only, and not continue syncing until we are moved into
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Called when credentials are updated by the user. 103 // Called when credentials are updated by the user.
111 virtual void OnCredentialsUpdated() = 0; 104 virtual void OnCredentialsUpdated() = 0;
112 105
113 // Called when the network layer detects a connection status change. 106 // Called when the network layer detects a connection status change.
114 virtual void OnConnectionStatusChange() = 0; 107 virtual void OnConnectionStatusChange() = 0;
115 }; 108 };
116 109
117 } // namespace syncer 110 } // namespace syncer
118 111
119 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_ 112 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698