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

Unified Diff: chromeos/dbus/debug_daemon_client.cc

Issue 2944403002: Add GetLog method call to DebugDaemonClient (Closed)
Patch Set: Use separate callback type with string parameter Created 3 years, 6 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/fake_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 955e26a5a3e003598aeb3fcd438f25d95628a54b..badae1fb970bc79006787aba4973e84e86cf83a1 100644
--- a/chromeos/dbus/debug_daemon_client.cc
+++ b/chromeos/dbus/debug_daemon_client.cc
@@ -281,6 +281,16 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
callback));
}
+ void GetLog(const std::string& log_name,
+ const GetLogCallback& callback) override {
+ dbus::MethodCall method_call(debugd::kDebugdInterface, debugd::kGetLog);
+ dbus::MessageWriter(&method_call).AppendString(log_name);
+ debugdaemon_proxy_->CallMethod(
+ &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::Bind(&DebugDaemonClientImpl::OnGetLog,
+ weak_ptr_factory_.GetWeakPtr(), log_name, callback));
+ }
+
// base::trace_event::TracingAgent implementation.
std::string GetTracingAgentName() override { return kCrOSTracingAgentName; }
@@ -629,6 +639,17 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
return OnGetAllLogs(callback, response);
}
+ void OnGetLog(const std::string& log_name,
+ const GetLogCallback& callback,
+ dbus::Response* response) {
+ std::string result;
+ if (!response || !dbus::MessageReader(response).PopString(&result)) {
+ callback.Run(false, result);
+ return;
+ }
+ callback.Run(true, result);
+ }
+
void OnBigFeedbackLogsResponse(base::WeakPtr<PipeReaderWrapper> pipe_reader,
dbus::Response* response) {
if (!response && pipe_reader.get()) {
« no previous file with comments | « chromeos/dbus/debug_daemon_client.h ('k') | chromeos/dbus/fake_debug_daemon_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698