summaryrefslogtreecommitdiffstats
path: root/sync/engine/sync_scheduler_unittest.cc
diff options
context:
space:
mode:
authorearthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-25 19:12:17 +0000
committerearthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-25 19:12:17 +0000
commitbfd80f0bbc586d6254724530c1dbe376fd18e7eb (patch)
treef2bbe743018b4bc5ffef0c67e7a45805ac520aa5 /sync/engine/sync_scheduler_unittest.cc
parentaaffe1b11632e13935ef54148bfd6373e2c08cd7 (diff)
downloadchromium_src-bfd80f0bbc586d6254724530c1dbe376fd18e7eb.zip
chromium_src-bfd80f0bbc586d6254724530c1dbe376fd18e7eb.tar.gz
chromium_src-bfd80f0bbc586d6254724530c1dbe376fd18e7eb.tar.bz2
Revert 213642 "Lock-free shutdown of profile sync service. Chang..."
Reverting due to memory leaks. BUG=264325 > Lock-free shutdown of profile sync service. Changes include: > * Disconnect non-frontend processor/associator to stop accessing directory > so that sync backend can be shut down without waiting. > * Change non-frontend controller so that creation/destruction of > processor/associator doesn't depend on valid controller. So > scoped wait on stopping controller can be removed. > * Move sync thread to PSS. It's created when starting first backend and > destroyed on last browser thread. > > BUG=19757 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210333 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210955 > > Review URL: https://chromiumcodereview.appspot.com/16770005 TBR=haitaol@chromium.org Review URL: https://codereview.chromium.org/20374005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/engine/sync_scheduler_unittest.cc')
-rw-r--r--sync/engine/sync_scheduler_unittest.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/sync/engine/sync_scheduler_unittest.cc b/sync/engine/sync_scheduler_unittest.cc
index a09079a..3fb2042 100644
--- a/sync/engine/sync_scheduler_unittest.cc
+++ b/sync/engine/sync_scheduler_unittest.cc
@@ -17,7 +17,7 @@
#include "sync/test/engine/fake_model_worker.h"
#include "sync/test/engine/mock_connection_manager.h"
#include "sync/test/engine/test_directory_setter_upper.h"
-#include "sync/util/extensions_activity.h"
+#include "sync/test/fake_extensions_activity_monitor.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -126,7 +126,6 @@ class SyncSchedulerTest : public testing::Test {
dir_maker_.SetUp();
syncer_ = new MockSyncer();
delay_ = NULL;
- extensions_activity_ = new ExtensionsActivity();
routing_info_[BOOKMARKS] = GROUP_UI;
routing_info_[AUTOFILL] = GROUP_DB;
@@ -148,7 +147,7 @@ class SyncSchedulerTest : public testing::Test {
connection_->SetServerReachable();
context_.reset(new SyncSessionContext(
connection_.get(), directory(), workers,
- extensions_activity_.get(),
+ &extensions_activity_monitor_,
std::vector<SyncEngineEventListener*>(), NULL, NULL,
true, // enable keystore encryption
false, // force enable pre-commit GU avoidance
@@ -203,10 +202,8 @@ class SyncSchedulerTest : public testing::Test {
// This stops the scheduler synchronously.
void StopSyncScheduler() {
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&SyncSchedulerTest::DoQuitLoopNow,
- weak_ptr_factory_.GetWeakPtr()));
+ scheduler()->RequestStop(base::Bind(&SyncSchedulerTest::DoQuitLoopNow,
+ weak_ptr_factory_.GetWeakPtr()));
RunLoop();
}
@@ -236,8 +233,8 @@ class SyncSchedulerTest : public testing::Test {
return dir_maker_.directory();
}
- base::MessageLoop loop_;
base::WeakPtrFactory<SyncSchedulerTest> weak_ptr_factory_;
+ base::MessageLoop message_loop_;
TestDirectorySetterUpper dir_maker_;
scoped_ptr<MockConnectionManager> connection_;
scoped_ptr<SyncSessionContext> context_;
@@ -245,7 +242,7 @@ class SyncSchedulerTest : public testing::Test {
MockSyncer* syncer_;
MockDelayProvider* delay_;
std::vector<scoped_refptr<FakeModelWorker> > workers_;
- scoped_refptr<ExtensionsActivity> extensions_activity_;
+ FakeExtensionsActivityMonitor extensions_activity_monitor_;
ModelSafeRoutingInfo routing_info_;
};