blob: 5363db559c32151712dc128e74d44f1933bbec00 [file] [log] [blame]
primianof11ccf52015-02-17 23:21:191// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "base/trace_event/process_memory_dump.h"
6
primianoc96eca72015-02-20 16:41:147#include "base/trace_event/process_memory_totals.h"
8#include "base/trace_event/trace_event_argument.h"
primianof11ccf52015-02-17 23:21:199
10namespace base {
11namespace trace_event {
12
primiano5a4899572015-02-24 17:52:3213ProcessMemoryDump::ProcessMemoryDump()
14 : has_process_totals_(false), has_process_mmaps_(false) {
primianof11ccf52015-02-17 23:21:1915}
16
17ProcessMemoryDump::~ProcessMemoryDump() {
18}
19
primianoc96eca72015-02-20 16:41:1420void ProcessMemoryDump::AsValueInto(TracedValue* value) const {
21 // Build up the [dumper name] -> [value] dictionary.
22 if (has_process_totals_) {
23 value->BeginDictionary("process_totals");
24 process_totals_.AsValueInto(value);
25 value->EndDictionary();
26 }
primiano5a4899572015-02-24 17:52:3227 if (has_process_mmaps_) {
28 value->BeginDictionary("process_mmaps");
29 process_mmaps_.AsValueInto(value);
30 value->EndDictionary();
31 }
primianof11ccf52015-02-17 23:21:1932}
33
34} // namespace trace_event
35} // namespace base