Fix crash on app list start page keyboard navigation with <4 apps.
[chromium-blink-merge.git] / base / trace_event / process_memory_dump.cc
blob0a3e0965f0bc0e24ec8934b4676608c2d8d20090
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
3 // found in the LICENSE file.
5 #include "base/trace_event/process_memory_dump.h"
7 #include "base/json/json_writer.h"
8 #include "base/values.h"
10 namespace base {
11 namespace trace_event {
13 ProcessMemoryDump::ProcessMemoryDump() {
16 ProcessMemoryDump::~ProcessMemoryDump() {
19 void ProcessMemoryDump::AppendAsTraceFormat(std::string* out) const {
20 // Build up the [dumper name] -> [serialized snapshot] JSON dictionary.
21 DictionaryValue dict;
22 std::string json_dict;
23 // TODO(primiano): this will append here the actual dumps from the dumpers.
24 base::JSONWriter::Write(&dict, &json_dict);
25 *out += json_dict;
28 } // namespace trace_event
29 } // namespace base