Chromium Code Reviews| 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..35842a83b991b35d38c3ae2ea9a7ebb2512a4332 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 GetLogsCallback& 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,19 @@ class DebugDaemonClientImpl : public DebugDaemonClient { |
| return OnGetAllLogs(callback, response); |
| } |
| + void OnGetLog(const std::string& log_name, |
| + const GetLogsCallback& callback, |
| + dbus::Response* response) { |
| + std::map<std::string, std::string> result; |
| + std::string result_string; |
| + if (!response || !dbus::MessageReader(response).PopString(&result_string)) { |
| + callback.Run(false, result); |
| + return; |
| + } |
| + result[log_name] = result_string; |
|
Daniel Erat
2017/06/23 01:04:27
returning a single-entry map feels a bit hacky. wo
Simon Que
2017/06/23 01:15:10
Done.
|
| + callback.Run(true, result); |
| + } |
| + |
| void OnBigFeedbackLogsResponse(base::WeakPtr<PipeReaderWrapper> pipe_reader, |
| dbus::Response* response) { |
| if (!response && pipe_reader.get()) { |