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

Side by Side Diff: sync/engine/apply_updates_command.cc

Issue 11190013: sync: Remove UpdateProgress and related code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Formatting improvements Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sync/engine/apply_updates_command_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/engine/apply_updates_command.h" 5 #include "sync/engine/apply_updates_command.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "sync/engine/update_applicator.h" 8 #include "sync/engine/update_applicator.h"
9 #include "sync/sessions/sync_session.h" 9 #include "sync/sessions/sync_session.h"
10 #include "sync/syncable/directory.h" 10 #include "sync/syncable/directory.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 std::vector<int64> handles; 64 std::vector<int64> handles;
65 dir->GetUnappliedUpdateMetaHandles( 65 dir->GetUnappliedUpdateMetaHandles(
66 &trans, server_type_restriction, &handles); 66 &trans, server_type_restriction, &handles);
67 67
68 UpdateApplicator applicator( 68 UpdateApplicator applicator(
69 dir->GetCryptographer(&trans), 69 dir->GetCryptographer(&trans),
70 session->routing_info(), 70 session->routing_info(),
71 session->status_controller().group_restriction()); 71 session->status_controller().group_restriction());
72 applicator.AttemptApplications(&trans, handles, 72 applicator.AttemptApplications(&trans, handles,
73 session->mutable_status_controller()); 73 session->mutable_status_controller());
74 applicator.SaveProgressIntoSessionState(
75 session->mutable_status_controller()->mutable_simple_conflict_ids(),
76 session->mutable_status_controller()->mutable_update_progress());
77 74
78 // This might be the first time we've fully completed a sync cycle, for 75 // This might be the first time we've fully completed a sync cycle, for
79 // some subset of the currently synced datatypes. 76 // some subset of the currently synced datatypes.
80 const sessions::StatusController& status(session->status_controller()); 77 const sessions::StatusController& status(session->status_controller());
81 if (status.ServerSaysNothingMoreToDownload()) { 78 if (status.ServerSaysNothingMoreToDownload()) {
82 for (ModelTypeSet::Iterator it = 79 for (ModelTypeSet::Iterator it =
83 status.updates_request_types().First(); it.Good(); it.Inc()) { 80 status.updates_request_types().First(); it.Good(); it.Inc()) {
84 // Don't set the flag for control types. We didn't process them here. 81 // Don't set the flag for control types. We didn't process them here.
85 if (IsControlType(it.Get())) 82 if (IsControlType(it.Get()))
86 continue; 83 continue;
87 84
88 // This gets persisted to the directory's backing store. 85 // This gets persisted to the directory's backing store.
89 dir->set_initial_sync_ended_for_type(it.Get(), true); 86 dir->set_initial_sync_ended_for_type(it.Get(), true);
90 } 87 }
91 } 88 }
92 89
93 return SYNCER_OK; 90 return SYNCER_OK;
94 } 91 }
95 92
96 } // namespace syncer 93 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | sync/engine/apply_updates_command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698