Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: client/crash_report_database.h

Issue 1395653002: crashpad_database_util: Don’t create a database unless explicitly asked (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | client/crash_report_database_mac.mm » ('j') | handler/main.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 Initializes a database of crash reports.
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.
171 //! \param[in] create If `true`, a database that does not yet exist will be
172 //! created if possible. If `false`, the database must already exist. Note
173 //! that for databases implemented as directory structures, existence
174 //! refers solely to the outermost directory, and that if the outermost
175 //! directory exists, any inner structure will be created even if \a
176 //! create is `false`.
171 //! 177 //!
172 //! \return A database object on success, `nullptr` on failure with an error 178 //! \return A database object on success, `nullptr` on failure with an error
173 //! logged. 179 //! logged.
174 static scoped_ptr<CrashReportDatabase> Initialize(const base::FilePath& path); 180 static scoped_ptr<CrashReportDatabase> Initialize(const base::FilePath& path,
181 bool create);
Mark Mentovai 2015/10/07 18:45:58 This interface is the one thing I’m not sure about
scottmg 2015/10/07 19:16:30 I agree, I think a separate interface method for n
175 182
176 //! \brief Returns the Settings object for this database. 183 //! \brief Returns the Settings object for this database.
177 //! 184 //!
178 //! \return A weak pointer to the Settings object, which is owned by the 185 //! \return A weak pointer to the Settings object, which is owned by the
179 //! database. 186 //! database.
180 virtual Settings* GetSettings() = 0; 187 virtual Settings* GetSettings() = 0;
181 188
182 //! \brief Creates a record of a new crash report. 189 //! \brief Creates a record of a new crash report.
183 //! 190 //!
184 //! Callers can then write the crash report using the file handle provided. 191 //! Callers can then write the crash report using the file handle provided.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 protected: 310 protected:
304 CrashReportDatabase() {} 311 CrashReportDatabase() {}
305 312
306 private: 313 private:
307 DISALLOW_COPY_AND_ASSIGN(CrashReportDatabase); 314 DISALLOW_COPY_AND_ASSIGN(CrashReportDatabase);
308 }; 315 };
309 316
310 } // namespace crashpad 317 } // namespace crashpad
311 318
312 #endif // CRASHPAD_CLIENT_CRASH_REPORT_DATABASE_H_ 319 #endif // CRASHPAD_CLIENT_CRASH_REPORT_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | client/crash_report_database_mac.mm » ('j') | handler/main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698