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/memory_dump_request_args.h"
7 #include "base/logging.h"
10 namespace trace_event
{
13 const char* MemoryDumpTypeToString(const MemoryDumpType
& dump_type
) {
15 case MemoryDumpType::TASK_BEGIN
:
17 case MemoryDumpType::TASK_END
:
19 case MemoryDumpType::PERIODIC_INTERVAL
:
20 return "periodic_interval";
21 case MemoryDumpType::EXPLICITLY_TRIGGERED
:
22 return "explicitly_triggered";
28 const char* MemoryDumpLevelOfDetailToString(
29 const MemoryDumpLevelOfDetail
& level_of_detail
) {
30 switch (level_of_detail
) {
31 case MemoryDumpLevelOfDetail::LIGHT
:
33 case MemoryDumpLevelOfDetail::DETAILED
:
40 MemoryDumpLevelOfDetail
StringToMemoryDumpLevelOfDetail(
41 const std::string
& str
) {
43 return MemoryDumpLevelOfDetail::LIGHT
;
44 if (str
== "detailed")
45 return MemoryDumpLevelOfDetail::DETAILED
;
47 return MemoryDumpLevelOfDetail::LAST
;
50 } // namespace trace_event