Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1293)

Unified Diff: crash_collector.h

Issue 5814001: crash-reporter: Capture and send recent update_engine logs when it crashes (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git@master
Patch Set: Respond to petkov review Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | crash_collector.cc » ('j') | user_collector.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crash_collector.h
diff --git a/crash_collector.h b/crash_collector.h
index 219c8af6ec85d2d03937dd0779db081faaa3cac8..772de24b7d016d08efa3e53bd3bb41dcd1601089 100644
--- a/crash_collector.h
+++ b/crash_collector.h
@@ -39,9 +39,11 @@ class CrashCollector {
FRIEND_TEST(CrashCollectorTest, CheckHasCapacityUsual);
FRIEND_TEST(CrashCollectorTest, GetCrashDirectoryInfo);
FRIEND_TEST(CrashCollectorTest, GetCrashPath);
+ FRIEND_TEST(CrashCollectorTest, GetLogContents);
FRIEND_TEST(CrashCollectorTest, ForkExecAndPipe);
FRIEND_TEST(CrashCollectorTest, FormatDumpBasename);
FRIEND_TEST(CrashCollectorTest, Initialize);
+ FRIEND_TEST(CrashCollectorTest, IsCommentLine);
FRIEND_TEST(CrashCollectorTest, MetaData);
FRIEND_TEST(CrashCollectorTest, ReadKeyValueFile);
FRIEND_TEST(CrashCollectorTest, Sanitize);
@@ -102,12 +104,21 @@ class CrashCollector {
// crash.
bool CheckHasCapacity(const FilePath &crash_directory);
+ // Checks if the line starts with '#' after optional whitespace.
+ static bool IsCommentLine(const std::string &line);
+
// Read the given file of form [<key><separator><value>\n...] and return
// a map of its contents.
bool ReadKeyValueFile(const FilePath &file,
char separator,
std::map<std::string, std::string> *dictionary);
+ // Write a log applicable to |exec_name| to |output_file| based on the
+ // log configuration file at |config_path|.
+ bool GetLogContents(const FilePath &config_path,
+ const std::string &exec_name,
+ const FilePath &output_file);
+
// Add non-standard meta data to the crash metadata file. Call
// before calling WriteCrashMetaData. Key must not contain "=" or
// "\n" characters. Value must not contain "\n" characters.
« no previous file with comments | « no previous file | crash_collector.cc » ('j') | user_collector.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698