Chromium Code Reviews| 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" | 7 #include "chrome/browser/chromeos/system_logs/system_logs_fetcher.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "dbus/dbus_statistics.h" | 9 #include "dbus/dbus_statistics.h" |
| 10 | 10 |
| 11 namespace chromeos { | 11 namespace chromeos { |
| 12 | 12 |
| 13 namespace { | |
|
xiyuan
2013/03/18 23:55:52
Why removing this? Are the constants below needed
rkc
2013/03/19 00:09:02
const char[] has internal linkage, so the anonymou
xiyuan
2013/03/19 02:14:48
True.
But removing the namespace makes it easier
rkc
2013/03/19 19:58:59
I'll come over and discuss this with you, I feel a
| |
| 14 const char kDBusLogEntryShort[] = "dbus_summary"; | 13 const char kDBusLogEntryShort[] = "dbus_summary"; |
| 15 const char kDBusLogEntryLong[] = "dbus_details"; | 14 const char kDBusLogEntryLong[] = "dbus_details"; |
| 16 } | |
| 17 | 15 |
| 18 void DBusLogSource::Fetch(const SysLogsSourceCallback& callback) { | 16 void DBusLogSource::Fetch(const SysLogsSourceCallback& callback) { |
| 19 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 17 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 20 DCHECK(!callback.is_null()); | 18 DCHECK(!callback.is_null()); |
| 21 | 19 |
| 22 SystemLogsResponse response; | 20 SystemLogsResponse response; |
| 23 response[kDBusLogEntryShort] = dbus::statistics::GetAsString( | 21 response[kDBusLogEntryShort] = dbus::statistics::GetAsString( |
| 24 dbus::statistics::SHOW_INTERFACE, | 22 dbus::statistics::SHOW_INTERFACE, |
| 25 dbus::statistics::FORMAT_ALL); | 23 dbus::statistics::FORMAT_ALL); |
| 26 response[kDBusLogEntryLong] = dbus::statistics::GetAsString( | 24 response[kDBusLogEntryLong] = dbus::statistics::GetAsString( |
| 27 dbus::statistics::SHOW_METHOD, | 25 dbus::statistics::SHOW_METHOD, |
| 28 dbus::statistics::FORMAT_TOTALS); | 26 dbus::statistics::FORMAT_TOTALS); |
| 29 callback.Run(&response); | 27 callback.Run(&response); |
| 30 } | 28 } |
| 31 | 29 |
| 32 } // namespace chromeos | 30 } // namespace chromeos |
| OLD | NEW |