OLD | NEW |
---|---|
1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include <vector> | 21 #include <vector> |
22 | 22 |
23 #include "base/basictypes.h" | 23 #include "base/basictypes.h" |
24 #include "base/files/file_path.h" | 24 #include "base/files/file_path.h" |
25 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
26 #include "util/file/file_io.h" | 26 #include "util/file/file_io.h" |
27 #include "util/misc/uuid.h" | 27 #include "util/misc/uuid.h" |
28 | 28 |
29 namespace crashpad { | 29 namespace crashpad { |
30 | 30 |
31 class Settings; | |
32 | |
31 //! \brief An interface for managing a collection of crash report files and | 33 //! \brief An interface for managing a collection of crash report files and |
32 //! metadata associated with the crash reports. | 34 //! metadata associated with the crash reports. |
33 //! | 35 //! |
34 //! All Report objects that are returned by this class are logically const. | 36 //! All Report objects that are returned by this class are logically const. |
35 //! They are snapshots of the database at the time the query was run, and the | 37 //! They are snapshots of the database at the time the query was run, and the |
36 //! data returned is liable to change after the query is executed. | 38 //! data returned is liable to change after the query is executed. |
37 //! | 39 //! |
38 //! The lifecycle of a crash report has three stages: | 40 //! The lifecycle of a crash report has three stages: |
39 //! | 41 //! |
40 //! 1. New: A crash report is created with PrepareNewCrashReport(), the | 42 //! 1. New: A crash report is created with PrepareNewCrashReport(), the |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 | 136 |
135 //! \brief Initializes a database of crash reports. | 137 //! \brief Initializes a database of crash reports. |
136 //! | 138 //! |
137 //! \param[in] path A path to a writable directory, where the database can | 139 //! \param[in] path A path to a writable directory, where the database can |
138 //! be created or opened. | 140 //! be created or opened. |
139 //! | 141 //! |
140 //! \return A database object on success, `nullptr` on failure with an error | 142 //! \return A database object on success, `nullptr` on failure with an error |
141 //! logged. | 143 //! logged. |
142 static scoped_ptr<CrashReportDatabase> Initialize(const base::FilePath& path); | 144 static scoped_ptr<CrashReportDatabase> Initialize(const base::FilePath& path); |
143 | 145 |
146 //! \brief Returns the Settings object for this database. | |
Mark Mentovai
2015/03/08 05:21:56
Ownership?
Robert Sesek
2015/03/08 22:15:35
Done.
| |
147 virtual Settings* GetSettings() = 0; | |
148 | |
144 //! \brief Creates a record of a new crash report. | 149 //! \brief Creates a record of a new crash report. |
145 //! | 150 //! |
146 //! Callers can then write the crash report using the file handle provided. | 151 //! Callers can then write the crash report using the file handle provided. |
147 //! The caller does not own this handle, and it must be explicitly closed with | 152 //! The caller does not own this handle, and it must be explicitly closed with |
148 //! FinishedWritingCrashReport() or ErrorWritingCrashReport(). | 153 //! FinishedWritingCrashReport() or ErrorWritingCrashReport(). |
149 //! | 154 //! |
150 //! \param[out] report A file handle to which the crash report data should be | 155 //! \param[out] report A file handle to which the crash report data should be |
151 //! written. Only valid if this returns #kNoError. The caller must not | 156 //! written. Only valid if this returns #kNoError. The caller must not |
152 //! close this handle. | 157 //! close this handle. |
153 //! | 158 //! |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
259 protected: | 264 protected: |
260 CrashReportDatabase() {} | 265 CrashReportDatabase() {} |
261 | 266 |
262 private: | 267 private: |
263 DISALLOW_COPY_AND_ASSIGN(CrashReportDatabase); | 268 DISALLOW_COPY_AND_ASSIGN(CrashReportDatabase); |
264 }; | 269 }; |
265 | 270 |
266 } // namespace crashpad | 271 } // namespace crashpad |
267 | 272 |
268 #endif // CRASHPAD_CLIENT_CRASH_REPORT_DATABASE_H_ | 273 #endif // CRASHPAD_CLIENT_CRASH_REPORT_DATABASE_H_ |
OLD | NEW |