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

Unified Diff: components/sync/engine_impl/worker_entity_tracker.cc

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 | « components/sync/engine_impl/worker_entity_tracker.h ('k') | components/sync/model/entity_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/worker_entity_tracker.cc
diff --git a/components/sync/engine_impl/worker_entity_tracker.cc b/components/sync/engine_impl/worker_entity_tracker.cc
index 67f2aa945f044b7822717188aa63a49eca504edd..14629755a6b2de2c35c137dda42f010a479b835d 100644
--- a/components/sync/engine_impl/worker_entity_tracker.cc
+++ b/components/sync/engine_impl/worker_entity_tracker.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "base/trace_event/memory_usage_estimator.h"
#include "components/sync/base/model_type.h"
#include "components/sync/base/time.h"
#include "components/sync/syncable/syncable_util.h"
@@ -177,6 +178,17 @@ void WorkerEntityTracker::ClearEncryptedUpdate() {
encrypted_update_.reset();
}
+size_t WorkerEntityTracker::EstimateMemoryUsage() const {
+ using base::trace_event::EstimateMemoryUsage;
+ size_t memory_usage = 0;
+ memory_usage += EstimateMemoryUsage(client_tag_hash_);
+ memory_usage += EstimateMemoryUsage(id_);
+ memory_usage += EstimateMemoryUsage(pending_commit_);
+ memory_usage += EstimateMemoryUsage(pending_commit_specifics_hash_);
+ memory_usage += EstimateMemoryUsage(encrypted_update_);
+ return memory_usage;
+}
+
bool WorkerEntityTracker::IsInConflict() const {
if (!HasPendingCommit())
return false;
« no previous file with comments | « components/sync/engine_impl/worker_entity_tracker.h ('k') | components/sync/model/entity_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698