OLD | NEW |
| (Empty) |
1 // Copyright 2017 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_SYSTEM_LOGS_SOURCE_H_ | |
6 #define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_SYSTEM_LOGS_SOURCE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback.h" | |
11 #include "components/feedback/feedback_common.h" | |
12 | |
13 namespace system_logs { | |
14 | |
15 using SystemLogsResponse = FeedbackCommon::SystemLogsMap; | |
16 | |
17 // Callback that the data sources use to return data. | |
18 using SysLogsSourceCallback = base::Callback<void(SystemLogsResponse*)>; | |
19 | |
20 // The SystemLogsSource provides an interface for the data sources that | |
21 // the SystemLogsFetcher class uses to fetch logs and other information. | |
22 class SystemLogsSource { | |
23 public: | |
24 // |source_name| provides a descriptive identifier for debugging. | |
25 explicit SystemLogsSource(const std::string& source_name); | |
26 virtual ~SystemLogsSource(); | |
27 | |
28 // Fetches data and passes it by pointer to the callback | |
29 virtual void Fetch(const SysLogsSourceCallback& callback) = 0; | |
30 | |
31 const std::string& source_name() const { return source_name_; } | |
32 | |
33 private: | |
34 std::string source_name_; | |
35 }; | |
36 | |
37 } // namespace system_logs | |
38 | |
39 #endif // CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_SYSTEM_LOGS_SOURCE_H_ | |
OLD | NEW |