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

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

Issue 2452713003: [Sync] Implement MemoryDumpProvider. (Closed)
Patch Set: Fix presumit; fix Windows; git cl format Created 4 years, 1 month 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
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/base/unique_position.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..89189b9412d383c88fe31f68d65338c7e4b32710 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_
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/base/unique_position.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698