Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: chrome/browser/chromeos/system_logs/dbus_log_source.cc

Issue 11363173: Add DBusStatistics and DBusLogSource to log and show dbus stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5520bd72e1a52a3cf5f2f2ca807ae4c59ed75a71
--- /dev/null
+++ b/chrome/browser/chromeos/system_logs/dbus_log_source.cc
@@ -0,0 +1,34 @@
+// 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 "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.
+#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/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
+
+void DbusLogSource::Fetch(const SysLogsSourceCallback& callback) {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK(!callback.is_null());
+
+ 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
+ const bool show_per_minute = true;
+ (*response)[kDbusLogEntryShort] =
+ dbus::DbusStatistics::GetAsString(
+ dbus::DbusStatistics::SHOW_INTERFACE, show_per_minute);
+ (*response)[kDbusLogEntryLong] =
+ dbus::DbusStatistics::GetAsString(
+ dbus::DbusStatistics::SHOW_METHOD, !show_per_minute);
+ callback.Run(response.get());
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698