crashpad::Settings Class Reference

An interface for accessing and modifying the settings of a CrashReportDatabase. More...

`#include "client/settings.h"`

## Classes

struct | Data

## Public Member Functions

bool | Initialize (const base::FilePath &path)
| Initializes the settings data store. More...
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. More...
bool | GetUploadsEnabled (bool *enabled)
| Retrieves the user’s preference for submitting crash reports to a collection server. More...
bool | SetUploadsEnabled (bool enabled)
| Sets the user’s preference for submitting crash reports to a collection server. More...
bool | GetLastUploadAttemptTime (time_t *time)
| Retrieves the last time at which a report was attempted to be uploaded. More...
bool | SetLastUploadAttemptTime (time_t time)
| Sets the last time at which a report was attempted to be uploaded. More...

## Detailed Description

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().

## Member Function Documentation

## 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`.

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.

## 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