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

Unified Diff: components/sync/base/proto_value_ptr.h

Issue 2452713003: [Sync] Implement MemoryDumpProvider. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/base/proto_value_ptr.h
diff --git a/components/sync/base/proto_value_ptr.h b/components/sync/base/proto_value_ptr.h
index 35c86b346aa199fd1e8eeb4695c56700f90fa05d..c804216af7a4c77dc3a3460e4d4599d27766ec22 100644
--- a/components/sync/base/proto_value_ptr.h
+++ b/components/sync/base/proto_value_ptr.h
@@ -125,6 +125,13 @@ class ProtoValuePtr {
scoped_refptr<Wrapper> wrapper_;
};
+template <typename T, typename Traits>
+size_t EstimateMemoryUsage(const ProtoValuePtr<T, Traits>& ptr) {
+ return &ptr.value() != &Traits::DefaultValue() ?
+ EstimateMemoryUsage(ptr.value()) :
+ 0;
+}
+
} // namespace syncer
#endif // COMPONENTS_SYNC_BASE_PROTO_VALUE_PTR_H_

Powered by Google App Engine
This is Rietveld 408576698