| 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 INITIALIZATION_STATE_SET_INITIALIZING(initialized_); | 556 INITIALIZATION_STATE_SET_INITIALIZING(initialized_); |
| 557 | 557 |
| 558 // Ensure the database and report subdirectories exist. | 558 // Ensure the database and report subdirectories exist. |
| 559 if (!CreateDirectoryIfNecessary(base_dir_) || | 559 if (!CreateDirectoryIfNecessary(base_dir_) || |
| 560 !CreateDirectoryIfNecessary(base_dir_.Append(kReportsDirectory))) | 560 !CreateDirectoryIfNecessary(base_dir_.Append(kReportsDirectory))) |
| 561 return false; | 561 return false; |
| 562 | 562 |
| 563 // TODO(scottmg): When are completed reports pruned from disk? Delete here or | 563 // TODO(scottmg): When are completed reports pruned from disk? Delete here or |
| 564 // maybe on AcquireMetadata(). | 564 // maybe on AcquireMetadata(). |
| 565 | 565 |
| 566 if (!settings_.Initialize()) |
| 567 return false; |
| 568 |
| 566 INITIALIZATION_STATE_SET_VALID(initialized_); | 569 INITIALIZATION_STATE_SET_VALID(initialized_); |
| 567 return true; | 570 return true; |
| 568 } | 571 } |
| 569 | 572 |
| 570 Settings* CrashReportDatabaseWin::GetSettings() { | 573 Settings* CrashReportDatabaseWin::GetSettings() { |
| 571 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 574 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 572 return &settings_; | 575 return &settings_; |
| 573 } | 576 } |
| 574 | 577 |
| 575 OperationStatus CrashReportDatabaseWin::PrepareNewCrashReport( | 578 OperationStatus CrashReportDatabaseWin::PrepareNewCrashReport( |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 // static | 753 // static |
| 751 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize( | 754 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize( |
| 752 const base::FilePath& path) { | 755 const base::FilePath& path) { |
| 753 scoped_ptr<CrashReportDatabaseWin> database_win( | 756 scoped_ptr<CrashReportDatabaseWin> database_win( |
| 754 new CrashReportDatabaseWin(path)); | 757 new CrashReportDatabaseWin(path)); |
| 755 return database_win->Initialize() ? database_win.Pass() | 758 return database_win->Initialize() ? database_win.Pass() |
| 756 : scoped_ptr<CrashReportDatabaseWin>(); | 759 : scoped_ptr<CrashReportDatabaseWin>(); |
| 757 } | 760 } |
| 758 | 761 |
| 759 } // namespace crashpad | 762 } // namespace crashpad |
| OLD | NEW |