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

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: Add missing files 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/memory/scoped_ptr.h"
11 #include "sync/base/sync_export.h"
12 #include "sync/internal_api/public/base/model_type.h"
13 #include "sync/internal_api/public/engine/model_safe_worker.h"
14
15 namespace syncer {
16
17 class CommitterList;
18 class UpdaterList;
19
20 namespace syncable {
21 class Directory;
22 } // namespace syncable
23
24 class SYNC_EXPORT_PRIVATE ModelTypeRegistry {
25 public:
26 ModelTypeRegistry(
27 syncable::Directory* directory,
Nicolas Zea 2014/01/04 02:09:34 nit: have directory be second param (input/output
rlarocque 2014/01/06 20:03:33 Done.
28 const std::vector<ModelSafeWorker*>& workers);
Nicolas Zea 2014/01/04 02:09:34 Given that ModelSafeWorkers are refcounted, I thin
rlarocque 2014/01/06 20:03:33 I agree. This looks wrong to me, too. However, f
Nicolas Zea 2014/01/07 23:11:40 Fair enough, maybe file a bug to fix this in a sep
rlarocque 2014/01/08 01:37:23 Done: crbug.com/332251
tim (not reviewing) 2014/01/08 19:33:41 I think I traced this back to https://chromiumcode
rlarocque 2014/01/09 00:31:18 Oh, I see what happened there. I think I was tryi
29 ~ModelTypeRegistry();
30
31 // Sets the set of enabled types.
32 void SetEnabledDirectoryTypes(const ModelSafeRoutingInfo& routing_info);
33
34 // Simple getters.
35 UpdaterList* updater_list();
36 CommitterList* committer_list();
37
38 private:
39 // Classes to manage the types hooked up to receive and commit sync data.
40 scoped_ptr<UpdaterList> updater_list_;
41 scoped_ptr<CommitterList> committer_list_;
42
43 // The known ModelSafeWorkers.
44 std::map<ModelSafeGroup, scoped_refptr<ModelSafeWorker> > workers_map_;
45
46 // The directory. Not owned.
47 syncable::Directory* directory_;
Nicolas Zea 2014/01/04 02:09:34 DISALLOW_COPY_AND_ASSIGN
rlarocque 2014/01/06 20:03:33 Done.
48 };
49
50 } // namespace syncer
51
52 #endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_
53
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698