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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 //! database-wide settings. Additional information will be logged. | 158 //! database-wide settings. Additional information will be logged. |
159 kDatabaseError, | 159 kDatabaseError, |
160 | 160 |
161 //! \brief The operation could not be completed because a concurrent | 161 //! \brief The operation could not be completed because a concurrent |
162 //! operation affecting the report is occurring. | 162 //! operation affecting the report is occurring. |
163 kBusyError, | 163 kBusyError, |
164 }; | 164 }; |
165 | 165 |
166 virtual ~CrashReportDatabase() {} | 166 virtual ~CrashReportDatabase() {} |
167 | 167 |
168 //! \brief Initializes a database of crash reports. | 168 //! \brief Opens a database of crash reports, possibly creating it. |
169 //! | 169 //! |
170 //! \param[in] path A path to the database to be created or opened. | 170 //! \param[in] path A path to the database to be created or opened. If the |
| 171 //! database does not yet exist, it will be created if possible. Note that |
| 172 //! for databases implemented as directory structures, existence refers |
| 173 //! solely to the outermost directory. |
171 //! | 174 //! |
172 //! \return A database object on success, `nullptr` on failure with an error | 175 //! \return A database object on success, `nullptr` on failure with an error |
173 //! logged. | 176 //! logged. |
| 177 //! |
| 178 //! \sa InitializeWithoutCreating |
174 static scoped_ptr<CrashReportDatabase> Initialize(const base::FilePath& path); | 179 static scoped_ptr<CrashReportDatabase> Initialize(const base::FilePath& path); |
175 | 180 |
| 181 //! \brief Opens an existing database of crash reports. |
| 182 //! |
| 183 //! \param[in] path A path to the database to be opened. If the database does |
| 184 //! not yet exist, it will not be created. Note that for databases |
| 185 //! implemented as directory structures, existence refers solely to the |
| 186 //! outermost directory. On such databases, as long as the outermost |
| 187 //! directory is present, this method will create the inner structure. |
| 188 //! |
| 189 //! \return A database object on success, `nullptr` on failure with an error |
| 190 //! logged. |
| 191 //! |
| 192 //! \sa Initialize |
| 193 static scoped_ptr<CrashReportDatabase> InitializeWithoutCreating( |
| 194 const base::FilePath& path); |
| 195 |
176 //! \brief Returns the Settings object for this database. | 196 //! \brief Returns the Settings object for this database. |
177 //! | 197 //! |
178 //! \return A weak pointer to the Settings object, which is owned by the | 198 //! \return A weak pointer to the Settings object, which is owned by the |
179 //! database. | 199 //! database. |
180 virtual Settings* GetSettings() = 0; | 200 virtual Settings* GetSettings() = 0; |
181 | 201 |
182 //! \brief Creates a record of a new crash report. | 202 //! \brief Creates a record of a new crash report. |
183 //! | 203 //! |
184 //! Callers can then write the crash report using the file handle provided. | 204 //! Callers can then write the crash report using the file handle provided. |
185 //! The caller does not own the new crash report record or its file handle, | 205 //! The caller does not own the new crash report record or its file handle, |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 protected: | 330 protected: |
311 CrashReportDatabase() {} | 331 CrashReportDatabase() {} |
312 | 332 |
313 private: | 333 private: |
314 DISALLOW_COPY_AND_ASSIGN(CrashReportDatabase); | 334 DISALLOW_COPY_AND_ASSIGN(CrashReportDatabase); |
315 }; | 335 }; |
316 | 336 |
317 } // namespace crashpad | 337 } // namespace crashpad |
318 | 338 |
319 #endif // CRASHPAD_CLIENT_CRASH_REPORT_DATABASE_H_ | 339 #endif // CRASHPAD_CLIENT_CRASH_REPORT_DATABASE_H_ |
OLD | NEW |