Chromium Code Reviews| Index: chromecast/crash/linux/synchronized_minidump_manager.h |
| diff --git a/chromecast/crash/linux/synchronized_minidump_manager.h b/chromecast/crash/linux/synchronized_minidump_manager.h |
| index f4041812d80e694531d688ce0ea6b739d2d12c34..87779d83b40cdb44beaf0dafb3ab1d02fc01a266 100644 |
| --- a/chromecast/crash/linux/synchronized_minidump_manager.h |
| +++ b/chromecast/crash/linux/synchronized_minidump_manager.h |
| @@ -46,9 +46,6 @@ namespace chromecast { |
| // |
| class SynchronizedMinidumpManager { |
| public: |
| - // Max number of dumps allowed in lockfile. |
| - static const int kMaxLockfileDumps; |
| - |
| // Length of a ratelimit period in seconds. |
| static const int kRatelimitPeriodSeconds; |
| @@ -100,6 +97,15 @@ class SynchronizedMinidumpManager { |
| // clean lingering dump files. |
| int GetNumDumps(bool delete_all_dumps); |
| + // Increment the number of dumps in the current ratelimit period. |
| + // Returns 0 on success, < 0 on error. |
| + int IncrementRatelimitPeriodDumps(); |
|
slan
2015/09/09 19:08:11
This name is confusing to me. Perhaps IncrementNum
bcf_google
2015/09/09 21:20:29
Done.
|
| + |
| + // Returns true when dumps uploaded in current rate limit period is less than |
| + // |kRatelimitPeriodMaxDumps|. Resets rate limit period if period time has |
| + // elapsed. |
| + bool CanUploadDump(); |
| + |
| // If true, the flock on the lockfile will be nonblocking. |
| bool non_blocking_; |
| @@ -127,13 +133,6 @@ class SynchronizedMinidumpManager { |
| // Release the lock file with the associated *fd*. |
| void ReleaseLockFile(); |
| - // Returns true if |num_dumps| can be written to the lockfile. We can write |
| - // the dumps if the number of dumps in the lockfile after |num_dumps| is added |
| - // is less than or equal to |kMaxLockfileDumps| and the number of dumps in the |
| - // current ratelimit period after |num_dumps| is added is less than or equal |
| - // to |kRatelimitPeriodMaxDumps|. |
| - bool CanWriteDumps(int num_dumps); |
| - |
| const std::string lockfile_path_; |
| const std::string metadata_path_; |
| int lockfile_fd_; |