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

Unified Diff: chromeos/dbus/debug_daemon_client.cc

Issue 10024056: Added functionality to chrome://net-internals/#chromeos page that user (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Sync. Created 8 years, 8 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
« no previous file with comments | « chromeos/dbus/debug_daemon_client.h ('k') | chromeos/dbus/mock_debug_daemon_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/debug_daemon_client.cc
diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc
index ea0a0faaa80af6107f89ae3ee8e22d52661db591..311ad582b3fe46718d522669ad6466db7995015a 100644
--- a/chromeos/dbus/debug_daemon_client.cc
+++ b/chromeos/dbus/debug_daemon_client.cc
@@ -167,6 +167,20 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
callback));
}
+ 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,
@@ -226,6 +240,7 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
}
private:
+ // Called when a response for GetDebugLogs() is received.
void OnGetDebugLogs(const GetDebugLogsCallback& callback,
dbus::Response* response) {
if (!response) {
@@ -236,6 +251,17 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
callback.Run(true);
}
+ // 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) {
@@ -275,6 +301,10 @@ class DebugDaemonClientStubImpl : public DebugDaemonClient {
const GetDebugLogsCallback& callback) OVERRIDE {
callback.Run(false);
}
+ 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 {
« no previous file with comments | « chromeos/dbus/debug_daemon_client.h ('k') | chromeos/dbus/mock_debug_daemon_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698