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

Unified Diff: crash_collector.cc

Issue 4088003: crash-reporter: write conversion failure diagnostics into fake dmp files (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git
Patch Set: Add signature for error logs Created 10 years, 2 months 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 | « crash_collector.h ('k') | crash_collector_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crash_collector.cc
diff --git a/crash_collector.cc b/crash_collector.cc
index 5ea06e288798f2fb76a9a26eaff3214884ed1dd9..1e2cd1abdd66e016993540fecc3979328badad72 100644
--- a/crash_collector.cc
+++ b/crash_collector.cc
@@ -86,6 +86,14 @@ std::string CrashCollector::FormatDumpBasename(const std::string &exec_name,
pid);
}
+FilePath CrashCollector::GetCrashPath(const FilePath &crash_directory,
+ const std::string &basename,
+ const std::string &extension) {
+ return crash_directory.Append(StringPrintf("%s.%s",
+ basename.c_str(),
+ extension.c_str()));
+}
+
FilePath CrashCollector::GetCrashDirectoryInfo(
uid_t process_euid,
uid_t default_user_id,
@@ -125,10 +133,13 @@ bool CrashCollector::GetUserInfoFromName(const std::string &name,
}
bool CrashCollector::GetCreatedCrashDirectoryByEuid(uid_t euid,
- FilePath *crash_directory) {
+ FilePath *crash_directory,
+ bool *out_of_capacity) {
uid_t default_user_id;
gid_t default_user_group;
+ if (out_of_capacity != NULL) *out_of_capacity = false;
+
// For testing.
if (forced_crash_directory_ != NULL) {
*crash_directory = FilePath(forced_crash_directory_);
@@ -173,6 +184,7 @@ bool CrashCollector::GetCreatedCrashDirectoryByEuid(uid_t euid,
}
if (!CheckHasCapacity(*crash_directory)) {
+ if (out_of_capacity != NULL) *out_of_capacity = true;
return false;
}
@@ -271,11 +283,13 @@ void CrashCollector::WriteCrashMetaData(const FilePath &meta_path,
file_util::GetFileSize(FilePath(payload_path), &payload_size);
std::string meta_data = StringPrintf("%sexec_name=%s\n"
"ver=%s\n"
+ "payload=%s\n"
"payload_size=%lld\n"
"done=1\n",
extra_metadata_.c_str(),
exec_name.c_str(),
version.c_str(),
+ payload_path.c_str(),
payload_size);
if (!file_util::WriteFile(meta_path, meta_data.c_str(), meta_data.size())) {
logger_->LogError("Unable to write %s", meta_path.value().c_str());
« no previous file with comments | « crash_collector.h ('k') | crash_collector_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698