| 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_CRASH_COLLECTOR_H_ | 5 #ifndef _CRASH_REPORTER_CRASH_COLLECTOR_H_ |
| 6 #define _CRASH_REPORTER_CRASH_COLLECTOR_H_ | 6 #define _CRASH_REPORTER_CRASH_COLLECTOR_H_ |
| 7 | 7 |
| 8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 FRIEND_TEST(CrashCollectorTest, GetCrashPath); | 41 FRIEND_TEST(CrashCollectorTest, GetCrashPath); |
| 42 FRIEND_TEST(CrashCollectorTest, GetLogContents); | 42 FRIEND_TEST(CrashCollectorTest, GetLogContents); |
| 43 FRIEND_TEST(CrashCollectorTest, ForkExecAndPipe); | 43 FRIEND_TEST(CrashCollectorTest, ForkExecAndPipe); |
| 44 FRIEND_TEST(CrashCollectorTest, FormatDumpBasename); | 44 FRIEND_TEST(CrashCollectorTest, FormatDumpBasename); |
| 45 FRIEND_TEST(CrashCollectorTest, Initialize); | 45 FRIEND_TEST(CrashCollectorTest, Initialize); |
| 46 FRIEND_TEST(CrashCollectorTest, IsCommentLine); | 46 FRIEND_TEST(CrashCollectorTest, IsCommentLine); |
| 47 FRIEND_TEST(CrashCollectorTest, MetaData); | 47 FRIEND_TEST(CrashCollectorTest, MetaData); |
| 48 FRIEND_TEST(CrashCollectorTest, ReadKeyValueFile); | 48 FRIEND_TEST(CrashCollectorTest, ReadKeyValueFile); |
| 49 FRIEND_TEST(CrashCollectorTest, Sanitize); | 49 FRIEND_TEST(CrashCollectorTest, Sanitize); |
| 50 FRIEND_TEST(CrashCollectorTest, WriteNewFile); | 50 FRIEND_TEST(CrashCollectorTest, WriteNewFile); |
| 51 FRIEND_TEST(ForkExecAndPipeTest, Basic); |
| 52 FRIEND_TEST(ForkExecAndPipeTest, NonZeroReturnValue); |
| 53 FRIEND_TEST(ForkExecAndPipeTest, BadOutputFile); |
| 54 FRIEND_TEST(ForkExecAndPipeTest, ExistingOutputFile); |
| 55 FRIEND_TEST(ForkExecAndPipeTest, BadExecutable); |
| 56 FRIEND_TEST(ForkExecAndPipeTest, StderrCaptured); |
| 57 FRIEND_TEST(ForkExecAndPipeTest, NULLParam); |
| 58 FRIEND_TEST(ForkExecAndPipeTest, NoParams); |
| 59 FRIEND_TEST(ForkExecAndPipeTest, SegFaultHandling); |
| 51 | 60 |
| 52 // Set maximum enqueued crashes in a crash directory. | 61 // Set maximum enqueued crashes in a crash directory. |
| 53 static const int kMaxCrashDirectorySize; | 62 static const int kMaxCrashDirectorySize; |
| 54 | 63 |
| 55 // Writes |data| of |size| to |filename|, which must be a new file. | 64 // Writes |data| of |size| to |filename|, which must be a new file. |
| 56 // If the file already exists or writing fails, return a negative value. | 65 // If the file already exists or writing fails, return a negative value. |
| 57 // Otherwise returns the number of bytes written. | 66 // Otherwise returns the number of bytes written. |
| 58 int WriteNewFile(const FilePath &filename, const char *data, int size); | 67 int WriteNewFile(const FilePath &filename, const char *data, int size); |
| 59 | 68 |
| 60 int ForkExecAndPipe(std::vector<const char *> &arguments, | 69 int ForkExecAndPipe(std::vector<const char *> &arguments, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 140 |
| 132 CountCrashFunction count_crash_function_; | 141 CountCrashFunction count_crash_function_; |
| 133 IsFeedbackAllowedFunction is_feedback_allowed_function_; | 142 IsFeedbackAllowedFunction is_feedback_allowed_function_; |
| 134 SystemLogging *logger_; | 143 SystemLogging *logger_; |
| 135 std::string extra_metadata_; | 144 std::string extra_metadata_; |
| 136 const char *forced_crash_directory_; | 145 const char *forced_crash_directory_; |
| 137 const char *lsb_release_; | 146 const char *lsb_release_; |
| 138 }; | 147 }; |
| 139 | 148 |
| 140 #endif // _CRASH_REPORTER_CRASH_COLLECTOR_H_ | 149 #endif // _CRASH_REPORTER_CRASH_COLLECTOR_H_ |
| OLD | NEW |