Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: client/crash_report_database_win.cc

Issue 995853003: CrashReportDatabse: set the last upload attempt time from RecordUploadAttempt() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Windows Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « client/crash_report_database_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « client/crash_report_database_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698