Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(992)

Unified Diff: chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.h

Issue 2955463002: Add log source to read from one DebugDaemon log (Closed)
Patch Set: Rebased: updated to latest DebugDaemonClient; Browser thread bundle Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/system_logs/single_debug_daemon_log_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698