OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 _CRASH_REPORTER_UNCLEAN_SHUTDOWN_COLLECTOR_H_ | 5 #ifndef _CRASH_REPORTER_UNCLEAN_SHUTDOWN_COLLECTOR_H_ |
6 #define _CRASH_REPORTER_UNCLEAN_SHUTDOWN_COLLECTOR_H_ | 6 #define _CRASH_REPORTER_UNCLEAN_SHUTDOWN_COLLECTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/time.h" | |
11 #include "crash-reporter/crash_collector.h" | 12 #include "crash-reporter/crash_collector.h" |
12 #include "gtest/gtest_prod.h" // for FRIEND_TEST | 13 #include "gtest/gtest_prod.h" // for FRIEND_TEST |
13 | 14 |
14 // Unclean shutdown collector. | 15 // Unclean shutdown collector. |
15 class UncleanShutdownCollector : public CrashCollector { | 16 class UncleanShutdownCollector : public CrashCollector { |
16 public: | 17 public: |
17 UncleanShutdownCollector(); | 18 UncleanShutdownCollector(); |
18 virtual ~UncleanShutdownCollector(); | 19 virtual ~UncleanShutdownCollector(); |
19 | 20 |
20 // Enable collection - signal that a boot has started. | 21 // Enable collection - signal that a boot has started. |
21 bool Enable(); | 22 bool Enable(); |
22 | 23 |
23 // Collect if there is was an unclean shutdown. Returns true if | 24 // Collect if there is was an unclean shutdown. Returns true if |
24 // there was, false otherwise. | 25 // there was, false otherwise. |
25 bool Collect(); | 26 bool Collect(); |
26 | 27 |
27 // Disable collection - signal that the system has been shutdown cleanly. | 28 // Disable collection - signal that the system has been shutdown cleanly. |
28 bool Disable(); | 29 bool Disable(); |
29 | 30 |
30 private: | 31 private: |
31 friend class UncleanShutdownCollectorTest; | 32 friend class UncleanShutdownCollectorTest; |
32 FRIEND_TEST(UncleanShutdownCollectorTest, EnableCannotWrite); | 33 FRIEND_TEST(UncleanShutdownCollectorTest, EnableCannotWrite); |
33 | 34 |
34 bool DeleteUncleanShutdownFile(); | 35 bool DeleteUncleanShutdownFile(); |
35 | 36 |
37 // Check and log modification time on file. | |
38 bool ReadModificationTime(const FilePath &file_path, base::Time *mod_time); | |
tfarina
2010/11/19 15:35:43
the & should be with the type.
kmixter1
2010/11/19 20:02:02
Please don't fix. This project does not yet follo
| |
39 | |
40 // Analyze the powerd tracing files. | |
41 bool CheckPowerdFiles(); | |
42 | |
36 const char *unclean_shutdown_file_; | 43 const char *unclean_shutdown_file_; |
tfarina
2010/11/19 15:35:43
Since you are here, please fix this too.
| |
37 }; | 44 }; |
38 | 45 |
39 #endif // _CRASH_REPORTER_UNCLEAN_SHUTDOWN_COLLECTOR_H_ | 46 #endif // _CRASH_REPORTER_UNCLEAN_SHUTDOWN_COLLECTOR_H_ |
OLD | NEW |