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

Unified Diff: chromeos/dbus/debug_daemon_client.cc

Issue 2944403002: Add GetLog method call to DebugDaemonClient (Closed)
Patch Set: Return success=true in FakeDebugDaemonClient::GetLog() 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..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()) {
« 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