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

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

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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()
15 : resident_set_bytes_(0),
16 peak_resident_set_bytes_(0),
17 is_peak_rss_resetable_(false) {
18 }
19
14 void ProcessMemoryTotals::AsValueInto(TracedValue* value) const { 20 void ProcessMemoryTotals::AsValueInto(TracedValue* value) const {
15 value->SetString("resident_set_bytes", 21 value->SetString("resident_set_bytes",
16 StringPrintf("%" PRIx64, resident_set_bytes_)); 22 StringPrintf("%" PRIx64, resident_set_bytes_));
23 if (peak_resident_set_bytes_ > 0) {
24 value->SetString("peak_resident_set_bytes",
25 StringPrintf("%" PRIx64, peak_resident_set_bytes_));
26 value->SetBoolean("is_peak_rss_resetable", is_peak_rss_resetable_);
27 }
28 }
29
30 void ProcessMemoryTotals::Clear() {
31 resident_set_bytes_ = 0;
17 } 32 }
18 33
19 } // namespace trace_event 34 } // namespace trace_event
20 } // namespace base 35 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/process_memory_totals.h ('k') | base/trace_event/process_memory_totals_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698