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

Side by Side Diff: base/trace_event/trace_event_argument.cc

Issue 2857543002: tracing: Simplify TraceEventMemoryOverhead, use an enum insted of a map (Closed)
Patch Set: Fix compiler issues + omit empty values Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/trace_buffer.cc ('k') | base/trace_event/trace_event_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/trace_event/trace_event_argument.h" 5 #include "base/trace_event/trace_event_argument.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 // TODO(primiano): this could be smarter, skip the ToBaseValue encoding and 458 // TODO(primiano): this could be smarter, skip the ToBaseValue encoding and
459 // produce the JSON on its own. This will require refactoring JSONWriter 459 // produce the JSON on its own. This will require refactoring JSONWriter
460 // to decouple the base::Value traversal from the JSON writing bits 460 // to decouple the base::Value traversal from the JSON writing bits
461 std::string tmp; 461 std::string tmp;
462 JSONWriter::Write(*ToBaseValue(), &tmp); 462 JSONWriter::Write(*ToBaseValue(), &tmp);
463 *out += tmp; 463 *out += tmp;
464 } 464 }
465 465
466 void TracedValue::EstimateTraceMemoryOverhead( 466 void TracedValue::EstimateTraceMemoryOverhead(
467 TraceEventMemoryOverhead* overhead) { 467 TraceEventMemoryOverhead* overhead) {
468 overhead->Add("TracedValue", 468 overhead->Add(TraceEventMemoryOverhead::kTracedValue,
469 /* allocated size */ 469 /* allocated size */
470 pickle_.GetTotalAllocatedSize(), 470 pickle_.GetTotalAllocatedSize(),
471 /* resident size */ 471 /* resident size */
472 pickle_.size()); 472 pickle_.size());
473 } 473 }
474 474
475 } // namespace trace_event 475 } // namespace trace_event
476 } // namespace base 476 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/trace_buffer.cc ('k') | base/trace_event/trace_event_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698