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

Side by Side Diff: components/sync_sessions/lost_navigations_recorder.cc

Issue 2388973002: [Sync] Removing duplicate includes, part 2. (Closed)
Patch Set: Update for Max's comments. Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/sync_sessions/lost_navigations_recorder.h"
6
5 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
6 #include "base/stl_util.h" 8 #include "base/stl_util.h"
7 #include "components/sync/syncable/entry.h" 9 #include "components/sync/syncable/entry.h"
8 #include "components/sync_sessions/lost_navigations_recorder.h"
9 10
10 namespace sync_sessions { 11 namespace sync_sessions {
11 12
12 LostNavigationsRecorder::LostNavigationsRecorder() 13 LostNavigationsRecorder::LostNavigationsRecorder()
13 : recorder_state_(RECORDER_STATE_NOT_SYNCING) {} 14 : recorder_state_(RECORDER_STATE_NOT_SYNCING) {}
14 15
15 LostNavigationsRecorder::~LostNavigationsRecorder() {} 16 LostNavigationsRecorder::~LostNavigationsRecorder() {}
16 17
17 void LostNavigationsRecorder::OnLocalChange( 18 void LostNavigationsRecorder::OnLocalChange(
18 const syncer::syncable::Entry* current_entry, 19 const syncer::syncable::Entry* current_entry,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 127
127 // The set of lost navigations is anything we recorded as new that's not 128 // The set of lost navigations is anything we recorded as new that's not
128 // present in latest. 129 // present in latest.
129 IdSet lost_navs = base::STLSetDifference<IdSet>(recorded, latest); 130 IdSet lost_navs = base::STLSetDifference<IdSet>(recorded, latest);
130 int quantity_lost = lost_navs.size(); 131 int quantity_lost = lost_navs.size();
131 UMA_HISTOGRAM_COUNTS("Sync.LostNavigationCount", quantity_lost); 132 UMA_HISTOGRAM_COUNTS("Sync.LostNavigationCount", quantity_lost);
132 recorded.clear(); 133 recorded.clear();
133 } 134 }
134 } 135 }
135 } // namespace sync_sessions 136 } // namespace sync_sessions
OLDNEW
« no previous file with comments | « components/sync_sessions/favicon_cache_unittest.cc ('k') | components/sync_sessions/lost_navigations_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698