An interface for accessing and modifying the settings of a CrashReportDatabase.
More...
#include "client/settings.h"
|
| Settings (const Settings &)=delete |
|
Settings & | operator= (const Settings &)=delete |
|
bool | Initialize (const base::FilePath &path) |
| Initializes the settings data store.
|
|
bool | GetClientID (UUID *client_id) |
| Retrieves the immutable identifier for this client, which is used on a server to locate all crash reports from a specific Crashpad database.
|
|
bool | GetUploadsEnabled (bool *enabled) |
| Retrieves the user’s preference for submitting crash reports to a collection server.
|
|
bool | SetUploadsEnabled (bool enabled) |
| Sets the user’s preference for submitting crash reports to a collection server.
|
|
bool | GetLastUploadAttemptTime (time_t *time) |
| Retrieves the last time at which a report was attempted to be uploaded.
|
|
bool | SetLastUploadAttemptTime (time_t time) |
| Sets the last time at which a report was attempted to be uploaded.
|
|
|
static bool | IsLockExpired (const base::FilePath &file_path, time_t lockfile_ttl) |
| Returns whether the lockfile for a file is expired.
|
|
|
static constexpr char | kLockfileExtension [] = ".__lock__" |
|
An interface for accessing and modifying the settings of a CrashReportDatabase.
This class must not be instantiated directly, but rather an instance of it should be retrieved via CrashReportDatabase::GetSettings().
◆ GetClientID()
bool crashpad::Settings::GetClientID |
( |
UUID * | client_id | ) |
|
Retrieves the immutable identifier for this client, which is used on a server to locate all crash reports from a specific Crashpad database.
This is automatically initialized when the database is created.
- Parameters
-
[out] | client_id | The unique client identifier. |
- Returns
- On success, returns
true
, otherwise returns false
with an error logged.
◆ GetLastUploadAttemptTime()
bool crashpad::Settings::GetLastUploadAttemptTime |
( |
time_t * | time | ) |
|
Retrieves the last time at which a report was attempted to be uploaded.
The default value is 0
if it has never been set before.
- Parameters
-
[out] | time | The last time at which a report was uploaded. |
- Returns
- On success, returns
true
, otherwise returns false
with an error logged.
◆ GetUploadsEnabled()
bool crashpad::Settings::GetUploadsEnabled |
( |
bool * | enabled | ) |
|
Retrieves the user’s preference for submitting crash reports to a collection server.
The default value is false
.
- Note
- This setting is ignored if –use-cros-crash-reporter is present (which it will be if invoked by Chrome on ChromeOS).
- Parameters
-
[out] | enabled | Whether crash reports should be uploaded. |
- Returns
- On success, returns
true
, otherwise returns false
with an error logged.
◆ Initialize()
bool crashpad::Settings::Initialize |
( |
const base::FilePath & | path | ) |
|
Initializes the settings data store.
This method must be called only once, and must be successfully called before any other method in this class may be called.
- Parameters
-
[in] | path | The location to store the settings data. |
- Returns
true
if the data store was initialized successfully, otherwise false
with an error logged.
◆ IsLockExpired()
bool crashpad::Settings::IsLockExpired |
( |
const base::FilePath & | file_path, |
|
|
time_t | lockfile_ttl ) |
|
static |
Returns whether the lockfile for a file is expired.
This could be part of ScopedLockedFileHandle, but this needs to be public while ScopedLockedFileHandle is private to Settings.
- Parameters
-
[in] | file_path | The path to the file whose lockfile will be checked. |
[in] | lockfile_ttl | How long the lockfile has to live before expiring. |
- Returns
true
if the lock for the file is expired, otherwise false
.
◆ SetLastUploadAttemptTime()
bool crashpad::Settings::SetLastUploadAttemptTime |
( |
time_t | time | ) |
|
Sets the last time at which a report was attempted to be uploaded.
This is only meant to be used internally by the CrashReportDatabase.
- Parameters
-
[in] | time | The last time at which a report was uploaded. |
- Returns
- On success, returns
true
, otherwise returns false
with an error logged.
◆ SetUploadsEnabled()
bool crashpad::Settings::SetUploadsEnabled |
( |
bool | enabled | ) |
|
Sets the user’s preference for submitting crash reports to a collection server.
- Parameters
-
[in] | enabled | Whether crash reports should be uploaded. |
- Returns
- On success, returns
true
, otherwise returns false
with an error logged.
The documentation for this class was generated from the following files:
- client/settings.h
- client/settings.cc