summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync
diff options
context:
space:
mode:
authorzork@google.com <zork@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 01:35:02 +0000
committerzork@google.com <zork@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 01:35:02 +0000
commit85a3078932047ca5663b59c0d70953bbbce6b9e9 (patch)
tree729cf77d05b613b93afa471d1123c59f7b0867b7 /chrome/browser/sync
parentaa95dcbcd337503c94ba7a6fce01856df2ae9af9 (diff)
downloadchromium_src-85a3078932047ca5663b59c0d70953bbbce6b9e9.zip
chromium_src-85a3078932047ca5663b59c0d70953bbbce6b9e9.tar.gz
chromium_src-85a3078932047ca5663b59c0d70953bbbce6b9e9.tar.bz2
Add database model worker to worker registry and remove deprecated thread
check. BUG=29926 TEST=Attempt to sync Autofill with a dev server. Review URL: http://codereview.chromium.org/660343 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40341 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 31626cb..e774b85 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -8,6 +8,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/sync/glue/change_processor.h"
+#include "chrome/browser/sync/glue/database_model_worker.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
#include "chrome/browser/sync/glue/http_bridge.h"
#include "webkit/glue/webkit_glue.h"
@@ -59,6 +60,7 @@ void SyncBackendHost::Initialize(
// after the syncapi is destroyed. Make sure to NULL-check workers_ indices
// when a new type is synced as the worker may already exist and you just
// need to update routing_info_.
+ registrar_.workers[GROUP_DB] = new DatabaseModelWorker();
registrar_.workers[GROUP_UI] = new UIModelWorker(frontend_loop_);
registrar_.workers[GROUP_PASSIVE] = new ModelSafeWorker();
@@ -121,8 +123,10 @@ void SyncBackendHost::Shutdown(bool sync_disabled) {
core_thread_.Stop();
registrar_.routing_info.clear();
+ registrar_.workers[GROUP_DB] = NULL;
registrar_.workers[GROUP_UI] = NULL;
registrar_.workers[GROUP_PASSIVE] = NULL;
+ registrar_.workers.erase(GROUP_DB);
registrar_.workers.erase(GROUP_UI);
registrar_.workers.erase(GROUP_PASSIVE);
frontend_ = NULL;
@@ -329,19 +333,6 @@ void SyncBackendHost::Core::OnChangesApplied(
return;
ChangeProcessor* processor = it->second;
- // ChangesApplied is the one exception that should come over from the sync
- // backend already on the service_loop_ thanks to our UIModelWorker.
- // SyncFrontend changes exclusively on the UI loop, because it updates
- // the bookmark model. As such, we don't need to worry about changes that
- // have been made to the bookmark model but not yet applied to the sync
- // model -- such changes only happen on the UI loop, and there's no
- // contention.
- if (host_->frontend_loop_ != MessageLoop::current()) {
- // TODO(ncarter): Bug 1480644. Make this a DCHECK once syncapi filters
- // out all irrelevant changes.
- DLOG(WARNING) << "Could not update bookmark model from non-UI thread";
- return;
- }
processor->ApplyChangesFromSyncModel(trans, changes, change_count);
}