<ahref="#pub-methods">Public Member Functions</a>|
<ahref="classcrashpad_1_1CrashReportDatabaseMac-members.html">List of all members</a></div>
<divclass="headertitle">
<divclass="title">crashpad::CrashReportDatabaseMac Class Reference</div></div>
</div><!--header-->
<divclass="contents">
<p>A <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html"title="An interface for managing a collection of crash report files and metadata associated with the crash r...">CrashReportDatabase</a> that uses HFS+ extended attributes to store report metadata.
<areahref="classcrashpad_1_1CrashReportDatabase.html"title="An interface for managing a collection of crash report files and metadata associated with the crash r..."alt="crashpad::CrashReportDatabase"shape="rect"coords="0,0,220,24"/>
<trclass="memdesc:a2e42d9d3d4d9f96285ba504d7668a34b"><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="#a2e42d9d3d4d9f96285ba504d7668a34b">More...</a><br/></td></tr>
<trclass="memdesc:a0929c775c77975671805a06ed790afaf"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates a record of a new crash report. <ahref="#a0929c775c77975671805a06ed790afaf">More...</a><br/></td></tr>
<trclass="memdesc:a21779f103f618f0fa97d8cbe6f5ea936"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Informs the database that a crash report has been successfully written. <ahref="#a21779f103f618f0fa97d8cbe6f5ea936">More...</a><br/></td></tr>
<trclass="memdesc:a17f445e44bd09f86b352fa5846e9ff35"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the crash report record for the unique identifier. <ahref="#a17f445e44bd09f86b352fa5846e9ff35">More...</a><br/></td></tr>
<trclass="memdesc:aa6ad8f281d825122e9a9872c82612d0e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns a list of crash report records that have not been uploaded. <ahref="#aa6ad8f281d825122e9a9872c82612d0e">More...</a><br/></td></tr>
<trclass="memdesc:ac05cc3c5354619cb3d17aaee8209fa54"><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="#ac05cc3c5354619cb3d17aaee8209fa54">More...</a><br/></td></tr>
<trclass="memdesc:aa30fc6ae311130ee5702ad4e0b3fc099"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Obtains and locks a report object for uploading to a collection server. <ahref="#aa30fc6ae311130ee5702ad4e0b3fc099">More...</a><br/></td></tr>
<trclass="memdesc:a5a92b53f409c4d360403b00aa5aaa8fe"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Moves a report from the pending state to the completed state, but without the report being uploaded. <ahref="#a5a92b53f409c4d360403b00aa5aaa8fe">More...</a><br/></td></tr>
<trclass="memdesc:ab33eac7ac70f94627d750d2bf3d9ba4a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Deletes a crash report file and its associated metadata. <ahref="#ab33eac7ac70f94627d750d2bf3d9ba4a">More...</a><br/></td></tr>
<trclass="memdesc:a5c2c91bc0a68ba9cf9f09cad8268257f"><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="#a5c2c91bc0a68ba9cf9f09cad8268257f">More...</a><br/></td></tr>
<trclass="inherit_header pub_methods_classcrashpad_1_1CrashReportDatabase"><tdcolspan="2"onclick="javascript:toggleInherit('pub_methods_classcrashpad_1_1CrashReportDatabase')"><imgsrc="closed.png"alt="-"/> Public Member Functions inherited from <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html">crashpad::CrashReportDatabase</a></td></tr>
<trclass="memdesc:a329a165c28e20bc3458e697ea8778517 inherit pub_methods_classcrashpad_1_1CrashReportDatabase"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Records a successful upload for a report 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="classcrashpad_1_1CrashReportDatabase.html#a329a165c28e20bc3458e697ea8778517">More...</a><br/></td></tr>
<trclass="memdesc:af06b2b1312d8a824559d99232a173576 inherit pub_methods_classcrashpad_1_1CrashReportDatabase"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Cleans the database of expired lockfiles, metadata without report files, and report files without metadata. <ahref="classcrashpad_1_1CrashReportDatabase.html#af06b2b1312d8a824559d99232a173576">More...</a><br/></td></tr>
<trclass="inherit_header pub_types_classcrashpad_1_1CrashReportDatabase"><tdcolspan="2"onclick="javascript:toggleInherit('pub_types_classcrashpad_1_1CrashReportDatabase')"><imgsrc="closed.png"alt="-"/> Public Types inherited from <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html">crashpad::CrashReportDatabase</a></td></tr>
<trclass="memitem:a0bbd146654537fa0cf1b576eb647bb00 inherit pub_types_classcrashpad_1_1CrashReportDatabase"><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="inherit_header pub_static_methods_classcrashpad_1_1CrashReportDatabase"><tdcolspan="2"onclick="javascript:toggleInherit('pub_static_methods_classcrashpad_1_1CrashReportDatabase')"><imgsrc="closed.png"alt="-"/> Static Public Member Functions inherited from <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html">crashpad::CrashReportDatabase</a></td></tr>
<trclass="memdesc:a00292742dfe4c0081d6987c5a32c7a3e inherit pub_static_methods_classcrashpad_1_1CrashReportDatabase"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Opens a database of crash reports, possibly creating it. <ahref="classcrashpad_1_1CrashReportDatabase.html#a00292742dfe4c0081d6987c5a32c7a3e">More...</a><br/></td></tr>
<trclass="memdesc:abc49f639a5880f51c7d69b955a3deae7 inherit pub_static_methods_classcrashpad_1_1CrashReportDatabase"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Opens an existing database of crash reports. <ahref="classcrashpad_1_1CrashReportDatabase.html#abc49f639a5880f51c7d69b955a3deae7">More...</a><br/></td></tr>
<divclass="textblock"><p>A <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html"title="An interface for managing a collection of crash report files and metadata associated with the crash r...">CrashReportDatabase</a> that uses HFS+ extended attributes to store report metadata. </p>
<p>The database maintains three directories of reports: <code>"new"</code> to hold crash reports that are in the process of being written, <code>"completed"</code> to hold reports that have been written and are awaiting upload, and <code>"uploaded"</code> to hold reports successfully uploaded to a collection server. If the user has opted out of report collection, reports will still be written and moved to the completed directory, but they just will not be uploaded.</p>
<p>The database stores its metadata in extended filesystem attributes. To ensure safe access, the report file is locked using <code>O_EXLOCK</code> during all extended attribute operations. The lock should be obtained using ObtainReportLock(). </p>
</div><h2class="groupheader">Member Function Documentation</h2>
<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 a crash report has been successfully written. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">report</td><td>A NewReport obtained with <aclass="el"href="classcrashpad_1_1CrashReportDatabaseMac.html#a0929c775c77975671805a06ed790afaf"title="Creates a record of a new crash report. ">PrepareNewCrashReport()</a>. The NewReport object 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 and locks a report object for uploading to a collection server. </p>
<p>Callers should upload the crash report using the <aclass="el"href="classcrashpad_1_1FileReader.html"title="A file reader implementation that wraps traditional system file operations on files accessed through ...">FileReader</a> provided. Callers should then call <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a329a165c28e20bc3458e697ea8778517"title="Records a successful upload for a report and updates the last upload attempt time as returned by Sett...">RecordUploadComplete()</a> to record a successful upload. If <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a329a165c28e20bc3458e697ea8778517"title="Records a successful upload for a report and updates the last upload attempt time as returned by Sett...">RecordUploadComplete()</a> is not called, the upload attempt will be recorded as unsuccessful and the report lock released when <em>report</em> is destroyed.</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. Only valid if this returns <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a0bbd146654537fa0cf1b576eb647bb00ad73503b93bff6f4ae156a65fcb5e71f8"title="No error occurred. ">kNoError</a>. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">report_metrics</td><td>If <code>false</code>, metrics will not be recorded for this upload attempt when <aclass="el"href="classcrashpad_1_1CrashReportDatabase.html#a329a165c28e20bc3458e697ea8778517"title="Records a successful upload for a report and updates the last upload attempt time as returned by Sett...">RecordUploadComplete()</a> is called or <em>report</em> is destroyed. Metadata for the upload attempt will still be recorded in the database.</td></tr>
<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>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 should write the crash report using the <aclass="el"href="classcrashpad_1_1FileWriter.html"title="A file writer implementation that wraps traditional system file operations on files accessed through ...">FileWriter</a> provided. Callers should then call <aclass="el"href="classcrashpad_1_1CrashReportDatabaseMac.html#a21779f103f618f0fa97d8cbe6f5ea936"title="Informs the database that a crash report has been successfully written. ">FinishedWritingCrashReport()</a> to complete report creation. If an error is encountered while writing the crash report, no special action needs to be taken. If <aclass="el"href="classcrashpad_1_1CrashReportDatabaseMac.html#a21779f103f618f0fa97d8cbe6f5ea936"title="Informs the database that a crash report has been successfully written. ">FinishedWritingCrashReport()</a> is not called, the report will be removed from the database when <em>report</em> is destroyed.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">report</td><td>A NewReport object containing a <aclass="el"href="classcrashpad_1_1FileWriter.html"title="A file writer implementation that wraps traditional system file operations on files accessed through ...">FileWriter</a> with which to write the report data. 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>Moves a report from the pending state to the completed state, but without the report being uploaded. </p>
<p>This can be used if the user has disabled crash report collection, but crash generation is still enabled in the product.</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">[in]</td><tdclass="paramname">reason</td><td>The reason the report upload is being skipped for metrics tracking purposes.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The operation status code. </dd></dl>