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

Unified Diff: base/pickle.h

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 | « base/metrics/statistics_recorder_unittest.cc ('k') | base/pickle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/pickle.h
diff --git a/base/pickle.h b/base/pickle.h
index 7a6b0c86fb4f8ec757a3c362ef573d6f9a6e8bef..c9fef715a7b6e9e8f9b4a357905f2cd9c442a1f7 100644
--- a/base/pickle.h
+++ b/base/pickle.h
@@ -153,12 +153,18 @@ class BASE_EXPORT Pickle {
// Performs a deep copy.
Pickle& operator=(const Pickle& other);
- // Returns the size of the Pickle's data.
+ // Returns the number of bytes written in the Pickle, including the header.
size_t size() const { return header_size_ + header_->payload_size; }
// Returns the data for this Pickle.
const void* data() const { return header_; }
+ // Returns the effective memory capacity of this Pickle, that is, the total
+ // number of bytes currently dynamically allocated or 0 in the case of a
+ // read-only Pickle. This should be used only for diagnostic / profiling
+ // purposes.
+ size_t GetTotalAllocatedSize() const;
+
// Methods for adding to the payload of the Pickle. These values are
// appended to the end of the Pickle's payload. When reading values from a
// Pickle, it is important to read them in the order in which they were added
« no previous file with comments | « base/metrics/statistics_recorder_unittest.cc ('k') | base/pickle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698