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

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

Issue 2838803003: Add a field platform_private_footprint_ to ProcessMemoryTotals. (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/process_memory_totals.h" 5 #include "base/trace_event/process_memory_totals.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/trace_event/trace_event_argument.h" 9 #include "base/trace_event/trace_event_argument.h"
10 10
11 namespace base { 11 namespace base {
12 namespace trace_event { 12 namespace trace_event {
13 13
14 ProcessMemoryTotals::ProcessMemoryTotals() 14 ProcessMemoryTotals::ProcessMemoryTotals()
15 : resident_set_bytes_(0), 15 : resident_set_bytes_(0),
16 peak_resident_set_bytes_(0), 16 peak_resident_set_bytes_(0),
17 is_peak_rss_resetable_(false) { 17 is_peak_rss_resetable_(false),
18 } 18 private_footprint_precursor_(0) {}
19 19
20 ProcessMemoryTotals::~ProcessMemoryTotals() {} 20 ProcessMemoryTotals::~ProcessMemoryTotals() {}
21 21
22 void ProcessMemoryTotals::AsValueInto(TracedValue* value) const { 22 void ProcessMemoryTotals::AsValueInto(TracedValue* value) const {
23 value->SetString("resident_set_bytes", 23 value->SetString("resident_set_bytes",
24 StringPrintf("%" PRIx64, resident_set_bytes_)); 24 StringPrintf("%" PRIx64, resident_set_bytes_));
25 if (peak_resident_set_bytes_ > 0) { 25 if (peak_resident_set_bytes_ > 0) {
26 value->SetString("peak_resident_set_bytes", 26 value->SetString("peak_resident_set_bytes",
27 StringPrintf("%" PRIx64, peak_resident_set_bytes_)); 27 StringPrintf("%" PRIx64, peak_resident_set_bytes_));
28 value->SetBoolean("is_peak_rss_resetable", is_peak_rss_resetable_); 28 value->SetBoolean("is_peak_rss_resetable", is_peak_rss_resetable_);
29 } 29 }
30 30
31 for (const auto it : extra_fields_) { 31 for (const auto it : extra_fields_) {
32 value->SetString(it.first, StringPrintf("%" PRIx64, it.second)); 32 value->SetString(it.first, StringPrintf("%" PRIx64, it.second));
33 } 33 }
34 } 34 }
35 35
36 void ProcessMemoryTotals::Clear() { 36 void ProcessMemoryTotals::Clear() {
37 resident_set_bytes_ = 0; 37 resident_set_bytes_ = 0;
38 private_footprint_precursor_ = 0;
38 } 39 }
39 40
40 void ProcessMemoryTotals::SetExtraFieldInBytes(const char* name, 41 void ProcessMemoryTotals::SetExtraFieldInBytes(const char* name,
41 uint64_t value) { 42 uint64_t value) {
42 DCHECK_EQ(0u, extra_fields_.count(name)); 43 DCHECK_EQ(0u, extra_fields_.count(name));
43 extra_fields_[name] = value; 44 extra_fields_[name] = value;
44 } 45 }
45 46
46 } // namespace trace_event 47 } // namespace trace_event
47 } // namespace base 48 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698