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

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

Issue 271613006: sync: Populate debug counters for directory types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/process_updates_util.h" 5 #include "sync/engine/process_updates_util.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "sync/engine/syncer_proto_util.h" 8 #include "sync/engine/syncer_proto_util.h"
9 #include "sync/engine/syncer_types.h" 9 #include "sync/engine/syncer_types.h"
10 #include "sync/engine/syncer_util.h" 10 #include "sync/engine/syncer_util.h"
11 #include "sync/internal_api/public/sessions/update_counters.h"
11 #include "sync/syncable/directory.h" 12 #include "sync/syncable/directory.h"
12 #include "sync/syncable/model_neutral_mutable_entry.h" 13 #include "sync/syncable/model_neutral_mutable_entry.h"
13 #include "sync/syncable/syncable_model_neutral_write_transaction.h" 14 #include "sync/syncable/syncable_model_neutral_write_transaction.h"
14 #include "sync/syncable/syncable_proto_util.h" 15 #include "sync/syncable/syncable_proto_util.h"
15 #include "sync/syncable/syncable_util.h" 16 #include "sync/syncable/syncable_util.h"
16 #include "sync/util/cryptographer.h" 17 #include "sync/util/cryptographer.h"
17 18
18 namespace syncer { 19 namespace syncer {
19 20
20 using sessions::StatusController; 21 using sessions::StatusController;
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 return; 279 return;
279 } 280 }
280 281
281 } // namespace 282 } // namespace
282 283
283 void ProcessDownloadedUpdates( 284 void ProcessDownloadedUpdates(
284 syncable::Directory* dir, 285 syncable::Directory* dir,
285 syncable::ModelNeutralWriteTransaction* trans, 286 syncable::ModelNeutralWriteTransaction* trans,
286 ModelType type, 287 ModelType type,
287 const SyncEntityList& applicable_updates, 288 const SyncEntityList& applicable_updates,
288 sessions::StatusController* status) { 289 sessions::StatusController* status,
290 UpdateCounters* counters) {
289 for (SyncEntityList::const_iterator update_it = applicable_updates.begin(); 291 for (SyncEntityList::const_iterator update_it = applicable_updates.begin();
290 update_it != applicable_updates.end(); ++update_it) { 292 update_it != applicable_updates.end(); ++update_it) {
291 DCHECK_EQ(type, GetModelType(**update_it)); 293 DCHECK_EQ(type, GetModelType(**update_it));
292 if (!UpdateContainsNewVersion(trans, **update_it)) 294 if (!UpdateContainsNewVersion(trans, **update_it)) {
293 status->increment_num_reflected_updates_downloaded_by(1); 295 status->increment_num_reflected_updates_downloaded_by(1);
294 if ((*update_it)->deleted()) 296 counters->num_reflected_updates_received++;
297 }
298 if ((*update_it)->deleted()) {
295 status->increment_num_tombstone_updates_downloaded_by(1); 299 status->increment_num_tombstone_updates_downloaded_by(1);
300 counters->num_tombstone_updates_received++;
301 }
296 VerifyResult verify_result = VerifyUpdate(trans, **update_it, type); 302 VerifyResult verify_result = VerifyUpdate(trans, **update_it, type);
297 if (verify_result != VERIFY_SUCCESS && verify_result != VERIFY_UNDELETE) 303 if (verify_result != VERIFY_SUCCESS && verify_result != VERIFY_UNDELETE)
298 continue; 304 continue;
299 ProcessUpdate(**update_it, dir->GetCryptographer(trans), trans); 305 ProcessUpdate(**update_it, dir->GetCryptographer(trans), trans);
300 } 306 }
301 } 307 }
302 308
303 void ExpireEntriesByVersion(syncable::Directory* dir, 309 void ExpireEntriesByVersion(syncable::Directory* dir,
304 syncable::ModelNeutralWriteTransaction* trans, 310 syncable::ModelNeutralWriteTransaction* trans,
305 ModelType type, 311 ModelType type,
(...skipping 12 matching lines...) Expand all
318 } 324 }
319 325
320 // Mark entry as deleted by server. 326 // Mark entry as deleted by server.
321 entry.PutServerIsDel(true); 327 entry.PutServerIsDel(true);
322 entry.PutServerVersion(version_watermark); 328 entry.PutServerVersion(version_watermark);
323 entry.PutIsUnappliedUpdate(true); 329 entry.PutIsUnappliedUpdate(true);
324 } 330 }
325 } 331 }
326 332
327 } // namespace syncer 333 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698