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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 OperationStatus os = metadata->FindSingleReportAndMarkDirty( | 701 OperationStatus os = metadata->FindSingleReportAndMarkDirty( |
702 report->uuid, ReportState::kUploading, &report_disk); | 702 report->uuid, ReportState::kUploading, &report_disk); |
703 if (os == CrashReportDatabaseWin::kNoError) { | 703 if (os == CrashReportDatabaseWin::kNoError) { |
704 report_disk->uploaded = successful; | 704 report_disk->uploaded = successful; |
705 report_disk->id = id; | 705 report_disk->id = id; |
706 report_disk->last_upload_attempt_time = time(nullptr); | 706 report_disk->last_upload_attempt_time = time(nullptr); |
707 report_disk->upload_attempts++; | 707 report_disk->upload_attempts++; |
708 report_disk->state = | 708 report_disk->state = |
709 successful ? ReportState::kCompleted : ReportState::kPending; | 709 successful ? ReportState::kCompleted : ReportState::kPending; |
710 } | 710 } |
| 711 |
| 712 // Call Settings::SetLastUploadAttemptTime(). |
| 713 // https://code.google.com/p/crashpad/issues/detail?id=13. |
| 714 |
711 return os; | 715 return os; |
712 } | 716 } |
713 | 717 |
714 OperationStatus CrashReportDatabaseWin::SkipReportUpload(const UUID& uuid) { | 718 OperationStatus CrashReportDatabaseWin::SkipReportUpload(const UUID& uuid) { |
715 scoped_ptr<Metadata> metadata(AcquireMetadata()); | 719 scoped_ptr<Metadata> metadata(AcquireMetadata()); |
716 if (!metadata) | 720 if (!metadata) |
717 return kDatabaseError; | 721 return kDatabaseError; |
718 ReportDisk* report_disk; | 722 ReportDisk* report_disk; |
719 OperationStatus os = metadata->FindSingleReportAndMarkDirty( | 723 OperationStatus os = metadata->FindSingleReportAndMarkDirty( |
720 uuid, ReportState::kPending, &report_disk); | 724 uuid, ReportState::kPending, &report_disk); |
(...skipping 12 matching lines...) Expand all Loading... |
733 // static | 737 // static |
734 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize( | 738 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize( |
735 const base::FilePath& path) { | 739 const base::FilePath& path) { |
736 scoped_ptr<CrashReportDatabaseWin> database_win( | 740 scoped_ptr<CrashReportDatabaseWin> database_win( |
737 new CrashReportDatabaseWin(path.Append(kDatabaseDirectoryName))); | 741 new CrashReportDatabaseWin(path.Append(kDatabaseDirectoryName))); |
738 return database_win->Initialize() ? database_win.Pass() | 742 return database_win->Initialize() ? database_win.Pass() |
739 : scoped_ptr<CrashReportDatabaseWin>(); | 743 : scoped_ptr<CrashReportDatabaseWin>(); |
740 } | 744 } |
741 | 745 |
742 } // namespace crashpad | 746 } // namespace crashpad |
OLD | NEW |