OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMECAST_CRASH_LINUX_DUMP_INFO_H_ | 5 #ifndef CHROMECAST_CRASH_LINUX_DUMP_INFO_H_ |
6 #define CHROMECAST_CRASH_LINUX_DUMP_INFO_H_ | 6 #define CHROMECAST_CRASH_LINUX_DUMP_INFO_H_ |
7 | 7 |
8 #include <ctime> | 8 #include <ctime> |
| 9 #include <memory> |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "chromecast/crash/linux/minidump_params.h" | 13 #include "chromecast/crash/linux/minidump_params.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class Value; | 16 class Value; |
17 } | 17 } |
18 | 18 |
19 namespace chromecast { | 19 namespace chromecast { |
20 | 20 |
21 // Class that encapsulates the construction and parsing of dump entries | 21 // Class that encapsulates the construction and parsing of dump entries |
22 // in the log file. | 22 // in the log file. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // "uptime": <uptime>, | 54 // "uptime": <uptime>, |
55 // "logfile": <logfile>, | 55 // "logfile": <logfile>, |
56 // "suffix": <suffix>, | 56 // "suffix": <suffix>, |
57 // "prev_app_name": <prev_app_name>, | 57 // "prev_app_name": <prev_app_name>, |
58 // "cur_app_name": <current_app_name>, | 58 // "cur_app_name": <current_app_name>, |
59 // "last_app_name": <last_app_name>, | 59 // "last_app_name": <last_app_name>, |
60 // "release_version": <release_version>, | 60 // "release_version": <release_version>, |
61 // "build_number": <build_number> | 61 // "build_number": <build_number> |
62 // "reason": <reason> | 62 // "reason": <reason> |
63 // } | 63 // } |
64 scoped_ptr<base::Value> GetAsValue() const; | 64 std::unique_ptr<base::Value> GetAsValue() const; |
65 const MinidumpParams& params() const { return params_; } | 65 const MinidumpParams& params() const { return params_; } |
66 bool valid() const { return valid_; } | 66 bool valid() const { return valid_; } |
67 | 67 |
68 private: | 68 private: |
69 // Checks if parsed JSON in |value| is valid, if so populates the object's | 69 // Checks if parsed JSON in |value| is valid, if so populates the object's |
70 // fields from |value|. | 70 // fields from |value|. |
71 bool ParseEntry(const base::Value* value); | 71 bool ParseEntry(const base::Value* value); |
72 bool SetDumpTimeFromString(const std::string& timestr); | 72 bool SetDumpTimeFromString(const std::string& timestr); |
73 | 73 |
74 std::string crashed_process_dump_; | 74 std::string crashed_process_dump_; |
75 std::string logfile_; | 75 std::string logfile_; |
76 time_t dump_time_; | 76 time_t dump_time_; |
77 MinidumpParams params_; | 77 MinidumpParams params_; |
78 bool valid_; | 78 bool valid_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(DumpInfo); | 80 DISALLOW_COPY_AND_ASSIGN(DumpInfo); |
81 }; | 81 }; |
82 | 82 |
83 } // namespace chromecast | 83 } // namespace chromecast |
84 | 84 |
85 #endif // CHROMECAST_CRASH_LINUX_DUMP_INFO_H_ | 85 #endif // CHROMECAST_CRASH_LINUX_DUMP_INFO_H_ |
OLD | NEW |