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(std::vector<Report>* reports) override; | 533 OperationStatus GetPendingReports(std::vector<Report>* reports) override; |
533 OperationStatus GetCompletedReports(std::vector<Report>* reports) override; | 534 OperationStatus GetCompletedReports(std::vector<Report>* reports) override; |
534 OperationStatus GetReportForUploading(const UUID& uuid, | 535 OperationStatus GetReportForUploading(const UUID& uuid, |
535 const Report** report) override; | 536 const Report** report) override; |
536 OperationStatus RecordUploadAttempt(const Report* report, | 537 OperationStatus RecordUploadAttempt(const Report* report, |
(...skipping 21 matching lines...) Expand all Loading... |
558 if (!CreateDirectoryIfNecessary(base_dir_) || | 559 if (!CreateDirectoryIfNecessary(base_dir_) || |
559 !CreateDirectoryIfNecessary(base_dir_.Append(kReportsDirectory))) | 560 !CreateDirectoryIfNecessary(base_dir_.Append(kReportsDirectory))) |
560 return false; | 561 return false; |
561 | 562 |
562 // 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 |
563 // maybe on AcquireMetadata(). | 564 // maybe on AcquireMetadata(). |
564 | 565 |
565 return true; | 566 return true; |
566 } | 567 } |
567 | 568 |
| 569 Settings* CrashReportDatabaseWin::GetSettings() { |
| 570 // Port to Win https://code.google.com/p/crashpad/issues/detail?id=13. |
| 571 NOTREACHED(); |
| 572 return nullptr; |
| 573 } |
| 574 |
568 OperationStatus CrashReportDatabaseWin::PrepareNewCrashReport( | 575 OperationStatus CrashReportDatabaseWin::PrepareNewCrashReport( |
569 NewReport** report) { | 576 NewReport** report) { |
570 ::UUID system_uuid; | 577 ::UUID system_uuid; |
571 if (UuidCreate(&system_uuid) != RPC_S_OK) | 578 if (UuidCreate(&system_uuid) != RPC_S_OK) |
572 return kFileSystemError; | 579 return kFileSystemError; |
573 static_assert(sizeof(system_uuid) == 16, "unexpected system uuid size"); | 580 static_assert(sizeof(system_uuid) == 16, "unexpected system uuid size"); |
574 static_assert(offsetof(::UUID, Data1) == 0, "unexpected uuid layout"); | 581 static_assert(offsetof(::UUID, Data1) == 0, "unexpected uuid layout"); |
575 UUID uuid(reinterpret_cast<const uint8_t*>(&system_uuid.Data1)); | 582 UUID uuid(reinterpret_cast<const uint8_t*>(&system_uuid.Data1)); |
576 | 583 |
577 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... |
726 // static | 733 // static |
727 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize( | 734 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize( |
728 const base::FilePath& path) { | 735 const base::FilePath& path) { |
729 scoped_ptr<CrashReportDatabaseWin> database_win( | 736 scoped_ptr<CrashReportDatabaseWin> database_win( |
730 new CrashReportDatabaseWin(path.Append(kDatabaseDirectoryName))); | 737 new CrashReportDatabaseWin(path.Append(kDatabaseDirectoryName))); |
731 return database_win->Initialize() ? database_win.Pass() | 738 return database_win->Initialize() ? database_win.Pass() |
732 : scoped_ptr<CrashReportDatabaseWin>(); | 739 : scoped_ptr<CrashReportDatabaseWin>(); |
733 } | 740 } |
734 | 741 |
735 } // namespace crashpad | 742 } // namespace crashpad |
OLD | NEW |