Index: chrome/browser/chromeos/system_logs/dbus_log_source.cc |
diff --git a/chrome/browser/chromeos/system_logs/dbus_log_source.cc b/chrome/browser/chromeos/system_logs/dbus_log_source.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a9023b4a33e381d895f8285bb272efcd7060eff5 |
--- /dev/null |
+++ b/chrome/browser/chromeos/system_logs/dbus_log_source.cc |
@@ -0,0 +1,32 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/chromeos/system_logs/dbus_log_source.h" |
+ |
+#include "chrome/browser/chromeos/system_logs/system_logs_fetcher.h" |
+#include "content/public/browser/browser_thread.h" |
+#include "dbus/dbus_statistics.h" |
+ |
+namespace chromeos { |
+ |
+namespace { |
+const char kDbusLogEntryShort[] = "dbus_summary"; |
+const char kDbusLogEntryLong[] = "dbus_details"; |
hashimoto
2012/11/13 06:11:44
nit: s/Dbus/DBus/
stevenjb
2012/11/13 19:54:15
Done.
|
+} |
+ |
+void DbusLogSource::Fetch(const SysLogsSourceCallback& callback) { |
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
+ DCHECK(!callback.is_null()); |
+ |
+ SystemLogsResponse response; |
+ response[kDbusLogEntryShort] = dbus::statistics::GetAsString( |
+ dbus::statistics::SHOW_INTERFACE, |
+ dbus::statistics::FORMAT_ALL); |
+ response[kDbusLogEntryLong] = dbus::statistics::GetAsString( |
+ dbus::statistics::SHOW_METHOD, |
+ dbus::statistics::FORMAT_TOTALS); |
+ callback.Run(&response); |
+} |
+ |
+} // namespace chromeos |