OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Following an unclean shutdown, a stability report can be collected and | 5 // Following an unclean shutdown, a stability report can be collected and |
6 // submitted for upload to a reporter. | 6 // submitted for upload to a reporter. |
7 | 7 |
8 #ifndef COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_COLLECTOR_H_ | 8 #ifndef COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_COLLECTOR_H_ |
9 #define COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_COLLECTOR_H_ | 9 #define COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_COLLECTOR_H_ |
10 | 10 |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 | 12 |
13 #include <memory> | 13 #include <memory> |
14 #include <set> | 14 #include <set> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
| 18 #include "base/debug/activity_tracker.h" |
18 #include "base/files/file.h" | 19 #include "base/files/file.h" |
19 #include "base/files/file_path.h" | 20 #include "base/files/file_path.h" |
20 #include "base/gtest_prod_util.h" | 21 #include "base/gtest_prod_util.h" |
21 #include "base/macros.h" | 22 #include "base/macros.h" |
22 #include "base/strings/string16.h" | 23 #include "base/strings/string16.h" |
23 #include "components/browser_watcher/stability_report.pb.h" | 24 #include "components/browser_watcher/stability_report.pb.h" |
24 #include "third_party/crashpad/crashpad/client/crash_report_database.h" | 25 #include "third_party/crashpad/crashpad/client/crash_report_database.h" |
25 | 26 |
26 namespace browser_watcher { | 27 namespace browser_watcher { |
27 | 28 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 81 |
81 CollectionStatus CollectAndSubmit( | 82 CollectionStatus CollectAndSubmit( |
82 const crashpad::UUID& client_id, | 83 const crashpad::UUID& client_id, |
83 const base::FilePath& file, | 84 const base::FilePath& file, |
84 crashpad::CrashReportDatabase* report_database); | 85 crashpad::CrashReportDatabase* report_database); |
85 | 86 |
86 // Virtual for unittesting. | 87 // Virtual for unittesting. |
87 // TODO(manzagop): move this for reuse in live scenario. | 88 // TODO(manzagop): move this for reuse in live scenario. |
88 virtual CollectionStatus Collect(const base::FilePath& debug_state_file, | 89 virtual CollectionStatus Collect(const base::FilePath& debug_state_file, |
89 std::unique_ptr<StabilityReport>* report); | 90 std::unique_ptr<StabilityReport>* report); |
| 91 void CollectThread(const base::debug::ActivitySnapshot& snapshot, |
| 92 ThreadState* thread_state); |
90 | 93 |
91 virtual bool WriteReportToMinidump(const StabilityReport& report, | 94 virtual bool WriteReportToMinidump(const StabilityReport& report, |
92 const crashpad::UUID& client_id, | 95 const crashpad::UUID& client_id, |
93 const crashpad::UUID& report_id, | 96 const crashpad::UUID& report_id, |
94 base::PlatformFile minidump_file); | 97 base::PlatformFile minidump_file); |
95 | 98 |
96 std::string product_name_; | 99 std::string product_name_; |
97 std::string version_number_; | 100 std::string version_number_; |
98 std::string channel_name_; | 101 std::string channel_name_; |
99 | 102 |
100 DISALLOW_COPY_AND_ASSIGN(PostmortemReportCollector); | 103 DISALLOW_COPY_AND_ASSIGN(PostmortemReportCollector); |
101 }; | 104 }; |
102 | 105 |
103 } // namespace browser_watcher | 106 } // namespace browser_watcher |
104 | 107 |
105 #endif // COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_COLLECTOR_H_ | 108 #endif // COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_COLLECTOR_H_ |
OLD | NEW |