Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / system_logs / dbus_log_source.cc
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 "content/public/browser/browser_thread.h"
8 #include "dbus/dbus_statistics.h"
9
10 const char kDBusLogEntryShort[] = "dbus_summary";
11 const char kDBusLogEntryLong[] = "dbus_details";
12
13 namespace system_logs {
14
15 DBusLogSource::DBusLogSource() : SystemLogsSource("DBus") {
16 }
17
18 DBusLogSource::~DBusLogSource() {
19 }
20
21 void DBusLogSource::Fetch(const SysLogsSourceCallback& callback) {
22   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
23   DCHECK(!callback.is_null());
24
25   SystemLogsResponse response;
26   response[kDBusLogEntryShort] = dbus::statistics::GetAsString(
27       dbus::statistics::SHOW_INTERFACE,
28       dbus::statistics::FORMAT_ALL);
29   response[kDBusLogEntryLong] = dbus::statistics::GetAsString(
30       dbus::statistics::SHOW_METHOD,
31       dbus::statistics::FORMAT_TOTALS);
32   callback.Run(&response);
33 }
34
35 }  // namespace system_logs