mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:16:13 +00:00
CrashReportDatabase::Initialize(): use the database path.
Rather than accepting the path to the database’s parent directory, this now accepts the path to the database itself. Using the parent directory proved cumbersome in practice. When testing crashpad_handler with a variety of databases, it is useful to be able to specify --database=/tmp/crashpad_database, --database=/tmp/crashpad_database_2, etc. The old interface required that these directories be created as a separate step, and would put the actual database at /tmp/crashpad_database/Crashpad. This was contrary to the operation of most tools and interfaces, which would only require that /tmp exist and would put the database at /tmp/crashpad_database. TEST=crashpad_client_test R=rsesek@chromium.org Review URL: https://codereview.chromium.org/991393002
This commit is contained in:
parent
bdcc1e7625
commit
7d5e17cd2e
@ -137,8 +137,7 @@ class CrashReportDatabase {
|
||||
|
||||
//! \brief Initializes a database of crash reports.
|
||||
//!
|
||||
//! \param[in] path A path to a writable directory, where the database can
|
||||
//! be created or opened.
|
||||
//! \param[in] path A path to the database to be created or opened.
|
||||
//!
|
||||
//! \return A database object on success, `nullptr` on failure with an error
|
||||
//! logged.
|
||||
|
@ -40,8 +40,6 @@ namespace crashpad {
|
||||
|
||||
namespace {
|
||||
|
||||
const char kDatabaseDirectoryName[] = "Crashpad";
|
||||
|
||||
const char kWriteDirectory[] = "new";
|
||||
const char kUploadPendingDirectory[] = "pending";
|
||||
const char kCompletedDirectory[] = "completed";
|
||||
@ -597,7 +595,7 @@ std::string CrashReportDatabaseMac::XattrName(const base::StringPiece& name) {
|
||||
scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize(
|
||||
const base::FilePath& path) {
|
||||
scoped_ptr<CrashReportDatabaseMac> database_mac(
|
||||
new CrashReportDatabaseMac(path.Append(kDatabaseDirectoryName)));
|
||||
new CrashReportDatabaseMac(path));
|
||||
if (!database_mac->Initialize())
|
||||
database_mac.reset();
|
||||
|
||||
|
@ -56,7 +56,9 @@ class CrashReportDatabaseTest : public testing::Test {
|
||||
}
|
||||
|
||||
CrashReportDatabase* db() { return db_.get(); }
|
||||
const base::FilePath& path() const { return temp_dir_.path(); }
|
||||
base::FilePath path() const {
|
||||
return temp_dir_.path().Append(FILE_PATH_LITERAL("crashpad_test_database"));
|
||||
}
|
||||
|
||||
void CreateCrashReport(CrashReportDatabase::Report* report) {
|
||||
CrashReportDatabase::NewReport* new_report = nullptr;
|
||||
|
@ -30,8 +30,6 @@ namespace crashpad {
|
||||
|
||||
namespace {
|
||||
|
||||
const wchar_t kDatabaseDirectoryName[] = L"Crashpad";
|
||||
|
||||
const wchar_t kReportsDirectory[] = L"reports";
|
||||
const wchar_t kMetadataFileName[] = L"metadata";
|
||||
|
||||
@ -763,7 +761,7 @@ scoped_ptr<Metadata> CrashReportDatabaseWin::AcquireMetadata() {
|
||||
scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize(
|
||||
const base::FilePath& path) {
|
||||
scoped_ptr<CrashReportDatabaseWin> database_win(
|
||||
new CrashReportDatabaseWin(path.Append(kDatabaseDirectoryName)));
|
||||
new CrashReportDatabaseWin(path));
|
||||
return database_win->Initialize() ? database_win.Pass()
|
||||
: scoped_ptr<CrashReportDatabaseWin>();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user