| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 6 #define CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
| 12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
| 13 #include "base/task_runner.h" | 13 #include "base/task_runner.h" |
| 14 #include "base/trace_event/tracing_agent.h" |
| 14 #include "chromeos/chromeos_export.h" | 15 #include "chromeos/chromeos_export.h" |
| 15 #include "chromeos/dbus/dbus_client.h" | 16 #include "chromeos/dbus/dbus_client.h" |
| 16 #include "third_party/cros_system_api/dbus/service_constants.h" | 17 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 17 | 18 |
| 18 namespace chromeos { | 19 namespace chromeos { |
| 19 | 20 |
| 20 // DebugDaemonClient is used to communicate with the debug daemon. | 21 // DebugDaemonClient is used to communicate with the debug daemon. |
| 21 class CHROMEOS_EXPORT DebugDaemonClient : public DBusClient { | 22 class CHROMEOS_EXPORT DebugDaemonClient |
| 23 : public DBusClient, |
| 24 public base::trace_event::TracingAgent { |
| 22 public: | 25 public: |
| 23 ~DebugDaemonClient() override; | 26 ~DebugDaemonClient() override; |
| 24 | 27 |
| 25 // Called once GetDebugLogs() is complete. Takes one parameter: | 28 // Called once GetDebugLogs() is complete. Takes one parameter: |
| 26 // - succeeded: was the logs stored successfully. | 29 // - succeeded: was the logs stored successfully. |
| 27 typedef base::Callback<void(bool succeeded)> GetDebugLogsCallback; | 30 typedef base::Callback<void(bool succeeded)> GetDebugLogsCallback; |
| 28 | 31 |
| 29 // Requests to store debug logs into |file| and calls |callback| | 32 // Requests to store debug logs into |file| and calls |callback| |
| 30 // when completed. Debug logs will be stored in the .tgz if | 33 // when completed. Debug logs will be stored in the .tgz if |
| 31 // |is_compressed| is true, otherwise in logs will be stored in .tar format. | 34 // |is_compressed| is true, otherwise in logs will be stored in .tar format. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 109 |
| 107 // Gets scrubbed logs from debugd. | 110 // Gets scrubbed logs from debugd. |
| 108 virtual void GetScrubbedLogs(const GetLogsCallback& callback) = 0; | 111 virtual void GetScrubbedLogs(const GetLogsCallback& callback) = 0; |
| 109 | 112 |
| 110 // Gets all logs collected by debugd. | 113 // Gets all logs collected by debugd. |
| 111 virtual void GetAllLogs(const GetLogsCallback& callback) = 0; | 114 virtual void GetAllLogs(const GetLogsCallback& callback) = 0; |
| 112 | 115 |
| 113 // Gets list of user log files that must be read by Chrome. | 116 // Gets list of user log files that must be read by Chrome. |
| 114 virtual void GetUserLogFiles(const GetLogsCallback& callback) = 0; | 117 virtual void GetUserLogFiles(const GetLogsCallback& callback) = 0; |
| 115 | 118 |
| 116 // Requests to start system/kernel tracing. | 119 virtual void SetStopAgentTracingTaskRunner( |
| 117 virtual void StartSystemTracing() = 0; | 120 scoped_refptr<base::TaskRunner> task_runner) = 0; |
| 118 | 121 |
| 119 // Called once RequestStopSystemTracing() is complete. Takes one parameter: | 122 // Returns an empty StopAgentTracingCallback that does nothing. |
| 120 // - result: the data collected while tracing was active | 123 static StopAgentTracingCallback EmptyStopAgentTracingCallback(); |
| 121 typedef base::Callback<void(const scoped_refptr<base::RefCountedString>& | |
| 122 result)> StopSystemTracingCallback; | |
| 123 | |
| 124 // Requests to stop system tracing and calls |callback| when completed. | |
| 125 virtual bool RequestStopSystemTracing( | |
| 126 scoped_refptr<base::TaskRunner> task_runner, | |
| 127 const StopSystemTracingCallback& callback) = 0; | |
| 128 | |
| 129 // Returns an empty SystemTracingCallback that does nothing. | |
| 130 static StopSystemTracingCallback EmptyStopSystemTracingCallback(); | |
| 131 | 124 |
| 132 // Called once TestICMP() is complete. Takes two parameters: | 125 // Called once TestICMP() is complete. Takes two parameters: |
| 133 // - succeeded: information was obtained successfully. | 126 // - succeeded: information was obtained successfully. |
| 134 // - status: information about ICMP connectivity to a specified host as json. | 127 // - status: information about ICMP connectivity to a specified host as json. |
| 135 // For details please refer to | 128 // For details please refer to |
| 136 // https://gerrit.chromium.org/gerrit/#/c/30310/2/src/helpers/icmp.cc | 129 // https://gerrit.chromium.org/gerrit/#/c/30310/2/src/helpers/icmp.cc |
| 137 typedef base::Callback<void(bool succeeded, const std::string& status)> | 130 typedef base::Callback<void(bool succeeded, const std::string& status)> |
| 138 TestICMPCallback; | 131 TestICMPCallback; |
| 139 | 132 |
| 140 // Tests ICMP connectivity to a specified host. The |ip_address| contains the | 133 // Tests ICMP connectivity to a specified host. The |ip_address| contains the |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // Create() should be used instead. | 192 // Create() should be used instead. |
| 200 DebugDaemonClient(); | 193 DebugDaemonClient(); |
| 201 | 194 |
| 202 private: | 195 private: |
| 203 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); | 196 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); |
| 204 }; | 197 }; |
| 205 | 198 |
| 206 } // namespace chromeos | 199 } // namespace chromeos |
| 207 | 200 |
| 208 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 201 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
| OLD | NEW |