| 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> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 9 #include "base/files/file.h" | 11 #include "base/files/file.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
| 11 #include "base/task_runner.h" | 13 #include "base/task_runner.h" |
| 12 #include "chromeos/chromeos_export.h" | 14 #include "chromeos/chromeos_export.h" |
| 13 #include "chromeos/dbus/dbus_client.h" | 15 #include "chromeos/dbus/dbus_client.h" |
| 14 | 16 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 15 #include <map> | |
| 16 | 17 |
| 17 namespace metrics { | 18 namespace metrics { |
| 18 class PerfDataProto; | 19 class PerfDataProto; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace chromeos { | 22 namespace chromeos { |
| 22 | 23 |
| 23 // DebugDaemonClient is used to communicate with the debug daemon. | 24 // DebugDaemonClient is used to communicate with the debug daemon. |
| 24 class CHROMEOS_EXPORT DebugDaemonClient : public DBusClient { | 25 class CHROMEOS_EXPORT DebugDaemonClient : public DBusClient { |
| 25 public: | 26 public: |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Called once EnableDebuggingFeatures() is complete. |succeeded| will be true | 149 // Called once EnableDebuggingFeatures() is complete. |succeeded| will be true |
| 149 // if debugging features have been successfully enabled. | 150 // if debugging features have been successfully enabled. |
| 150 typedef base::Callback<void(bool succeeded)> EnableDebuggingCallback; | 151 typedef base::Callback<void(bool succeeded)> EnableDebuggingCallback; |
| 151 | 152 |
| 152 // Enables debugging features (sshd, boot from USB). |password| is a new | 153 // Enables debugging features (sshd, boot from USB). |password| is a new |
| 153 // password for root user. Can be only called in dev mode. | 154 // password for root user. Can be only called in dev mode. |
| 154 virtual void EnableDebuggingFeatures( | 155 virtual void EnableDebuggingFeatures( |
| 155 const std::string& password, | 156 const std::string& password, |
| 156 const EnableDebuggingCallback& callback) = 0; | 157 const EnableDebuggingCallback& callback) = 0; |
| 157 | 158 |
| 158 enum DebuggingFeature { | 159 static const int DEV_FEATURE_NONE = 0; |
| 159 DEV_FEATURE_NONE = 0, | 160 static const int DEV_FEATURE_ALL_ENABLED = |
| 160 DEV_FEATURES_DISABLED = 1 << 0, | 161 debugd::DevFeatureFlag::DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED | |
| 161 DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED = 1 << 1, | 162 debugd::DevFeatureFlag::DEV_FEATURE_BOOT_FROM_USB_ENABLED | |
| 162 DEV_FEATURE_BOOT_FROM_USB_ENABLED = 1 << 2, | 163 debugd::DevFeatureFlag::DEV_FEATURE_SSH_SERVER_CONFIGURED | |
| 163 DEV_FEATURE_SSH_SERVER_CONFIGURED = 1 << 3, | 164 debugd::DevFeatureFlag::DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET; |
| 164 DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET = 1 << 4, | |
| 165 DEV_FEATURE_SYSTEM_ROOT_PASSWORD_SET = 1 << 5, | |
| 166 DEV_FEATURE_ALL_ENABLED = | |
| 167 DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED | | |
| 168 DEV_FEATURE_BOOT_FROM_USB_ENABLED | | |
| 169 DEV_FEATURE_SSH_SERVER_CONFIGURED | | |
| 170 DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET | | |
| 171 DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET, | |
| 172 }; | |
| 173 | 165 |
| 174 // Called once QueryDebuggingFeatures() is complete. |succeeded| will be true | 166 // Called once QueryDebuggingFeatures() is complete. |succeeded| will be true |
| 175 // if debugging features have been successfully enabled. |feature_mask| is a | 167 // if debugging features have been successfully enabled. |feature_mask| is a |
| 176 // bitmask made out of DebuggingFeature enum values. | 168 // bitmask made out of DebuggingFeature enum values. |
| 177 typedef base::Callback<void(bool succeeded, | 169 typedef base::Callback<void(bool succeeded, |
| 178 int feature_mask)> QueryDevFeaturesCallback; | 170 int feature_mask)> QueryDevFeaturesCallback; |
| 179 // Checks which debugging features have been already enabled. | 171 // Checks which debugging features have been already enabled. |
| 180 virtual void QueryDebuggingFeatures( | 172 virtual void QueryDebuggingFeatures( |
| 181 const QueryDevFeaturesCallback& callback) = 0; | 173 const QueryDevFeaturesCallback& callback) = 0; |
| 182 | 174 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 204 // Create() should be used instead. | 196 // Create() should be used instead. |
| 205 DebugDaemonClient(); | 197 DebugDaemonClient(); |
| 206 | 198 |
| 207 private: | 199 private: |
| 208 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); | 200 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); |
| 209 }; | 201 }; |
| 210 | 202 |
| 211 } // namespace chromeos | 203 } // namespace chromeos |
| 212 | 204 |
| 213 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 205 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
| OLD | NEW |