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

Unified Diff: sync/engine/syncer_unittest.cc

Issue 130193002: sync: Consistently refcount ModelSafeWorkers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix standalone sync client 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/internal_api/internal_components_factory_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer_unittest.cc
diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc
index 19aff7c3b115dd63a34d50cfb9bb53e03360d0f5..951d443c427df841956abe7c0a055c18405d7137 100644
--- a/sync/engine/syncer_unittest.cc
+++ b/sync/engine/syncer_unittest.cc
@@ -154,10 +154,6 @@ class SyncerTest : public testing::Test,
const sessions::SyncSessionSnapshot& snapshot) OVERRIDE {
}
- void GetWorkers(std::vector<ModelSafeWorker*>* out) {
- out->push_back(worker_.get());
- }
-
void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) {
// We're just testing the sync engine here, so we shunt everything to
// the SyncerThread. Datatypes which aren't enabled aren't in the map.
@@ -215,19 +211,17 @@ class SyncerTest : public testing::Test,
EnableDatatype(NIGORI);
EnableDatatype(PREFERENCES);
EnableDatatype(NIGORI);
- worker_ = new FakeModelWorker(GROUP_PASSIVE);
+ workers_.push_back(scoped_refptr<ModelSafeWorker>(
+ new FakeModelWorker(GROUP_PASSIVE)));
std::vector<SyncEngineEventListener*> listeners;
listeners.push_back(this);
ModelSafeRoutingInfo routing_info;
- std::vector<ModelSafeWorker*> workers;
-
GetModelSafeRoutingInfo(&routing_info);
- GetWorkers(&workers);
context_.reset(
new SyncSessionContext(
- mock_server_.get(), directory(), workers,
+ mock_server_.get(), directory(), workers_,
extensions_activity_,
listeners, debug_info_getter_.get(), &traffic_recorder_,
true, // enable keystore encryption
@@ -504,7 +498,7 @@ class SyncerTest : public testing::Test,
base::TimeDelta last_long_poll_interval_received_;
base::TimeDelta last_sessions_commit_delay_seconds_;
int last_client_invalidation_hint_buffer_size_;
- scoped_refptr<ModelSafeWorker> worker_;
+ std::vector<scoped_refptr<ModelSafeWorker> > workers_;
ModelTypeSet enabled_datatypes_;
TrafficRecorder traffic_recorder_;
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/internal_api/internal_components_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698