OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 "components/metrics/export/crash_sample.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/strings/stringprintf.h" |
| 10 #include "components/metrics/export/metric_sample.h" |
| 11 |
| 12 using base::StringPrintf; |
| 13 using std::string; |
| 14 |
| 15 namespace metrics { |
| 16 |
| 17 CrashSample::CrashSample(const std::string& crashname) |
| 18 : MetricSample(MetricSample::CRASH, crashname) {} |
| 19 |
| 20 CrashSample::~CrashSample() {} |
| 21 |
| 22 string CrashSample::ToString() const { |
| 23 return StringPrintf("crash%c%s%c", '\0', name().c_str(), '\0'); |
| 24 } |
| 25 |
| 26 // static |
| 27 CrashSample* CrashSample::ReadCrash(const std::string& crashname) { |
| 28 return new CrashSample(crashname); |
| 29 } |
| 30 |
| 31 } // namespace metrics |
OLD | NEW |