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

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

Issue 2781863004: [Sync] Implement EstimateMemoryUsage for SharedModelTypeProcessor and ModelTypeWorker (Closed)
Patch Set: Address comments Created 3 years, 9 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
« no previous file with comments | « no previous file | components/sync/engine/non_blocking_sync_common.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 89189b9412d383c88fe31f68d65338c7e4b32710..32a5f520f55f3525eba3bf4228108a1871e62755 100644
--- a/components/sync/base/proto_value_ptr.h
+++ b/components/sync/base/proto_value_ptr.h
@@ -7,6 +7,7 @@
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
+#include "base/trace_event/memory_usage_estimator.h"
namespace syncer {
@@ -127,6 +128,10 @@ class ProtoValuePtr {
template <typename T, typename Traits>
size_t EstimateMemoryUsage(const ProtoValuePtr<T, Traits>& ptr) {
+ // Including estimators from base::trace_event (memory_usage_estimator.h)
+ // allows to resolve EstimateMemoryUsage name in cases when T is not a sync
+ // protobuf and thus sync_pb::EstimateMemoryUsage doesn't get matched.
+ using base::trace_event::EstimateMemoryUsage;
return &ptr.value() != &Traits::DefaultValue()
? EstimateMemoryUsage(ptr.value())
: 0;
« no previous file with comments | « no previous file | components/sync/engine/non_blocking_sync_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698