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_CHROMEOS_SYSTEM_LOGS_SINGLE_DEBUG_DAEMON_LOG_SOURCE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_SINGLE_DEBUG_DAEMON_LOG_SOURCE_H_ |
| 7 |
| 8 #include <stddef.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" |
| 12 |
| 13 namespace system_logs { |
| 14 |
| 15 // Gathers log data from a single debugd log source, via DebugDaemonClient. |
| 16 class SingleDebugDaemonLogSource : public SystemLogsSource { |
| 17 public: |
| 18 enum class SupportedSource { |
| 19 // For "modetest" command. |
| 20 kModetest, |
| 21 |
| 22 // For "lsusb" command. |
| 23 kLsusb, |
| 24 }; |
| 25 |
| 26 explicit SingleDebugDaemonLogSource(SupportedSource source); |
| 27 ~SingleDebugDaemonLogSource() override; |
| 28 |
| 29 // system_logs::SystemLogsSource: |
| 30 void Fetch(const SysLogsSourceCallback& callback) override; |
| 31 |
| 32 private: |
| 33 // Callback for handling response from DebugDaemonClient. |
| 34 void OnFetchComplete(const std::string& log_name, |
| 35 const SysLogsSourceCallback& callback, |
| 36 bool success, |
| 37 const std::string& result) const; |
| 38 |
| 39 base::WeakPtrFactory<SingleDebugDaemonLogSource> weak_ptr_factory_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(SingleDebugDaemonLogSource); |
| 42 }; |
| 43 |
| 44 } // namespace system_logs |
| 45 |
| 46 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_SINGLE_DEBUG_DAEMON_LOG_SOURCE_H_ |
OLD | NEW |