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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
517 // CrashReportDatabaseWin ------------------------------------------------------ | 517 // CrashReportDatabaseWin ------------------------------------------------------ |
518 | 518 |
519 class CrashReportDatabaseWin : public CrashReportDatabase { | 519 class CrashReportDatabaseWin : public CrashReportDatabase { |
520 public: | 520 public: |
521 explicit CrashReportDatabaseWin(const base::FilePath& path); | 521 explicit CrashReportDatabaseWin(const base::FilePath& path); |
522 ~CrashReportDatabaseWin() override; | 522 ~CrashReportDatabaseWin() override; |
523 | 523 |
524 bool Initialize(); | 524 bool Initialize(); |
525 | 525 |
526 // CrashReportDatabase: | 526 // CrashReportDatabase: |
527 Settings* GetSettings() override; | |
527 OperationStatus PrepareNewCrashReport(NewReport** report) override; | 528 OperationStatus PrepareNewCrashReport(NewReport** report) override; |
528 OperationStatus FinishedWritingCrashReport(NewReport* report, | 529 OperationStatus FinishedWritingCrashReport(NewReport* report, |
529 UUID* uuid) override; | 530 UUID* uuid) override; |
530 OperationStatus ErrorWritingCrashReport(NewReport* report) override; | 531 OperationStatus ErrorWritingCrashReport(NewReport* report) override; |
531 OperationStatus LookUpCrashReport(const UUID& uuid, Report* report) override; | 532 OperationStatus LookUpCrashReport(const UUID& uuid, Report* report) override; |
532 OperationStatus GetPendingReports( | 533 OperationStatus GetPendingReports( |
533 std::vector<const Report>* reports) override; | 534 std::vector<const Report>* reports) override; |
534 OperationStatus GetCompletedReports( | 535 OperationStatus GetCompletedReports( |
535 std::vector<const Report>* reports) override; | 536 std::vector<const Report>* reports) override; |
536 OperationStatus GetReportForUploading(const UUID& uuid, | 537 OperationStatus GetReportForUploading(const UUID& uuid, |
(...skipping 23 matching lines...) Expand all Loading... | |
560 if (!CreateDirectoryIfNecessary(base_dir_) || | 561 if (!CreateDirectoryIfNecessary(base_dir_) || |
561 !CreateDirectoryIfNecessary(base_dir_.Append(kReportsDirectory))) | 562 !CreateDirectoryIfNecessary(base_dir_.Append(kReportsDirectory))) |
562 return false; | 563 return false; |
563 | 564 |
564 // TODO(scottmg): When are completed reports pruned from disk? Delete here or | 565 // TODO(scottmg): When are completed reports pruned from disk? Delete here or |
565 // maybe on AcquireMetadata(). | 566 // maybe on AcquireMetadata(). |
566 | 567 |
567 return true; | 568 return true; |
568 } | 569 } |
569 | 570 |
571 Settings* CrashReportDatabaseWin::GetSettings() { | |
572 return nullptr; | |
Mark Mentovai
2015/03/09 19:12:35
Put a comment referencing bug 13 and call NOTREACH
Robert Sesek
2015/03/09 21:16:27
Done.
| |
573 } | |
574 | |
570 OperationStatus CrashReportDatabaseWin::PrepareNewCrashReport( | 575 OperationStatus CrashReportDatabaseWin::PrepareNewCrashReport( |
571 NewReport** report) { | 576 NewReport** report) { |
572 ::UUID system_uuid; | 577 ::UUID system_uuid; |
573 if (UuidCreate(&system_uuid) != RPC_S_OK) | 578 if (UuidCreate(&system_uuid) != RPC_S_OK) |
574 return kFileSystemError; | 579 return kFileSystemError; |
575 static_assert(sizeof(system_uuid) == 16, "unexpected system uuid size"); | 580 static_assert(sizeof(system_uuid) == 16, "unexpected system uuid size"); |
576 static_assert(offsetof(::UUID, Data1) == 0, "unexpected uuid layout"); | 581 static_assert(offsetof(::UUID, Data1) == 0, "unexpected uuid layout"); |
577 UUID uuid(reinterpret_cast<const uint8_t*>(&system_uuid.Data1)); | 582 UUID uuid(reinterpret_cast<const uint8_t*>(&system_uuid.Data1)); |
578 | 583 |
579 scoped_ptr<NewReportDisk> new_report(new NewReportDisk()); | 584 scoped_ptr<NewReportDisk> new_report(new NewReportDisk()); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
728 // static | 733 // static |
729 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize( | 734 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize( |
730 const base::FilePath& path) { | 735 const base::FilePath& path) { |
731 scoped_ptr<CrashReportDatabaseWin> database_win( | 736 scoped_ptr<CrashReportDatabaseWin> database_win( |
732 new CrashReportDatabaseWin(path.Append(kDatabaseDirectoryName))); | 737 new CrashReportDatabaseWin(path.Append(kDatabaseDirectoryName))); |
733 return database_win->Initialize() ? database_win.Pass() | 738 return database_win->Initialize() ? database_win.Pass() |
734 : scoped_ptr<CrashReportDatabaseWin>(); | 739 : scoped_ptr<CrashReportDatabaseWin>(); |
735 } | 740 } |
736 | 741 |
737 } // namespace crashpad | 742 } // namespace crashpad |
OLD | NEW |