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

Unified Diff: components/sync/syncable/entry_kernel.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/syncable/directory_backing_store.cc ('k') | components/sync/syncable/entry_kernel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/syncable/entry_kernel.h
diff --git a/components/sync/syncable/entry_kernel.h b/components/sync/syncable/entry_kernel.h
index 77495e144804a9b614c111d11011be05584f96bf..e56fc55788a81c84d4009f6e926d9db3babd3584 100644
--- a/components/sync/syncable/entry_kernel.h
+++ b/components/sync/syncable/entry_kernel.h
@@ -225,6 +225,7 @@ struct EntryKernel {
dirty_index->insert(ref(META_HANDLE));
}
dirty_ = true;
+ memory_usage_ = kMemoryUsageUnknown;
}
// Clear the dirty bit, and optionally remove this entry's metahandle from
@@ -377,9 +378,13 @@ struct EntryKernel {
// they will be serialized as empty proto's.
base::DictionaryValue* ToValue(Cryptographer* cryptographer) const;
+ size_t EstimateMemoryUsage() const;
+
private:
// Tracks whether this entry needs to be saved to the database.
bool dirty_;
+ mutable size_t memory_usage_;
+ constexpr static size_t kMemoryUsageUnknown = size_t(-1);
};
template <typename T>
« no previous file with comments | « components/sync/syncable/directory_backing_store.cc ('k') | components/sync/syncable/entry_kernel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698