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

Side by Side Diff: chromeos/dbus/debug_daemon_client.h

Issue 539273002: Added UI to enable debugging features on CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
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 "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 virtual void TestICMP(const std::string& ip_address, 138 virtual void TestICMP(const std::string& ip_address,
139 const TestICMPCallback& callback) = 0; 139 const TestICMPCallback& callback) = 0;
140 140
141 // Tests ICMP connectivity to a specified host. The |ip_address| contains the 141 // Tests ICMP connectivity to a specified host. The |ip_address| contains the
142 // IPv4 or IPv6 address of the host, for example "8.8.8.8". 142 // IPv4 or IPv6 address of the host, for example "8.8.8.8".
143 virtual void TestICMPWithOptions( 143 virtual void TestICMPWithOptions(
144 const std::string& ip_address, 144 const std::string& ip_address,
145 const std::map<std::string, std::string>& options, 145 const std::map<std::string, std::string>& options,
146 const TestICMPCallback& callback) = 0; 146 const TestICMPCallback& callback) = 0;
147 147
148 // Called once EnableDebuggingFeatures() is complete. |succeeded| will be true
149 // if debugging features have been successfully enabled.
150 typedef base::Callback<void(bool succeeded)> EnableDebuggingCallback;
151
152 // Enables debugging features (sshd, boot from USB). |password| is a new
153 // password for root user. Can be only called in dev mode.
154 virtual void EnableDebuggingFeatures(
155 const std::string& password,
156 const EnableDebuggingCallback& callback) = 0;
157
158 enum DebuggingFeature {
159 DEV_FEATURE_NONE = 0x0000,
160 DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED = 0x0001,
161 DEV_FEATURE_BOOT_FROM_USB_ENABLED = 0x0002,
162 DEV_FEATURE_SSH_SERVER_CONFIGURED = 0x0004,
163 DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET = 0x0008,
164 DEV_FEATURE_SYSTEM_ROOT_PASSWORD_SET = 0x0010,
165 DEV_FEATURE_ALL_ENABLED =
166 DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED &
167 DEV_FEATURE_BOOT_FROM_USB_ENABLED &
168 DEV_FEATURE_SSH_SERVER_CONFIGURED &
169 DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET,
dpursell 2014/11/04 19:33:00 You may want DEV_FEATURES_SYSTEM_ROOT_PASSWORD_SET
zel 2014/11/11 01:02:28 Should I then add both DEV_FEATURES_SYSTEM_ROOT_PA
dpursell 2014/11/11 22:53:49 Yeah that would be my recommendation, that way we
zel 2014/11/12 16:04:40 Done.
170 DEV_FEATURES_DISABLED = -1,
171 };
172
173 // Called once QueryDebuggingFeatures() is complete. |succeeded| will be true
174 // if debugging features have been successfully enabled. |feature_mask| is a
175 // bitmask made out of DebuggingFeature enum values.
176 typedef base::Callback<void(bool succeeded,
177 int feature_mask)> QueryDevFeaturesCallback;
178 // Checks which debugging features have been already enabled.
179 virtual void QueryDebuggingFeatures(
180 const QueryDevFeaturesCallback& callback) = 0;
181
182 // Removes rootfs verification from the file system. Can be only called in
183 // dev mode.
184 virtual void RemoveRootfsVerification(
185 const EnableDebuggingCallback& callback) = 0;
186
148 // Trigger uploading of crashes. 187 // Trigger uploading of crashes.
149 virtual void UploadCrashes() = 0; 188 virtual void UploadCrashes() = 0;
150 189
151 // Factory function, creates a new instance and returns ownership. 190 // Factory function, creates a new instance and returns ownership.
152 // For normal usage, access the singleton via DBusThreadManager::Get(). 191 // For normal usage, access the singleton via DBusThreadManager::Get().
153 static DebugDaemonClient* Create(); 192 static DebugDaemonClient* Create();
154 193
155 protected: 194 protected:
156 // Create() should be used instead. 195 // Create() should be used instead.
157 DebugDaemonClient(); 196 DebugDaemonClient();
158 197
159 private: 198 private:
160 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); 199 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient);
161 }; 200 };
162 201
163 } // namespace chromeos 202 } // namespace chromeos
164 203
165 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ 204 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698