Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3302)

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 6794005: Move sync notifier contruction out of syncer thread. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebase Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/engine/syncapi_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.cc
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 426c37b95e66fa6a02f707d98dc24e6c332fb616..00a11a5971f54006f7afe320bdf2457496241516 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -1484,7 +1484,7 @@ class SyncManager::SyncInternal
scoped_ptr<SyncerThreadAdapter> syncer_thread_;
// The SyncNotifier which notifies us when updates need to be downloaded.
- scoped_ptr<sync_notifier::SyncNotifier> sync_notifier_;
+ sync_notifier::SyncNotifier* sync_notifier_;
// A multi-purpose status watch object that aggregates stats from various
// sync components.
@@ -1689,7 +1689,7 @@ bool SyncManager::SyncInternal::Init(
registrar_ = model_safe_worker_registrar;
setup_for_test_mode_ = setup_for_test_mode;
- sync_notifier_.reset(sync_notifier);
+ sync_notifier_ = sync_notifier;
sync_notifier_->AddObserver(this);
share_.dir_manager.reset(new DirectoryManager(database_location));
@@ -1812,7 +1812,7 @@ void SyncManager::SyncInternal::MarkAndNotifyInitializationComplete() {
void SyncManager::SyncInternal::SendNotification() {
DCHECK_EQ(MessageLoop::current(), core_message_loop_);
- if (!sync_notifier_.get()) {
+ if (!sync_notifier_) {
VLOG(1) << "Not sending notification: sync_notifier_ is NULL";
return;
}
@@ -2133,9 +2133,8 @@ void SyncManager::SyncInternal::Shutdown() {
// We NULL out sync_notifer_ so that any pending tasks do not
// trigger further notifications.
// TODO(akalin): NULL the other member variables defensively, too.
- if (sync_notifier_.get()) {
+ if (sync_notifier_) {
sync_notifier_->RemoveObserver(this);
- sync_notifier_.reset();
}
// Pump any messages the auth watcher, syncer thread, or talk
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/engine/syncapi_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698