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

Side by Side Diff: chrome/browser/sync/engine/syncer_command.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 unified diff | Download patch
« no previous file with comments | « chrome/browser/sync/engine/syncer.cc ('k') | chrome/browser/sync/engine/syncer_end_command.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/engine/syncer_command.h" 5 #include "chrome/browser/sync/engine/syncer_command.h"
6 6
7 #include "chrome/browser/sync/engine/net/server_connection_manager.h" 7 #include "chrome/browser/sync/engine/net/server_connection_manager.h"
8 #include "chrome/browser/sync/sessions/sync_session.h" 8 #include "chrome/browser/sync/sessions/sync_session.h"
9 #include "chrome/browser/sync/syncable/directory_manager.h" 9 #include "chrome/browser/sync/syncable/directory_manager.h"
10 #include "chrome/browser/sync/util/sync_types.h" 10 #include "chrome/browser/sync/util/sync_types.h"
(...skipping 16 matching lines...) Expand all
27 if (!dir.good()) { 27 if (!dir.good()) {
28 LOG(ERROR) << "Scoped dir lookup failed!"; 28 LOG(ERROR) << "Scoped dir lookup failed!";
29 return; 29 return;
30 } 30 }
31 31
32 if (session->status_controller()->TestAndClearIsDirty()) { 32 if (session->status_controller()->TestAndClearIsDirty()) {
33 SyncerEvent event(SyncerEvent::STATUS_CHANGED); 33 SyncerEvent event(SyncerEvent::STATUS_CHANGED);
34 const sessions::SyncSessionSnapshot& snapshot(session->TakeSnapshot()); 34 const sessions::SyncSessionSnapshot& snapshot(session->TakeSnapshot());
35 event.snapshot = &snapshot; 35 event.snapshot = &snapshot;
36 DCHECK(session->context()->syncer_event_channel()); 36 DCHECK(session->context()->syncer_event_channel());
37 session->context()->syncer_event_channel()->NotifyListeners(event); 37 session->context()->syncer_event_channel()->Notify(event);
38 if (session->status_controller()->syncer_status().over_quota) { 38 if (session->status_controller()->syncer_status().over_quota) {
39 SyncerEvent quota_event(SyncerEvent::OVER_QUOTA); 39 SyncerEvent quota_event(SyncerEvent::OVER_QUOTA);
40 quota_event.snapshot = &snapshot; 40 quota_event.snapshot = &snapshot;
41 session->context()->syncer_event_channel()->NotifyListeners(quota_event); 41 session->context()->syncer_event_channel()->Notify(quota_event);
42 } 42 }
43 } 43 }
44 } 44 }
45 45
46 } // namespace browser_sync 46 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer.cc ('k') | chrome/browser/sync/engine/syncer_end_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698