diff options
author | haitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 01:31:55 +0000 |
---|---|---|
committer | haitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 01:31:55 +0000 |
commit | 93dcabfb6d0d60e2c4a2bed38cd4803303c9a377 (patch) | |
tree | 240e9b1419d01ed7cb3b4f0486d18e760c231381 /sync/sessions | |
parent | 496552ef030bd2eec4c072c6b3d7ba84f38c80d4 (diff) | |
download | chromium_src-93dcabfb6d0d60e2c4a2bed38cd4803303c9a377.zip chromium_src-93dcabfb6d0d60e2c4a2bed38cd4803303c9a377.tar.gz chromium_src-93dcabfb6d0d60e2c4a2bed38cd4803303c9a377.tar.bz2 |
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
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213642
Review URL: https://chromiumcodereview.appspot.com/16770005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions')
-rw-r--r-- | sync/sessions/sync_session_context.cc | 6 | ||||
-rw-r--r-- | sync/sessions/sync_session_context.h | 10 | ||||
-rw-r--r-- | sync/sessions/sync_session_unittest.cc | 8 |
3 files changed, 13 insertions, 11 deletions
diff --git a/sync/sessions/sync_session_context.cc b/sync/sessions/sync_session_context.cc index c48c32b..98ab5f0 100644 --- a/sync/sessions/sync_session_context.cc +++ b/sync/sessions/sync_session_context.cc @@ -5,7 +5,7 @@ #include "sync/sessions/sync_session_context.h" #include "sync/sessions/debug_info_getter.h" -#include "sync/util/extensions_activity_monitor.h" +#include "sync/util/extensions_activity.h" namespace syncer { namespace sessions { @@ -17,7 +17,7 @@ SyncSessionContext::SyncSessionContext( ServerConnectionManager* connection_manager, syncable::Directory* directory, const std::vector<ModelSafeWorker*>& workers, - ExtensionsActivityMonitor* extensions_activity_monitor, + ExtensionsActivity* extensions_activity, const std::vector<SyncEngineEventListener*>& listeners, DebugInfoGetter* debug_info_getter, TrafficRecorder* traffic_recorder, @@ -26,7 +26,7 @@ SyncSessionContext::SyncSessionContext( const std::string& invalidator_client_id) : connection_manager_(connection_manager), directory_(directory), - extensions_activity_monitor_(extensions_activity_monitor), + extensions_activity_(extensions_activity), notifications_enabled_(false), max_commit_batch_size_(kDefaultMaxCommitBatchSize), debug_info_getter_(debug_info_getter), diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h index 7617095..718cc6c 100644 --- a/sync/sessions/sync_session_context.h +++ b/sync/sessions/sync_session_context.h @@ -32,7 +32,7 @@ namespace syncer { -class ExtensionsActivityMonitor; +class ExtensionsActivity; class ServerConnectionManager; namespace syncable { @@ -50,7 +50,7 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext { SyncSessionContext(ServerConnectionManager* connection_manager, syncable::Directory* directory, const std::vector<ModelSafeWorker*>& workers, - ExtensionsActivityMonitor* extensions_activity_monitor, + ExtensionsActivity* extensions_activity, const std::vector<SyncEngineEventListener*>& listeners, DebugInfoGetter* debug_info_getter, TrafficRecorder* traffic_recorder, @@ -79,8 +79,8 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext { return workers_; } - ExtensionsActivityMonitor* extensions_monitor() { - return extensions_activity_monitor_; + ExtensionsActivity* extensions_activity() { + return extensions_activity_.get(); } DebugInfoGetter* debug_info_getter() { @@ -159,7 +159,7 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext { // We use this to stuff extensions activity into CommitMessages so the server // can correlate commit traffic with extension-related bookmark mutations. - ExtensionsActivityMonitor* extensions_activity_monitor_; + scoped_refptr<ExtensionsActivity> extensions_activity_; // Kept up to date with talk events to determine whether notifications are // enabled. True only if the notification channel is authorized and open. diff --git a/sync/sessions/sync_session_unittest.cc b/sync/sessions/sync_session_unittest.cc index 4acee56..979ddbd 100644 --- a/sync/sessions/sync_session_unittest.cc +++ b/sync/sessions/sync_session_unittest.cc @@ -16,7 +16,7 @@ #include "sync/syncable/syncable_write_transaction.h" #include "sync/test/engine/fake_model_worker.h" #include "sync/test/engine/test_directory_setter_upper.h" -#include "sync/test/fake_extensions_activity_monitor.h" +#include "sync/util/extensions_activity.h" #include "testing/gtest/include/gtest/gtest.h" namespace syncer { @@ -38,6 +38,8 @@ class SyncSessionTest : public testing::Test, } virtual void SetUp() { + extensions_activity_ = new ExtensionsActivity(); + routes_.clear(); routes_[BOOKMARKS] = GROUP_UI; routes_[AUTOFILL] = GROUP_DB; @@ -60,7 +62,7 @@ class SyncSessionTest : public testing::Test, NULL, NULL, workers, - &extensions_activity_monitor_, + extensions_activity_.get(), std::vector<SyncEngineEventListener*>(), NULL, NULL, @@ -146,7 +148,7 @@ class SyncSessionTest : public testing::Test, scoped_ptr<SyncSessionContext> context_; std::vector<scoped_refptr<ModelSafeWorker> > workers_; ModelSafeRoutingInfo routes_; - FakeExtensionsActivityMonitor extensions_activity_monitor_; + scoped_refptr<ExtensionsActivity> extensions_activity_; }; TEST_F(SyncSessionTest, MoreToDownloadIfDownloadFailed) { |