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

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

Issue 2075012: Replace changes_channel with an observer list. (Closed)
Patch Set: Ready for checkin Created 10 years, 6 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/all_status.h ('k') | chrome/browser/sync/engine/syncapi.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/all_status.cc
diff --git a/chrome/browser/sync/engine/all_status.cc b/chrome/browser/sync/engine/all_status.cc
index 64ea9a71769d799d66ccdf99ec4b0d5597928aba..39509f4ea821bf610fa04efe8574b905725e5c74 100644
--- a/chrome/browser/sync/engine/all_status.cc
+++ b/chrome/browser/sync/engine/all_status.cc
@@ -50,6 +50,7 @@ AllStatus::AllStatus() : status_(init_status),
}
AllStatus::~AllStatus() {
+ syncer_thread_hookup_.reset();
delete channel_;
}
@@ -60,8 +61,7 @@ void AllStatus::WatchConnectionManager(ServerConnectionManager* conn_mgr) {
void AllStatus::WatchSyncerThread(SyncerThread* syncer_thread) {
syncer_thread_hookup_.reset(
- NewEventListenerHookup(syncer_thread->relay_channel(), this,
- &AllStatus::HandleSyncerEvent));
+ syncer_thread->relay_channel()->AddObserver(this));
}
AllStatus::Status AllStatus::CreateBlankStatus() const {
@@ -187,7 +187,7 @@ void AllStatus::HandleAuthWatcherEvent(const AuthWatcherEvent& auth_event) {
}
}
-void AllStatus::HandleSyncerEvent(const SyncerEvent& event) {
+void AllStatus::HandleChannelEvent(const SyncerEvent& event) {
ScopedStatusLockWithNotify lock(this);
switch (event.what_happened) {
case SyncerEvent::COMMITS_SUCCEEDED:
@@ -200,6 +200,7 @@ void AllStatus::HandleSyncerEvent(const SyncerEvent& event) {
// We're safe to use this value here because we don't call into the syncer
// or block on any processes.
lock.set_notify_plan(DONT_NOTIFY);
+ syncer_thread_hookup_.reset();
break;
case SyncerEvent::OVER_QUOTA:
LOG(WARNING) << "User has gone over quota.";
« no previous file with comments | « chrome/browser/sync/engine/all_status.h ('k') | chrome/browser/sync/engine/syncapi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698