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

Unified Diff: base/pickle.h

Issue 35893002: IPC pickling optimization for render passes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ccmessagesperf-reserve: nits Created 7 years, 2 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 | 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 cb9bab98965f141b5ea9bffe264ed5cc76ba77e2..3bd3b7e64eb73dac502679b14a8c69ced0aadf73 100644
--- a/base/pickle.h
+++ b/base/pickle.h
@@ -273,6 +273,11 @@ class BASE_EXPORT Pickle {
// not been changed.
void TrimWriteData(int length);
+ // Reserves space for upcoming writes when multiple writes will be made and
+ // their sizes are computed in advance. It can be significantly faster to call
+ // Reserve() before calling WriteFoo() multiple times.
+ void Reserve(size_t additional_capacity);
+
// Payload follows after allocation of Header (header size is customizable).
struct Header {
uint32 payload_size; // Specifies the size of the payload.
« no previous file with comments | « no previous file | base/pickle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698