Index: chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.h |
diff --git a/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.h b/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..adc3b1367c044782095e0de870182e18a3de29f5 |
--- /dev/null |
+++ b/chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_SINGLE_DEBUG_DAEMON_LOG_SOURCE_H_ |
+#define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_SINGLE_DEBUG_DAEMON_LOG_SOURCE_H_ |
+ |
+#include <stddef.h> |
+ |
+#include "base/macros.h" |
+#include "chrome/browser/feedback/system_logs/system_logs_fetcher.h" |
+ |
+namespace system_logs { |
+ |
+// Gathers log data from a single debugd log source, via DebugDaemonClient. |
+class SingleDebugDaemonLogSource : public SystemLogsSource { |
+ public: |
+ enum class SupportedSource { |
+ // For "modetest" command. |
+ kModetest, |
+ |
+ // For "lsusb" command. |
+ kLsusb, |
+ }; |
+ |
+ explicit SingleDebugDaemonLogSource(SupportedSource source); |
+ ~SingleDebugDaemonLogSource() override; |
+ |
+ // system_logs::SystemLogsSource: |
+ void Fetch(const SysLogsSourceCallback& callback) override; |
+ |
+ private: |
+ // Callback for handling response from DebugDaemonClient. |
+ void OnFetchComplete(const std::string& log_name, |
+ const SysLogsSourceCallback& callback, |
+ bool success, |
+ const std::string& result) const; |
+ |
+ base::WeakPtrFactory<SingleDebugDaemonLogSource> weak_ptr_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SingleDebugDaemonLogSource); |
+}; |
+ |
+} // namespace system_logs |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_SINGLE_DEBUG_DAEMON_LOG_SOURCE_H_ |