summaryrefslogtreecommitdiffstats
path: root/sync/test
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-10 08:17:12 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-10 08:17:12 +0000
commit3a390f49536a1f6f1655d299ff34e515af6a8bd4 (patch)
tree7f95cc3c60136e1a191e2a939cfb58cbd992fd6d /sync/test
parenta4a9cd28821e607f14331cdce6bf57b2b35a37c2 (diff)
downloadchromium_src-3a390f49536a1f6f1655d299ff34e515af6a8bd4.zip
chromium_src-3a390f49536a1f6f1655d299ff34e515af6a8bd4.tar.gz
chromium_src-3a390f49536a1f6f1655d299ff34e515af6a8bd4.tar.bz2
Revert 222154 "sync: Gracefully handle very early shutdown"
Makes tests very Flaky. http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Chromium&testType=sync_integration_tests&tests=TwoClientPasswordsSyncTest.SetPassphraseAndThenSetupSync Can reproduce on local build. > sync: Gracefully handle very early shutdown > > Introduce a new object to communicate cross-thread cancellation signals. > This new object, the CancellationSignal, is protected by a lock. It > allows the receiving thread to query whether or not a stop has been > requested. It also allows the receiving thread to safely register a > cross-thread callback to be invoked immediately when a stop is > requested. > > This class is used to reimplement the UI thread to sync thread early > shutdown signal. Previously, the UI thread would try to call in to > objects owned by the sync thread. This required a workaround if the > signal arrived very early, since we couldn't guarantee the sync thread > had actually created those objects until later. The CancellationSignal > is owned by the UI thread, so it is safe to call its RequestStop() at > any point during sync initialization. The sync thread will receive the > signal when it's ready. > > The new scheme has a few advantages over the old: > - Thread ownership is simpler. The SyncBackendHost::Core, SyncManager, > ServerConnectionManager, SyncScheduler and Syncer can now claim that > all their member functions run on the sync thread. > - We no longer need to implement special case logic for when a shutdown > is requested before the SyncManager has initialized. > - In a future CL, we can take advantage of the fact that we no longer > require the special case to reduce inter-thread communication during > sync startup. This will make startup simpler and, in some cases, > improve sync startup time by as much as a few hundred milliseconds. > - This will make it easier to address crbug.com/236451. > > BUG=236451 > > Review URL: https://chromiumcodereview.appspot.com/23189021 TBR=rlarocque@chromium.org Review URL: https://codereview.chromium.org/23658030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/test')
-rw-r--r--sync/test/engine/fake_sync_scheduler.cc2
-rw-r--r--sync/test/engine/fake_sync_scheduler.h2
-rw-r--r--sync/test/engine/mock_connection_manager.cc2
-rw-r--r--sync/test/engine/mock_connection_manager.h1
4 files changed, 3 insertions, 4 deletions
diff --git a/sync/test/engine/fake_sync_scheduler.cc b/sync/test/engine/fake_sync_scheduler.cc
index 5d45494..1e0c7e8 100644
--- a/sync/test/engine/fake_sync_scheduler.cc
+++ b/sync/test/engine/fake_sync_scheduler.cc
@@ -13,7 +13,7 @@ FakeSyncScheduler::~FakeSyncScheduler() {}
void FakeSyncScheduler::Start(Mode mode) {
}
-void FakeSyncScheduler::Stop() {
+void FakeSyncScheduler::RequestStop() {
}
void FakeSyncScheduler::ScheduleLocalNudge(
diff --git a/sync/test/engine/fake_sync_scheduler.h b/sync/test/engine/fake_sync_scheduler.h
index 95bdfa9..11a63cc 100644
--- a/sync/test/engine/fake_sync_scheduler.h
+++ b/sync/test/engine/fake_sync_scheduler.h
@@ -20,7 +20,7 @@ class FakeSyncScheduler : public SyncScheduler {
virtual ~FakeSyncScheduler();
virtual void Start(Mode mode) OVERRIDE;
- virtual void Stop() OVERRIDE;
+ virtual void RequestStop() OVERRIDE;
virtual void ScheduleLocalNudge(
const base::TimeDelta& desired_delay,
ModelTypeSet types,
diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc
index 6668638..5bf2b4b 100644
--- a/sync/test/engine/mock_connection_manager.cc
+++ b/sync/test/engine/mock_connection_manager.cc
@@ -34,7 +34,7 @@ static char kValidAuthToken[] = "AuthToken";
static char kCacheGuid[] = "kqyg7097kro6GSUod+GSg==";
MockConnectionManager::MockConnectionManager(syncable::Directory* directory)
- : ServerConnectionManager("unused", 0, false, false, NULL),
+ : ServerConnectionManager("unused", 0, false, false),
server_reachable_(true),
conflict_all_commits_(false),
conflict_n_commits_(0),
diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h
index d82a1bf..83de59a 100644
--- a/sync/test/engine/mock_connection_manager.h
+++ b/sync/test/engine/mock_connection_manager.h
@@ -15,7 +15,6 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_vector.h"
-#include "base/synchronization/lock.h"
#include "sync/engine/net/server_connection_manager.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/internal_api/public/base/unique_position.h"