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 #ifndef COMPONENTS_METRICS_EXPORT_CRASH_SAMPLE_H_ |
| 6 #define COMPONENTS_METRICS_EXPORT_CRASH_SAMPLE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/base_export.h" |
| 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "components/metrics/export/metric_sample.h" |
| 14 |
| 15 namespace metrics { |
| 16 |
| 17 // Represent a crash event described by a simple name. |
| 18 class BASE_EXPORT CrashSample : public MetricSample { |
| 19 public: |
| 20 explicit CrashSample(const std::string& crashname); |
| 21 virtual ~CrashSample(); |
| 22 |
| 23 // Produce a serialized version of the crash. |
| 24 // Format: crash\0|name_|\0 |
| 25 virtual std::string ToString() const OVERRIDE; |
| 26 |
| 27 // Return a CrashSample object representing the serialized crash if possible. |
| 28 // If the deserialization fails, returns NULL. |
| 29 static scoped_ptr<CrashSample> ReadCrash(const std::string& crash_serialized); |
| 30 |
| 31 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(CrashSample); |
| 33 }; |
| 34 |
| 35 } // namespace metrics |
| 36 |
| 37 #endif // COMPONENTS_METRICS_EXPORT_CRASH_SAMPLE_H_ |
OLD | NEW |