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

Side by Side Diff: chrome/browser/sync/test/engine/fake_model_safe_worker_registrar.cc

Issue 8625005: [Sync] Make ModelSafeWorker a true interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 9 years, 1 month 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) 2011 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 #include "chrome/browser/sync/test/engine/fake_model_safe_worker_registrar.h"
6
7 #include "chrome/browser/sync/test/engine/fake_model_worker.h"
8
9 namespace browser_sync {
10
11 FakeModelSafeWorkerRegistrar::FakeModelSafeWorkerRegistrar(
12 const ModelSafeRoutingInfo& routes) : routes_(routes) {
13 std::set<ModelSafeGroup> groups;
14 for (ModelSafeRoutingInfo::const_iterator it = routes_.begin();
15 it != routes_.end(); ++it) {
16 groups.insert(it->second);
17 }
18
19 for (std::set<ModelSafeGroup>::const_iterator it = groups.begin();
20 it != groups.end(); ++it) {
21 workers_.push_back(make_scoped_refptr(new FakeModelWorker(*it)));
22 }
23 }
24
25 FakeModelSafeWorkerRegistrar::~FakeModelSafeWorkerRegistrar() {}
26
27 void FakeModelSafeWorkerRegistrar::GetWorkers(
28 std::vector<ModelSafeWorker*>* out) {
29 for (std::vector<scoped_refptr<ModelSafeWorker> >::const_iterator it =
30 workers_.begin(); it != workers_.end(); ++it) {
31 out->push_back(it->get());
32 }
33 }
34
35 void FakeModelSafeWorkerRegistrar::GetModelSafeRoutingInfo(
36 ModelSafeRoutingInfo* out) {
37 *out = routes_;
38 }
39
40 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698