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

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

Issue 2382443006: Sync MDP: implement MemoryDumpProvider
Patch Set: Created 4 years, 3 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/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 0f97323ea9927bebe93153a452cc8392ae89d0e6..a10f19f21aa3cc1921ffe45f9c59a83dfe0a8cc3 100644
--- a/components/sync/base/proto_value_ptr.h
+++ b/components/sync/base/proto_value_ptr.h
@@ -89,6 +89,10 @@ class ProtoValuePtr {
return &wrapped_instance;
}
+ explicit operator bool () const { return wrapper_ != nullptr; }
+ bool operator == (decltype(nullptr)) const { return wrapper_ == nullptr; }
+ bool operator != (decltype(nullptr)) const { return wrapper_ != nullptr; }
+
private:
friend struct syncable::EntryKernel;
friend struct syncer_v2::EntityData;
@@ -127,6 +131,11 @@ class ProtoValuePtr {
scoped_refptr<Wrapper> wrapper_;
};
+template <typename T, typename Traits>
+size_t EstimateMemoryUsage(const ProtoValuePtr<T, Traits>& ptr) {
+ return ptr? 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