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

Side by Side Diff: chrome/browser/sync/engine/syncer_command.cc

Issue 9036003: Avoid useless SYNC_CYCLE_CONTINUATION sync cycle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/engine/syncer_command.h ('k') | chrome/browser/sync/engine/syncer_error.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 10
11 namespace browser_sync { 11 namespace browser_sync {
12 using sessions::SyncSession; 12 using sessions::SyncSession;
13 13
14 SyncerCommand::SyncerCommand() {} 14 SyncerCommand::SyncerCommand() {}
15 SyncerCommand::~SyncerCommand() {} 15 SyncerCommand::~SyncerCommand() {}
16 16
17 void SyncerCommand::Execute(SyncSession* session) { 17 SyncerError SyncerCommand::Execute(SyncSession* session) {
18 ExecuteImpl(session); 18 SyncerError result = ExecuteImpl(session);
19 SendNotifications(session); 19 SendNotifications(session);
20 return result;
20 } 21 }
21 22
22 void SyncerCommand::SendNotifications(SyncSession* session) { 23 void SyncerCommand::SendNotifications(SyncSession* session) {
23 syncable::ScopedDirLookup dir(session->context()->directory_manager(), 24 syncable::ScopedDirLookup dir(session->context()->directory_manager(),
24 session->context()->account_name()); 25 session->context()->account_name());
25 if (!dir.good()) { 26 if (!dir.good()) {
26 LOG(ERROR) << "Scoped dir lookup failed!"; 27 LOG(ERROR) << "Scoped dir lookup failed!";
27 return; 28 return;
28 } 29 }
29 30
30 if (session->mutable_status_controller()->TestAndClearIsDirty()) { 31 if (session->mutable_status_controller()->TestAndClearIsDirty()) {
31 SyncEngineEvent event(SyncEngineEvent::STATUS_CHANGED); 32 SyncEngineEvent event(SyncEngineEvent::STATUS_CHANGED);
32 const sessions::SyncSessionSnapshot& snapshot(session->TakeSnapshot()); 33 const sessions::SyncSessionSnapshot& snapshot(session->TakeSnapshot());
33 event.snapshot = &snapshot; 34 event.snapshot = &snapshot;
34 session->context()->NotifyListeners(event); 35 session->context()->NotifyListeners(event);
35 } 36 }
36 } 37 }
37 38
38 } // namespace browser_sync 39 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_command.h ('k') | chrome/browser/sync/engine/syncer_error.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698