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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_registrar.h

Issue 10804039: Make SyncBackendRegistrar aware of loaded data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_REGISTRAR_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_REGISTRAR_H_
6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_REGISTRAR_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_REGISTRAR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 15 matching lines...) Expand all
26 namespace browser_sync { 26 namespace browser_sync {
27 27
28 class ChangeProcessor; 28 class ChangeProcessor;
29 class UIModelWorker; 29 class UIModelWorker;
30 30
31 // A class that keep track of the workers, change processors, and 31 // A class that keep track of the workers, change processors, and
32 // routing info for the enabled sync types, and also routes change 32 // routing info for the enabled sync types, and also routes change
33 // events to the right processors. 33 // events to the right processors.
34 class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate { 34 class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate {
35 public: 35 public:
36 // |initial_types| contains the initial set of types to sync 36 // |name| is used for debugging. Does not take ownership of |profile| or
37 // (initially put in the passive group). |name| is used for 37 // |sync_loop|. Must be created on the UI thread.
38 // debugging. Does not take ownership of |profile| or |sync_loop|. 38 SyncBackendRegistrar(const std::string& name,
39 // Must be created on the UI thread.
40 SyncBackendRegistrar(syncer::ModelTypeSet initial_types,
41 const std::string& name,
42 Profile* profile, 39 Profile* profile,
43 MessageLoop* sync_loop); 40 MessageLoop* sync_loop);
44 41
42 // Informs the SyncBackendRegistrar of the currently enabled set of types.
43 // These types will be placed in the passive group. This function should be
44 // called exactly once during startup.
45 void SetInitialTypes(syncer::ModelTypeSet initial_types);
46
45 // SyncBackendRegistrar must be destroyed as follows: 47 // SyncBackendRegistrar must be destroyed as follows:
46 // 48 //
47 // 1) On the sync thread, call OnSyncerShutdownComplete() after 49 // 1) On the sync thread, call OnSyncerShutdownComplete() after
48 // the syncer is shutdown. 50 // the syncer is shutdown.
49 // 2) Meanwhile, on the UI thread, call StopOnUIThread(), which 51 // 2) Meanwhile, on the UI thread, call StopOnUIThread(), which
50 // blocks until OnSyncerShutdownComplete() is called. 52 // blocks until OnSyncerShutdownComplete() is called.
51 // 3) Destroy the SyncBackendRegistrar. 53 // 3) Destroy the SyncBackendRegistrar.
52 // 54 //
53 // This is to handle the complicated shutdown requirements of the 55 // This is to handle the complicated shutdown requirements of the
54 // UIModelWorker (since the UI thread is both the main thread and a 56 // UIModelWorker (since the UI thread is both the main thread and a
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 151
150 // The change processors that handle the different data types. 152 // The change processors that handle the different data types.
151 std::map<syncer::ModelType, ChangeProcessor*> processors_; 153 std::map<syncer::ModelType, ChangeProcessor*> processors_;
152 154
153 DISALLOW_COPY_AND_ASSIGN(SyncBackendRegistrar); 155 DISALLOW_COPY_AND_ASSIGN(SyncBackendRegistrar);
154 }; 156 };
155 157
156 } // namespace browser_sync 158 } // namespace browser_sync
157 159
158 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_REGISTRAR_H_ 160 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_REGISTRAR_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_unittest.cc ('k') | chrome/browser/sync/glue/sync_backend_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698