summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/sync_manager_impl_unittest.cc
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-11 03:11:06 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-11 03:11:06 +0000
commitf8197029e47adb3512609ec18f5aa7f3059befd3 (patch)
tree55aca64c9cf27ff7a9dc0cbc3a401ae27692dfba /sync/internal_api/sync_manager_impl_unittest.cc
parent2db1e9f2c1502d384c9e5f849cfc85eec7875787 (diff)
downloadchromium_src-f8197029e47adb3512609ec18f5aa7f3059befd3.zip
chromium_src-f8197029e47adb3512609ec18f5aa7f3059befd3.tar.gz
chromium_src-f8197029e47adb3512609ec18f5aa7f3059befd3.tar.bz2
sync: Consistently refcount ModelSafeWorkers
Certain interfaces in sync had signatures that included vectors of raw pointers to ModelSafeWorkers. The use of raw pointers to refcounted objects looks a lot like a bug waiting to happen. This CL replaces any use of std::vector<ModelSafeWorker*> with std::vector<scoped_refptr<ModelSafeWorker> >. This is not expected to alter sync behavior in any significant way. BUG=332251 Review URL: https://codereview.chromium.org/130193002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_manager_impl_unittest.cc')
-rw-r--r--sync/internal_api/sync_manager_impl_unittest.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc
index c8d5817..57e2a5b 100644
--- a/sync/internal_api/sync_manager_impl_unittest.cc
+++ b/sync/internal_api/sync_manager_impl_unittest.cc
@@ -813,7 +813,7 @@ class SyncManagerTest : public testing::Test,
EXPECT_FALSE(js_backend_.IsInitialized());
- std::vector<ModelSafeWorker*> workers;
+ std::vector<scoped_refptr<ModelSafeWorker> > workers;
ModelSafeRoutingInfo routing_info;
GetModelSafeRoutingInfo(&routing_info);
@@ -821,7 +821,7 @@ class SyncManagerTest : public testing::Test,
// If we had types in other groups, we would need additional workers
// to support them.
scoped_refptr<ModelSafeWorker> worker = new FakeModelWorker(GROUP_PASSIVE);
- workers.push_back(worker.get());
+ workers.push_back(worker);
// Takes ownership of |fake_invalidator_|.
sync_manager_.Init(