OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/system_logs/dbus_log_source.h" | 5 #include "chrome/browser/chromeos/system_logs/dbus_log_source.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/system_logs/system_logs_fetcher.h" | |
8 #include "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
9 #include "dbus/dbus_statistics.h" | 8 #include "dbus/dbus_statistics.h" |
10 | 9 |
11 const char kDBusLogEntryShort[] = "dbus_summary"; | 10 const char kDBusLogEntryShort[] = "dbus_summary"; |
12 const char kDBusLogEntryLong[] = "dbus_details"; | 11 const char kDBusLogEntryLong[] = "dbus_details"; |
13 | 12 |
14 namespace chromeos { | 13 namespace chromeos { |
15 | 14 |
16 void DBusLogSource::Fetch(const SysLogsSourceCallback& callback) { | 15 void DBusLogSource::Fetch(const SysLogsSourceCallback& callback) { |
17 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 16 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
18 DCHECK(!callback.is_null()); | 17 DCHECK(!callback.is_null()); |
19 | 18 |
20 SystemLogsResponse response; | 19 SystemLogsResponse response; |
21 response[kDBusLogEntryShort] = dbus::statistics::GetAsString( | 20 response[kDBusLogEntryShort] = dbus::statistics::GetAsString( |
22 dbus::statistics::SHOW_INTERFACE, | 21 dbus::statistics::SHOW_INTERFACE, |
23 dbus::statistics::FORMAT_ALL); | 22 dbus::statistics::FORMAT_ALL); |
24 response[kDBusLogEntryLong] = dbus::statistics::GetAsString( | 23 response[kDBusLogEntryLong] = dbus::statistics::GetAsString( |
25 dbus::statistics::SHOW_METHOD, | 24 dbus::statistics::SHOW_METHOD, |
26 dbus::statistics::FORMAT_TOTALS); | 25 dbus::statistics::FORMAT_TOTALS); |
27 callback.Run(&response); | 26 callback.Run(&response); |
28 } | 27 } |
29 | 28 |
30 } // namespace chromeos | 29 } // namespace chromeos |
OLD | NEW |