OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef CHROMECAST_CRASH_LINUX_DUMP_INFO_H_ | |
6 #define CHROMECAST_CRASH_LINUX_DUMP_INFO_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "chromecast/crash/linux/minidump_params.h" | |
12 | |
13 namespace chromecast { | |
14 | |
15 // Class that encapsulates the construction and parsing of dump entries | |
16 // in the log file. | |
17 class DumpInfo { | |
18 public: | |
19 // Attempt to construct a DumpInfo object by parsing the given entry string | |
20 // and extracting the contained information and populate the relevant | |
21 // fields. | |
22 explicit DumpInfo(const std::string& entry); | |
23 | |
24 // Attempt to construct a DumpInfo object that has the following info: | |
25 // | |
26 // -crashed_process_dump: the full path of the dump written | |
27 // -crashed_process_logfile: the full path of the logfile written | |
28 // -dump_time: the time of the dump written | |
29 // -params: a structure containing other useful crash information | |
30 // | |
31 // As a result of construction, the |entry_| will be filled with the | |
32 // appropriate string to add to the log file. | |
33 DumpInfo(const std::string& crashed_process_dump, | |
34 const std::string& crashed_process_logfile, | |
35 const time_t& dump_time, | |
36 const MinidumpParams& params); | |
37 | |
38 ~DumpInfo(); | |
39 | |
40 std::string crashed_process_dump() const { return crashed_process_dump_; } | |
alokp
2015/06/15 17:51:48
return const reference. here and elsewhere in this
slan
2015/06/16 14:57:49
Done.
| |
41 std::string logfile() const { return logfile_; } | |
42 time_t dump_time() const { return dump_time_; } | |
43 std::string entry() const { return entry_; } | |
44 MinidumpParams params() const { return params_; } | |
45 bool valid() const { return valid_; } | |
46 | |
47 private: | |
48 bool ParseEntry(const std::string& entry); | |
49 bool SetDumpTimeFromString(const std::string& timestr); | |
50 std::string GetEntryAsString(); | |
51 | |
52 std::string crashed_process_dump_; | |
53 std::string logfile_; | |
54 time_t dump_time_; | |
55 std::string entry_; | |
56 MinidumpParams params_; | |
57 bool valid_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(DumpInfo); | |
60 }; | |
61 | |
62 } // namespace chromecast | |
63 | |
64 #endif // CHROMECAST_CRASH_LINUX_DUMP_INFO_H_ | |
OLD | NEW |