A thread that periodically prunes crash reports from the database using the specified condition, and any leftover locked intermediate dumps. More...
#include "client/ios_handler/prune_intermediate_dumps_and_crash_reports_thread.h"
Public Member Functions | |
PruneIntermediateDumpsAndCrashReportsThread (CrashReportDatabase *database, std::unique_ptr< PruneCondition > condition, base::FilePath pending_path, std::string bundle_identifier_and_seperator, bool is_extension) | |
Constructs a new object. | |
PruneIntermediateDumpsAndCrashReportsThread (const PruneIntermediateDumpsAndCrashReportsThread &)=delete | |
PruneIntermediateDumpsAndCrashReportsThread & | operator= (const PruneIntermediateDumpsAndCrashReportsThread &)=delete |
void | Start () override |
Starts a dedicated pruning thread. | |
void | Stop () override |
Stops the pruning thread. | |
bool | is_running () const |
A thread that periodically prunes crash reports from the database using the specified condition, and any leftover locked intermediate dumps.
After the thread is started, the database is pruned using the condition every 24 hours. Upon calling Start(), the thread waits before performing the initial prune operation.
Locked intermediate dump files are unlocked only once, not periodically. Locked dumps that match this bundle id can be unlocked if they are over a day old. Otherwise, unlock dumps that are over 60 days old.
crashpad::PruneIntermediateDumpsAndCrashReportsThread::PruneIntermediateDumpsAndCrashReportsThread | ( | CrashReportDatabase * | database, |
std::unique_ptr< PruneCondition > | condition, | ||
base::FilePath | pending_path, | ||
std::string | bundle_identifier_and_seperator, | ||
bool | is_extension ) |
Constructs a new object.
[in] | database | The database to prune crash reports from. |
[in] | condition | The condition used to evaluate crash reports for pruning. |
[in] | pending_path | The path to any locked intermediate dump files. |
[in] | bundle_identifier_and_seperator | The identifier for this client, used to determine when locked files are considered stale, with a seperator at the end to allow for substring searches. |
[in] | is_extension | Whether the process is an app extension. If true , the inital prune will occur after a 5-second delay. If false , the initial prune will occur after a 60-second delay. |
|
inline |
true
if the thread is running, false
if it is not.
|
overridevirtual |
Starts a dedicated pruning thread.
The thread waits before running the initial prune, so as to not interfere with any startup-related IO performed by the client.
This method may only be be called on a newly-constructed object or after a call to Stop().
Implements crashpad::Stoppable.
|
overridevirtual |
Stops the pruning thread.
This method must only be called after Start(). If Start() has been called, this method must be called before destroying an object of this class.
This method may be called from any thread other than the pruning thread. It is expected to only be called from the same thread that called Start().
Implements crashpad::Stoppable.