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

Unified Diff: crash_collector.h

Issue 3209003: Limit the number of crash reports to enqueue at once (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git
Patch Set: Respond to reviews Created 10 years, 4 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 | « no previous file | crash_collector.cc » ('j') | no next file with comments »
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 ef0d2a7b106f057d0e55fe531217906538764eb0..a75d791489fdcff4eb4db7f9769c7f5b93e49866 100644
--- a/crash_collector.h
+++ b/crash_collector.h
@@ -32,10 +32,15 @@ class CrashCollector {
protected:
friend class CrashCollectorTest;
+ FRIEND_TEST(CrashCollectorTest, CheckHasCapacityOverCore);
+ FRIEND_TEST(CrashCollectorTest, CheckHasCapacityOverNonCore);
FRIEND_TEST(CrashCollectorTest, GetCrashDirectoryInfo);
FRIEND_TEST(CrashCollectorTest, FormatDumpBasename);
FRIEND_TEST(CrashCollectorTest, Initialize);
+ // Set maximum enqueued crashes in a crash directory.
+ static const int kMaxCrashDirectorySize;
+
// For testing, set the directory always returned by
// GetCreatedCrashDirectoryByEuid.
void ForceCrashDirectory(const char *forced_directory) {
@@ -54,13 +59,19 @@ class CrashCollector {
// Determines the crash directory for given eud, and creates the
// directory if necessary with appropriate permissions. Returns
// true whether or not directory needed to be created, false on any
- // failure.
+ // failure. If the crash directory is already full, returns false.
bool GetCreatedCrashDirectoryByEuid(uid_t euid,
FilePath *crash_file_path);
+
+ // Format crash name based on components.
std::string FormatDumpBasename(const std::string &exec_name,
time_t timestamp,
pid_t pid);
+ // Check given crash directory still has remaining capacity for another
+ // crash.
+ bool CheckHasCapacity(const FilePath &crash_directory);
+
CountCrashFunction count_crash_function_;
IsFeedbackAllowedFunction is_feedback_allowed_function_;
SystemLogging *logger_;
« no previous file with comments | « no previous file | crash_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698