summaryrefslogtreecommitdiffstats
path: root/sync/sessions
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-30 04:37:48 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-30 04:37:48 +0000
commit62c28b9b77bb585b190ec8afaef43d5bcb764c79 (patch)
tree0081e6a5f3f5c3822929355cf6ef41b955c78d9b /sync/sessions
parente841d0622eb6119d407d4acf4eeb6402c7c49ea8 (diff)
downloadchromium_src-62c28b9b77bb585b190ec8afaef43d5bcb764c79.zip
chromium_src-62c28b9b77bb585b190ec8afaef43d5bcb764c79.tar.gz
chromium_src-62c28b9b77bb585b190ec8afaef43d5bcb764c79.tar.bz2
Make SyncBackendRegistrar aware of loaded data
Adds a parameter to the SyncManager::Initialize() callback to inform the caller which sync data types were successfully loaded from disk. This allows the SyncBackendHost and related classes make better decisions during initialization. If necessary, the SyncBackendHost will send a configure request to the syncer during early initialization asking it to download the nigori node. Now we can guarantee that the node will be available by the type ProfileSyncService::OnBackendInitialized() is called. The SyncBackendHost test expectations had to be amended to account for this test. Most of the changes are related to the fact that our behaviour no longer depends on the SyncPrefs. The ProfileSyncService*Tests were very much affected by this change. Those tests are parameterized with a callback that is used to initialize the sync DB and pretend that it had been loaded from disk. Previously, this callback would be executed later on during initialization, around the time of ProfileSyncService::OnBackendInitialize(). That approach was incompatible with this change, which requires that we have access to the fully initialized database around the time we return from SyncBackendHost::Initialize(). The callback had to be moved, which meant that it now required an explicit UserShare parameter, which meant that a lot of call sites had to be updated. BUG=129825 TEST= Review URL: https://chromiumcodereview.appspot.com/10804039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions')
-rw-r--r--sync/sessions/sync_session_context.cc2
-rw-r--r--sync/sessions/sync_session_context.h1
-rw-r--r--sync/sessions/sync_session_unittest.cc27
3 files changed, 16 insertions, 14 deletions
diff --git a/sync/sessions/sync_session_context.cc b/sync/sessions/sync_session_context.cc
index 8e28b5f..7b6349b 100644
--- a/sync/sessions/sync_session_context.cc
+++ b/sync/sessions/sync_session_context.cc
@@ -17,7 +17,6 @@ const unsigned int kMaxMessageSizeToRecord = 5 * 1024;
SyncSessionContext::SyncSessionContext(
ServerConnectionManager* connection_manager,
syncable::Directory* directory,
- const ModelSafeRoutingInfo& model_safe_routing_info,
const std::vector<ModelSafeWorker*>& workers,
ExtensionsActivityMonitor* extensions_activity_monitor,
ThrottledDataTypeTracker* throttled_data_type_tracker,
@@ -27,7 +26,6 @@ SyncSessionContext::SyncSessionContext(
: resolver_(NULL),
connection_manager_(connection_manager),
directory_(directory),
- routing_info_(model_safe_routing_info),
workers_(workers),
extensions_activity_monitor_(extensions_activity_monitor),
notifications_enabled_(false),
diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h
index 3255b94..cd26d5e 100644
--- a/sync/sessions/sync_session_context.h
+++ b/sync/sessions/sync_session_context.h
@@ -51,7 +51,6 @@ class SyncSessionContext {
public:
SyncSessionContext(ServerConnectionManager* connection_manager,
syncable::Directory* directory,
- const ModelSafeRoutingInfo& model_safe_routing_info,
const std::vector<ModelSafeWorker*>& workers,
ExtensionsActivityMonitor* extensions_activity_monitor,
ThrottledDataTypeTracker* throttled_data_type_tracker,
diff --git a/sync/sessions/sync_session_unittest.cc b/sync/sessions/sync_session_unittest.cc
index 1029e1d..bd17d359 100644
--- a/sync/sessions/sync_session_unittest.cc
+++ b/sync/sessions/sync_session_unittest.cc
@@ -41,17 +41,6 @@ class SyncSessionTest : public testing::Test,
}
virtual void SetUp() {
- ModelSafeRoutingInfo routing_info;
- std::vector<ModelSafeWorker*> workers;
-
- GetModelSafeRoutingInfo(&routing_info);
- GetWorkers(&workers);
-
- context_.reset(
- new SyncSessionContext(
- NULL, NULL, routing_info, workers, &extensions_activity_monitor_,
- throttled_data_type_tracker_.get(),
- std::vector<SyncEngineEventListener*>(), NULL, NULL));
routes_.clear();
routes_[BOOKMARKS] = GROUP_UI;
routes_[AUTOFILL] = GROUP_DB;
@@ -65,6 +54,22 @@ class SyncSessionTest : public testing::Test,
workers_.push_back(passive_worker);
workers_.push_back(ui_worker);
workers_.push_back(db_worker);
+
+ std::vector<ModelSafeWorker*> workers;
+ GetWorkers(&workers);
+
+ context_.reset(
+ new SyncSessionContext(
+ NULL,
+ NULL,
+ workers,
+ &extensions_activity_monitor_,
+ throttled_data_type_tracker_.get(),
+ std::vector<SyncEngineEventListener*>(),
+ NULL,
+ NULL));
+ context_->set_routing_info(routes_);
+
session_.reset(MakeSession());
throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL));
}