Index: chromeos/dbus/debug_daemon_client.cc |
diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc |
index bc8e06dc71bb46f8e18cfd5afb05bf0aa8f0cade..1426abd0fdc27eb565ea6fda20613e232b9a92f2 100644 |
--- a/chromeos/dbus/debug_daemon_client.cc |
+++ b/chromeos/dbus/debug_daemon_client.cc |
@@ -150,6 +150,20 @@ class DebugDaemonClientImpl : public DebugDaemonClient { |
virtual ~DebugDaemonClientImpl() {} |
// DebugDaemonClient override. |
+ virtual void SetDebugMode(const std::string& subsystem, |
+ const SetDebugModeCallback& callback) OVERRIDE { |
+ dbus::MethodCall method_call(debugd::kDebugdInterface, |
+ debugd::kSetDebugMode); |
+ dbus::MessageWriter writer(&method_call); |
+ writer.AppendString(subsystem); |
+ debugdaemon_proxy_->CallMethod( |
+ &method_call, |
+ dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
+ base::Bind(&DebugDaemonClientImpl::OnSetDebugMode, |
+ weak_ptr_factory_.GetWeakPtr(), |
+ callback)); |
+ } |
+ |
virtual void StartSystemTracing() OVERRIDE { |
dbus::MethodCall method_call( |
debugd::kDebugdInterface, |
@@ -209,6 +223,17 @@ class DebugDaemonClientImpl : public DebugDaemonClient { |
} |
private: |
+ // Called when a response for SetDebugMode() is received. |
+ void OnSetDebugMode(const SetDebugModeCallback& callback, |
+ dbus::Response* response) { |
+ if (!response) { |
+ LOG(ERROR) << "Failed to change debug mode"; |
+ callback.Run(false); |
+ } else { |
+ callback.Run(true); |
+ } |
+ } |
+ |
// Called when a response for StartSystemTracing() is received. |
void OnStartSystemTracing(dbus::Response* response) { |
if (!response) { |
@@ -244,6 +269,10 @@ class DebugDaemonClientImpl : public DebugDaemonClient { |
// which does nothing. |
class DebugDaemonClientStubImpl : public DebugDaemonClient { |
// DebugDaemonClient overrides. |
+ virtual void SetDebugMode(const std::string& subsystem, |
+ const SetDebugModeCallback& callback) OVERRIDE { |
+ callback.Run(false); |
+ } |
virtual void StartSystemTracing() OVERRIDE {} |
virtual bool RequestStopSystemTracing(const StopSystemTracingCallback& |
callback) OVERRIDE { |