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

Unified Diff: chrome/browser/chromeos/system/syslogs_fetcher_factory.cc

Issue 10827130: Refactoring the SysInfoProvider. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 months 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/syslogs_fetcher_factory.cc
diff --git a/chrome/browser/chromeos/system/syslogs_fetcher_factory.cc b/chrome/browser/chromeos/system/syslogs_fetcher_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ce7d3b6a88b5927cd10d783596f63ade95157215
--- /dev/null
+++ b/chrome/browser/chromeos/system/syslogs_fetcher_factory.cc
@@ -0,0 +1,68 @@
+// 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/syslogs_fetcher_factory.h"
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/logging.h"
+#include "base/string_util.h"
+#include "base/memory/singleton.h"
+#include "base/memory/weak_ptr.h"
+#include "base/synchronization/lock.h"
+#include "base/threading/thread.h"
+#include "chrome/browser/chromeos/system/commandline_fetcher.h"
+#include "chrome/browser/chromeos/system/debugd_log_fetcher.h"
+#include "chrome/browser/chromeos/system/memorydetails_fetcher.h"
+#include "chrome/browser/chromeos/system/lsbrelease_fetcher.h"
+#include "content/public/browser/browser_thread.h"
+
+namespace chromeos {
+namespace system {
+
+SysLogsFetcherFactory * SysLogsFetcherFactory::GetInstance() {
rkc1 2012/08/04 01:15:05 Nit: Might be easier to use if you just called thi
tudalex(Chromium) 2012/08/05 01:15:12 If I rename it to something else the Singleton tem
+ return Singleton<SysLogsFetcherFactory>::get();
+}
+
+SysLogsFetcher * SysLogsFetcherFactory::GetFetcher() {
rkc1 2012/08/04 01:15:05 SysLogsFetcher*
rkc1 2012/08/04 01:15:05 Nit: GetFetcher->CreateFetcher
tudalex(Chromium) 2012/08/05 01:15:12 Done.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+ SysLogsDataSources data_sources;
+
+ // Debug Daemon data source
rkc1 2012/08/04 01:15:05 Nit: Missing period, here and below.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+ data_sources.push_back(static_cast <SysLogsInterface*>(
rkc1 2012/08/04 01:15:05 static_cast< Here and below.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+ new DebugDaemonLogFetcher()));
rkc1 2012/08/04 01:15:05 Make sure these get deleted in SyslogFetcher.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+
+ // Chrome data Source
+ data_sources.push_back(static_cast <SysLogsInterface*>(
rkc1 2012/08/04 01:15:05 Try this without the static cast.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+ new CommandLineFetcher("cras",
rkc1 2012/08/04 01:15:05 Merge into one class.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+ "/usr/bin/cras_test_client --dump_server_info"
+ )));
+ data_sources.push_back(static_cast <SysLogsInterface*>(
+ new CommandLineFetcher("env",
+ "set"
+ )));
+ data_sources.push_back(static_cast <SysLogsInterface*>(
+ new CommandLineFetcher("setxkbmap",
+ "/usr/bin/setxkbmap -print -query"
+ )));
+ data_sources.push_back(static_cast <SysLogsInterface*>(
+ new CommandLineFetcher("xrandr",
+ "/usr/bin/xrandr --verbose"
+ )));
+ data_sources.push_back(static_cast <SysLogsInterface*>(
+ new CommandLineFetcher("hack-33025-touchpad",
+ "/opt/google/touchpad/tpcontrol"
+ )));
+ data_sources.push_back(static_cast <SysLogsInterface*>(
+ new CommandLineFetcher("hack-33025-touchpad_activity",
+ "/opt/google/touchpad/generate_userfeedback"
+ )));
+ data_sources.push_back(static_cast <SysLogsInterface*>(
+ new LSBReleaseFetcher()));
+ data_sources.push_back(static_cast <SysLogsInterface*>(
+ new MemoryDetailsFetcher()));
+ return new SysLogsFetcher(data_sources);
+}
+
+} // namespace system
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698