OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_CRASH_IDS_SOURCE_H_ | |
6 #define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_CRASH_IDS_SOURCE_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/callback_forward.h" | |
11 #include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" | |
12 #include "components/upload_list/crash_upload_list.h" | |
13 #include "components/upload_list/upload_list.h" | |
14 | |
15 namespace system_logs { | |
16 | |
17 // Extract the most recent crash IDs (if any) and adds them to the system logs. | |
18 class CrashIdsSource : public SystemLogsSource, public UploadList::Delegate { | |
19 public: | |
20 CrashIdsSource(); | |
21 ~CrashIdsSource() override; | |
22 | |
23 // SystemLogsSource: | |
24 void Fetch(const SysLogsSourceCallback& callback) override; | |
25 | |
26 // UploadList::Delegate: | |
27 void OnUploadListAvailable() override; | |
28 | |
29 private: | |
30 void RespondWithCrashIds(const SysLogsSourceCallback& callback) const; | |
31 | |
32 scoped_refptr<CrashUploadList> crash_upload_list_; | |
33 | |
34 // A comma-separated list of crash IDs as expected by the server. | |
35 std::string crash_ids_list_; | |
36 | |
37 // Contains any pending fetch requests waiting for the crash upload list to | |
38 // finish loading. | |
39 using Requests = base::Closure; | |
Rahul Chaturvedi
2016/09/08 19:58:24
This seems, not very useful. base::Closure is bare
afakhry
2016/09/09 22:20:10
Makes sense ... Done.
| |
40 std::vector<Requests> pending_requests_; | |
41 | |
42 // True if the crash list is currently being loaded. | |
43 bool pending_crash_list_loading_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(CrashIdsSource); | |
46 }; | |
47 | |
48 } // namespace system_logs | |
49 | |
50 #endif // CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_CRASH_IDS_SOURCE_H_ | |
OLD | NEW |