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

Unified Diff: content/common/cc_messages.cc

Issue 34413002: Pickle::Write* micro-optimizations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: content/common/cc_messages.cc
diff --git a/content/common/cc_messages.cc b/content/common/cc_messages.cc
index dc389a65f629789cba010d8cb3c4265568493684..f0757382cce752de437962135e0639a815c59d1f 100644
--- a/content/common/cc_messages.cc
+++ b/content/common/cc_messages.cc
@@ -355,6 +355,8 @@ void ParamTraits<cc::RenderPass>::Write(
WriteParam(m, p.shared_quad_state_list.size());
WriteParam(m, p.quad_list.size());
+ m->Reserve(p.shared_quad_state_list.size() * sizeof(cc::SharedQuadState) + p.quad_list.size() * sizeof(cc::RenderPassDrawQuad));
danakj 2013/10/22 17:22:05 We could walk the quad list and determine the size
+
for (size_t i = 0; i < p.shared_quad_state_list.size(); ++i)
WriteParam(m, *p.shared_quad_state_list[i]);

Powered by Google App Engine
This is Rietveld 408576698