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

Side by Side Diff: sync/engine/model_type_registry.h

Issue 93433006: sync: Introduce ModelTypeRegistry and helpers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes + delete sync_sessions_unittest.cc Created 6 years, 11 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_
6 #define SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_
7
8 #include <map>
9
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "sync/base/sync_export.h"
13 #include "sync/internal_api/public/base/model_type.h"
14 #include "sync/internal_api/public/engine/model_safe_worker.h"
15
16 namespace syncer {
17
18 class CommitterList;
19 class UpdaterList;
20
21 namespace syncable {
22 class Directory;
23 } // namespace syncable
24
25 class SYNC_EXPORT_PRIVATE ModelTypeRegistry {
26 public:
27 ModelTypeRegistry(
28 const std::vector<ModelSafeWorker*>& workers,
29 syncable::Directory* directory);
30 ~ModelTypeRegistry();
31
32 // Sets the set of enabled types.
Nicolas Zea 2014/01/07 23:11:40 It seems dangerous that this will destroy the upda
rlarocque 2014/01/08 01:37:24 True, not re-creating them and returning const ref
33 void SetEnabledDirectoryTypes(const ModelSafeRoutingInfo& routing_info);
34
35 // Simple getters.
36 UpdaterList* updater_list();
37 CommitterList* committer_list();
38
39 private:
40 // Classes to manage the types hooked up to receive and commit sync data.
41 scoped_ptr<UpdaterList> updater_list_;
42 scoped_ptr<CommitterList> committer_list_;
43
44 // The known ModelSafeWorkers.
45 std::map<ModelSafeGroup, scoped_refptr<ModelSafeWorker> > workers_map_;
46
47 // The directory. Not owned.
48 syncable::Directory* directory_;
49
50 DISALLOW_COPY_AND_ASSIGN(ModelTypeRegistry);
51 };
52
53 } // namespace syncer
54
55 #endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_
56
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698