Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/system_logs/dbus_log_source.h" | |
| 6 | |
| 7 #include "base/message_loop.h" | |
|
hashimoto
2012/11/12 04:33:16
nit: No need to include this.
stevenjb
2012/11/12 19:46:40
Done.
| |
| 8 #include "chrome/browser/chromeos/system_logs/system_logs_fetcher.h" | |
| 9 #include "content/public/browser/browser_thread.h" | |
| 10 #include "dbus/dbus_statistics.h" | |
| 11 | |
| 12 namespace chromeos { | |
| 13 | |
| 14 namespace { | |
| 15 const char kDbusLogEntryShort[] = "dbus_summary"; | |
| 16 const char kDbusLogEntryLong[] = "dbus_details"; | |
| 17 } | |
|
hashimoto
2012/11/12 04:33:16
nit: Add commenct "// namespace"
stevenjb
2012/11/12 19:46:40
We usually don't bother when it's within a few lin
| |
| 18 | |
| 19 void DbusLogSource::Fetch(const SysLogsSourceCallback& callback) { | |
| 20 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | |
| 21 DCHECK(!callback.is_null()); | |
| 22 | |
| 23 scoped_ptr<SystemLogsResponse> response(new SystemLogsResponse); | |
|
hashimoto
2012/11/12 04:33:16
Why do you store this object in scoped_ptr?
Doesn'
stevenjb
2012/11/12 19:46:40
Yes actually, it looks like it can. The code that
| |
| 24 const bool show_per_minute = true; | |
| 25 (*response)[kDbusLogEntryShort] = | |
| 26 dbus::DbusStatistics::GetAsString( | |
| 27 dbus::DbusStatistics::SHOW_INTERFACE, show_per_minute); | |
| 28 (*response)[kDbusLogEntryLong] = | |
| 29 dbus::DbusStatistics::GetAsString( | |
| 30 dbus::DbusStatistics::SHOW_METHOD, !show_per_minute); | |
| 31 callback.Run(response.get()); | |
| 32 } | |
| 33 | |
| 34 } // namespace chromeos | |
| OLD | NEW |