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

Side by Side Diff: client/crash_report_database_win.cc

Issue 988063003: Define the Settings interface for a CrashReportDatabase and provide a Mac implementation. (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: For landing 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_mac.mm ('k') | client/settings.h » ('j') | 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « client/crash_report_database_mac.mm ('k') | client/settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698