Crashpad
 
Loading...
Searching...
No Matches
crashpad::PruneIntermediateDumpsAndCrashReportsThread Class Reference

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"

Inheritance diagram for crashpad::PruneIntermediateDumpsAndCrashReportsThread:
[legend]
Collaboration diagram for crashpad::PruneIntermediateDumpsAndCrashReportsThread:
[legend]

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
 
PruneIntermediateDumpsAndCrashReportsThreadoperator= (const PruneIntermediateDumpsAndCrashReportsThread &)=delete
 
void Start () override
 Starts a dedicated pruning thread.
 
void Stop () override
 Stops the pruning thread.
 
bool is_running () const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PruneIntermediateDumpsAndCrashReportsThread()

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.

Parameters
[in]databaseThe database to prune crash reports from.
[in]conditionThe condition used to evaluate crash reports for pruning.
[in]pending_pathThe path to any locked intermediate dump files.
[in]bundle_identifier_and_seperatorThe 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_extensionWhether 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.

Member Function Documentation

◆ is_running()

bool crashpad::PruneIntermediateDumpsAndCrashReportsThread::is_running ( ) const
inline
Returns
true if the thread is running, false if it is not.

◆ Start()

void crashpad::PruneIntermediateDumpsAndCrashReportsThread::Start ( )
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.

◆ Stop()

void crashpad::PruneIntermediateDumpsAndCrashReportsThread::Stop ( )
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.


The documentation for this class was generated from the following files: