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

Unified Diff: components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc

Issue 2374913002: [USS] Show USS counters in about:sync page (Closed)
Patch Set: For IOS Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc
diff --git a/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc b/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc
index d7b9b1a3064c609aed44e7181497de268c06dd3b..7b0cb5dc008fdaa6645af24e688aecb369771143 100644
--- a/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc
+++ b/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc
@@ -8,6 +8,7 @@
#include <vector>
+#include "base/memory/ptr_util.h"
#include "components/sync/engine/cycle/status_counters.h"
#include "components/sync/engine/cycle/type_debug_info_observer.h"
#include "components/sync/syncable/entry.h"
@@ -72,19 +73,19 @@ void DirectoryTypeDebugInfoEmitter::EmitStatusCountersUpdate() {
std::vector<int64_t> result;
directory_->GetMetaHandlesOfType(&trans, type_, &result);
- StatusCounters counters;
- counters.num_entries_and_tombstones = result.size();
+ std::unique_ptr<StatusCounters> counters = base::MakeUnique<StatusCounters>();
+ counters->num_entries_and_tombstones = result.size();
for (std::vector<int64_t>::const_iterator it = result.begin();
it != result.end(); ++it) {
syncable::Entry e(&trans, syncable::GET_BY_HANDLE, *it);
if (!e.GetIsDel()) {
- counters.num_entries++;
+ counters->num_entries++;
}
}
FOR_EACH_OBSERVER(TypeDebugInfoObserver, (*type_debug_info_observers_),
- OnStatusCountersUpdated(type_, counters));
+ OnStatusCountersUpdated(type_, std::move(counters)));
pavely 2016/09/30 00:01:51 Same argument as in ProfileSyncService. Who will g
Gang Wu 2016/10/01 07:14:09 Done.
}
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698