OLD | NEW |
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 Loading... |
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 |
OLD | NEW |