<trclass="memdesc:"><tdclass="mdescLeft"> </td><tdclass="mdescRight">A scoper to cleanly handle the interface requirement imposed by <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a6af53890d1e551800330e6ad53be995b"title="Creates a record of a new crash report. ">PrepareNewCrashReport()</a>. <ahref="classcrashpad_1_1CrashReportDatabase_1_1CallErrorWritingCrashReport.html#details">More...</a><br/></td></tr>
<trclass="memdesc:"><tdclass="mdescLeft"> </td><tdclass="mdescRight">A crash report that is in the process of being written. <ahref="structcrashpad_1_1CrashReportDatabase_1_1NewReport.html#details">More...</a><br/></td></tr>
<trclass="memitem:a0bbd146654537fa0cf1b576eb647bb00"><tdclass="memItemLeft"align="right"valign="top">enum  </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a0bbd146654537fa0cf1b576eb647bb00">OperationStatus</a><trclass="memdesc:a0bbd146654537fa0cf1b576eb647bb00"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The result code for operations performed on a database. <ahref="classcrashpad_1_1CrashReportDatabase.html#a0bbd146654537fa0cf1b576eb647bb00">More...</a><br/></td></tr>
<trclass="memdesc:a705a5c510ba8eeda15bf4fe9af6e37b1"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the <aclass="el"href="classcrashpad_1_1Settings.html"title="An interface for accessing and modifying the settings of a CrashReportDatabase. ">Settings</a> object for this database. <ahref="#a705a5c510ba8eeda15bf4fe9af6e37b1">More...</a><br/></td></tr>
<trclass="memdesc:a6af53890d1e551800330e6ad53be995b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates a record of a new crash report. <ahref="#a6af53890d1e551800330e6ad53be995b">More...</a><br/></td></tr>
<trclass="memdesc:ac77057d6b9f0b8d8fb88e7653456c0ff"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Informs the database that a crash report has been written. <ahref="#ac77057d6b9f0b8d8fb88e7653456c0ff">More...</a><br/></td></tr>
<trclass="memdesc:a18e8875bcd1a0888bda5b126eb2bec00"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Informs the database that an error occurred while attempting to write a crash report, and that any resources associated with it should be cleaned up. <ahref="#a18e8875bcd1a0888bda5b126eb2bec00">More...</a><br/></td></tr>
<trclass="memdesc:a19191932252bc836a84cf432ea8f3b7e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the crash report record for the unique identifier. <ahref="#a19191932252bc836a84cf432ea8f3b7e">More...</a><br/></td></tr>
<trclass="memdesc:a508353ae8893bf48a5ffcc9c74b03223"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns a list of crash report records that have not been uploaded. <ahref="#a508353ae8893bf48a5ffcc9c74b03223">More...</a><br/></td></tr>
<trclass="memdesc:a3aecde1673f34d7789c1b8562242223c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns a list of crash report records that have been completed, either by being uploaded or by skipping upload. <ahref="#a3aecde1673f34d7789c1b8562242223c">More...</a><br/></td></tr>
<trclass="memdesc:ab87ae2586364bc46def5335c07c8eb04"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Obtains a report object for uploading to a collection server. <ahref="#ab87ae2586364bc46def5335c07c8eb04">More...</a><br/></td></tr>
<trclass="memdesc:a5c9b19255aff2f995cc645e949331f7d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adjusts a crash report record’s metadata to account for an upload attempt, and updates the last upload attempt time as returned by <aclass="el"href="classcrashpad_1_1Settings.html#a855f61d6fc73042dcb886ef40d8e4429"title="Retrieves the last time at which a report was attempted to be uploaded. ">Settings::GetLastUploadAttemptTime()</a>. <ahref="#a5c9b19255aff2f995cc645e949331f7d">More...</a><br/></td></tr>
<trclass="memdesc:ab0869a26352d37e7f99d9b520f6d07cd"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Moves a report from the pending state to the completed state, but without the report being uploaded. <ahref="#ab0869a26352d37e7f99d9b520f6d07cd">More...</a><br/></td></tr>
<trclass="memdesc:aa8aff03198b18b5dc479c189115500c4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Deletes a crash report file and its associated metadata. <ahref="#aa8aff03198b18b5dc479c189115500c4">More...</a><br/></td></tr>
<trclass="memdesc:a4c195d0ba0155e3692be1bdb4bb79fc6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Marks a crash report as explicitly requested to be uploaded by the user and moves it to 'pending' state. <ahref="#a4c195d0ba0155e3692be1bdb4bb79fc6">More...</a><br/></td></tr>
<trclass="memdesc:a00292742dfe4c0081d6987c5a32c7a3e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Opens a database of crash reports, possibly creating it. <ahref="#a00292742dfe4c0081d6987c5a32c7a3e">More...</a><br/></td></tr>
<trclass="memdesc:abc49f639a5880f51c7d69b955a3deae7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Opens an existing database of crash reports. <ahref="#abc49f639a5880f51c7d69b955a3deae7">More...</a><br/></td></tr>
<divclass="textblock"><p>An interface for managing a collection of crash report files and metadata associated with the crash reports. </p>
<p>All <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1Report.html"title="A crash report record. ">Report</a> objects that are returned by this class are logically const. They are snapshots of the database at the time the query was run, and the data returned is liable to change after the query is executed.</p>
<p>The lifecycle of a crash report has three stages:</p>
<oltype="1">
<li>New: A crash report is created with <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a6af53890d1e551800330e6ad53be995b"title="Creates a record of a new crash report. ">PrepareNewCrashReport()</a>, the the client then writes the report, and then calls <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#ac77057d6b9f0b8d8fb88e7653456c0ff"title="Informs the database that a crash report has been written. ">FinishedWritingCrashReport()</a> to make the report Pending.</li>
<li>Pending: The report has been written but has not been locally processed, or it was has been brought back from 'Completed' state by user request.</li>
<li>Completed: The report has been locally processed, either by uploading it to a collection server and calling <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a5c9b19255aff2f995cc645e949331f7d"title="Adjusts a crash report record’s metadata to account for an upload attempt, and updates the last uplo...">RecordUploadAttempt()</a>, or by calling <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#ab0869a26352d37e7f99d9b520f6d07cd"title="Moves a report from the pending state to the completed state, but without the report being uploaded...">SkipReportUpload()</a>. </li>
<tr><tdclass="fieldname"><aid="a0bbd146654537fa0cf1b576eb647bb00ab005def710dfeef7c3f3fd6c7e615239"></a>kReportNotFound </td><tdclass="fielddoc"><p>The report that was requested could not be located. </p>
<p>This may occur when the report is present in the database but not in a state appropriate for the requested operation, for example, if <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#ab87ae2586364bc46def5335c07c8eb04"title="Obtains a report object for uploading to a collection server. ">GetReportForUploading()</a> is called to obtain report that’s already in the completed state. </p>
<tr><tdclass="fieldname"><aid="a0bbd146654537fa0cf1b576eb647bb00ad40b3e9919ed7de952a4e30d5be5c59b"></a>kFileSystemError </td><tdclass="fielddoc"><p>An error occured while performing a file operation on a crash report. </p>
<p>A database is responsible for managing both the metadata about a report and the actual crash report itself. This error is returned when an error occurred when managing the report file. Additional information will be logged. </p>
<tr><tdclass="fieldname"><aid="a0bbd146654537fa0cf1b576eb647bb00a3b98980ca5f43ea58da77b58e718a9c5"></a>kDatabaseError </td><tdclass="fielddoc"><p>An error occured while recording metadata for a crash report or database-wide settings. </p>
<p>A database is responsible for managing both the metadata about a report and the actual crash report itself. This error is returned when an error occurred when managing the metadata about a crash report or database-wide settings. Additional information will be logged. </p>
<tr><tdclass="fieldname"><aid="a0bbd146654537fa0cf1b576eb647bb00a5144543522e789911f7c8e0e34807961"></a>kBusyError </td><tdclass="fielddoc"><p>The operation could not be completed because a concurrent operation affecting the report is occurring. </p>
<tr><tdclass="fieldname"><aid="a0bbd146654537fa0cf1b576eb647bb00a11d438c5b7fd00ea52a6968871ab7a6e"></a>kCannotRequestUpload </td><tdclass="fielddoc"><p>The report cannot be uploaded by user request as it has already been uploaded. </p>
<p>Deletes a crash report file and its associated metadata. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">uuid</td><td>The <aclass="el"href="structcrashpad_1_1UUID.html"title="A universally unique identifier (UUID). ">UUID</a> of the report to delete.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>
<p>Informs the database that an error occurred while attempting to write a crash report, and that any resources associated with it should be cleaned up. </p>
<p>After calling this method, the database is permitted to remove the file at <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1NewReport.html#aef12e5af9f053a8f75bc3fc81c178189"title="The path to the crash report being written. ">NewReport::path</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">report</td><td>A <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1NewReport.html"title="A crash report that is in the process of being written. ">NewReport</a> obtained with <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a6af53890d1e551800330e6ad53be995b"title="Creates a record of a new crash report. ">PrepareNewCrashReport()</a>. The <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1NewReport.html"title="A crash report that is in the process of being written. ">NewReport</a> object and file handle within will be invalidated as part of this call.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>
<p>Informs the database that a crash report has been written. </p>
<p>After calling this method, the database is permitted to move and rename the file at <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1NewReport.html#aef12e5af9f053a8f75bc3fc81c178189"title="The path to the crash report being written. ">NewReport::path</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">report</td><td>A <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1NewReport.html"title="A crash report that is in the process of being written. ">NewReport</a> obtained with <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a6af53890d1e551800330e6ad53be995b"title="Creates a record of a new crash report. ">PrepareNewCrashReport()</a>. The <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1NewReport.html"title="A crash report that is in the process of being written. ">NewReport</a> object and file handle within will be invalidated as part of this call. </td></tr>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">uuid</td><td>The <aclass="el"href="structcrashpad_1_1UUID.html"title="A universally unique identifier (UUID). ">UUID</a> of this crash report.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>
<p>Returns a list of crash report records that have been completed, either by being uploaded or by skipping upload. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">reports</td><td>A list of crash report record objects. This must be empty on entry. Only valid if this returns <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a0bbd146654537fa0cf1b576eb647bb00ad73503b93bff6f4ae156a65fcb5e71f8"title="No error occurred. ">kNoError</a>.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>
<p>Returns a list of crash report records that have not been uploaded. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">reports</td><td>A list of crash report record objects. This must be empty on entry. Only valid if this returns <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a0bbd146654537fa0cf1b576eb647bb00ad73503b93bff6f4ae156a65fcb5e71f8"title="No error occurred. ">kNoError</a>.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>
<p>Obtains a report object for uploading to a collection server. </p>
<p>The file at <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1Report.html#a42cfce2b75dfee931b8d82968592d8a7">Report::file_path</a> should be uploaded by the caller, and then the returned <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1Report.html"title="A crash report record. ">Report</a> object must be disposed of via a call to <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a5c9b19255aff2f995cc645e949331f7d"title="Adjusts a crash report record’s metadata to account for an upload attempt, and updates the last uplo...">RecordUploadAttempt()</a>.</p>
<p>A subsequent call to this method with the same <em>uuid</em> is illegal until <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a5c9b19255aff2f995cc645e949331f7d"title="Adjusts a crash report record’s metadata to account for an upload attempt, and updates the last uplo...">RecordUploadAttempt()</a> has been called.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">uuid</td><td>The unique identifier for the crash report record. </td></tr>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">report</td><td>A crash report record for the report to be uploaded. The caller does not own this object. Only valid if this returns <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a0bbd146654537fa0cf1b576eb647bb00ad73503b93bff6f4ae156a65fcb5e71f8"title="No error occurred. ">kNoError</a>.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>
<p>Returns the <aclass="el"href="classcrashpad_1_1Settings.html"title="An interface for accessing and modifying the settings of a CrashReportDatabase. ">Settings</a> object for this database. </p>
<dlclass="section return"><dt>Returns</dt><dd>A weak pointer to the <aclass="el"href="classcrashpad_1_1Settings.html"title="An interface for accessing and modifying the settings of a CrashReportDatabase. ">Settings</a> object, which is owned by the database. </dd></dl>
<p>Opens a database of crash reports, possibly creating it. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">path</td><td>A path to the database to be created or opened. If the database does not yet exist, it will be created if possible. Note that for databases implemented as directory structures, existence refers solely to the outermost directory.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A database object on success, <code>nullptr</code> on failure with an error logged.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#abc49f639a5880f51c7d69b955a3deae7"title="Opens an existing database of crash reports. ">InitializeWithoutCreating</a></dd></dl>
<p>Opens an existing database of crash reports. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">path</td><td>A path to the database to be opened. If the database does not yet exist, it will not be created. Note that for databases implemented as directory structures, existence refers solely to the outermost directory. On such databases, as long as the outermost directory is present, this method will create the inner structure.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A database object on success, <code>nullptr</code> on failure with an error logged.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a00292742dfe4c0081d6987c5a32c7a3e"title="Opens a database of crash reports, possibly creating it. ">Initialize</a></dd></dl>
<p>Returns the crash report record for the unique identifier. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">uuid</td><td>The crash report record unique identifier. </td></tr>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">report</td><td>A crash report record. Only valid if this returns <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a0bbd146654537fa0cf1b576eb647bb00ad73503b93bff6f4ae156a65fcb5e71f8"title="No error occurred. ">kNoError</a>.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>
<p>Callers can then write the crash report using the file handle provided. The caller does not own the new crash report record or its file handle, both of which must be explicitly disposed of by calling <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#ac77057d6b9f0b8d8fb88e7653456c0ff"title="Informs the database that a crash report has been written. ">FinishedWritingCrashReport()</a> or <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a18e8875bcd1a0888bda5b126eb2bec00"title="Informs the database that an error occurred while attempting to write a crash report, and that any resources associated with it should be cleaned up. ">ErrorWritingCrashReport()</a>.</p>
<p>To arrange to call <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a18e8875bcd1a0888bda5b126eb2bec00"title="Informs the database that an error occurred while attempting to write a crash report, and that any resources associated with it should be cleaned up. ">ErrorWritingCrashReport()</a> during any early return, use <aclass="el"href="classcrashpad_1_1CrashReportDatabase_1_1CallErrorWritingCrashReport.html"title="A scoper to cleanly handle the interface requirement imposed by PrepareNewCrashReport(). ">CallErrorWritingCrashReport</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">report</td><td>A <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1NewReport.html"title="A crash report that is in the process of being written. ">NewReport</a> object containing a file handle to which the crash report data should be written. Only valid if this returns <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a0bbd146654537fa0cf1b576eb647bb00ad73503b93bff6f4ae156a65fcb5e71f8"title="No error occurred. ">kNoError</a>. The caller must not delete the <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1NewReport.html"title="A crash report that is in the process of being written. ">NewReport</a> object or close the file handle within.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>
<p>Adjusts a crash report record’s metadata to account for an upload attempt, and updates the last upload attempt time as returned by <aclass="el"href="classcrashpad_1_1Settings.html#a855f61d6fc73042dcb886ef40d8e4429"title="Retrieves the last time at which a report was attempted to be uploaded. ">Settings::GetLastUploadAttemptTime()</a>. </p>
<p>After calling this method, the database is permitted to move and rename the file at <aclass="el"href="structcrashpad_1_1CrashReportDatabase_1_1Report.html#a42cfce2b75dfee931b8d82968592d8a7">Report::file_path</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">report</td><td>The report object obtained from <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#ab87ae2586364bc46def5335c07c8eb04"title="Obtains a report object for uploading to a collection server. ">GetReportForUploading()</a>. This object is invalidated after this call. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">successful</td><td>Whether the upload attempt was successful. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">id</td><td>The identifier assigned to this crash report by the collection server. Must be empty if <em>successful</em> is <code>false</code>; may be empty if it is <code>true</code>.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">uuid</td><td>The unique identifier for the crash report record. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">reason</td><td>The reason the report upload is being skipped for metrics tracking purposes.</td></tr>