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

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

Issue 10825137: FYI: Control Data + Per-Device Metadata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add PER_USER_METADATA, refactor some encryption code Created 8 years, 4 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
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 14 matching lines...) Expand all
25 FullModelTypeSet server_types_with_unapplied_updates; 25 FullModelTypeSet server_types_with_unapplied_updates;
26 { 26 {
27 syncable::Directory* dir = session.context()->directory(); 27 syncable::Directory* dir = session.context()->directory();
28 syncable::ReadTransaction trans(FROM_HERE, dir); 28 syncable::ReadTransaction trans(FROM_HERE, dir);
29 server_types_with_unapplied_updates = 29 server_types_with_unapplied_updates =
30 dir->GetServerTypesWithUnappliedUpdates(&trans); 30 dir->GetServerTypesWithUnappliedUpdates(&trans);
31 } 31 }
32 32
33 for (FullModelTypeSet::Iterator it = 33 for (FullModelTypeSet::Iterator it =
34 server_types_with_unapplied_updates.First(); it.Good(); it.Inc()) { 34 server_types_with_unapplied_updates.First(); it.Good(); it.Inc()) {
35 VLOG(2) << "TYPES: " << ModelTypeToString(it.Get());
35 groups_with_unapplied_updates.insert( 36 groups_with_unapplied_updates.insert(
36 GetGroupForModelType(it.Get(), session.routing_info())); 37 GetGroupForModelType(it.Get(), session.routing_info()));
37 } 38 }
38 39
40 // The INTERNAL types are special. They have their own update routines,
rlarocque 2012/08/11 01:31:52 s/INTERNAL/CONTROL
41 // ApplyUpdatesCommand should not process them.
42 groups_with_unapplied_updates.erase(GROUP_CONTROL);
43
39 return groups_with_unapplied_updates; 44 return groups_with_unapplied_updates;
40 } 45 }
41 46
42 SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl( 47 SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl(
43 SyncSession* session) { 48 SyncSession* session) {
44 syncable::Directory* dir = session->context()->directory(); 49 syncable::Directory* dir = session->context()->directory();
45 syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir); 50 syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir);
46 51
47 // Compute server types with unapplied updates that fall under our 52 // Compute server types with unapplied updates that fall under our
48 // group restriction. 53 // group restriction.
(...skipping 30 matching lines...) Expand all
79 status.updates_request_types().First(); it.Good(); it.Inc()) { 84 status.updates_request_types().First(); it.Good(); it.Inc()) {
80 // This gets persisted to the directory's backing store. 85 // This gets persisted to the directory's backing store.
81 dir->set_initial_sync_ended_for_type(it.Get(), true); 86 dir->set_initial_sync_ended_for_type(it.Get(), true);
82 } 87 }
83 } 88 }
84 89
85 return SYNCER_OK; 90 return SYNCER_OK;
86 } 91 }
87 92
88 } // namespace syncer 93 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698