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/syslogs_fetcher_factory.h" | |
| 6 | |
| 7 #include "base/bind.h" | |
| 8 #include "base/bind_helpers.h" | |
| 9 #include "base/logging.h" | |
| 10 #include "base/string_util.h" | |
| 11 #include "base/memory/singleton.h" | |
| 12 #include "base/memory/weak_ptr.h" | |
| 13 #include "base/synchronization/lock.h" | |
| 14 #include "base/threading/thread.h" | |
| 15 #include "chrome/browser/chromeos/system/commandline_fetcher.h" | |
| 16 #include "chrome/browser/chromeos/system/debugd_log_fetcher.h" | |
| 17 #include "chrome/browser/chromeos/system/memorydetails_fetcher.h" | |
| 18 #include "chrome/browser/chromeos/system/lsbrelease_fetcher.h" | |
| 19 #include "content/public/browser/browser_thread.h" | |
| 20 | |
| 21 namespace chromeos { | |
| 22 namespace system { | |
| 23 | |
| 24 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
| |
| 25 return Singleton<SysLogsFetcherFactory>::get(); | |
| 26 } | |
| 27 | |
| 28 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.
| |
| 29 SysLogsDataSources data_sources; | |
| 30 | |
| 31 // 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.
| |
| 32 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.
| |
| 33 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.
| |
| 34 | |
| 35 // Chrome data Source | |
| 36 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.
| |
| 37 new CommandLineFetcher("cras", | |
|
rkc1
2012/08/04 01:15:05
Merge into one class.
tudalex(Chromium)
2012/08/05 01:15:12
Done.
| |
| 38 "/usr/bin/cras_test_client --dump_server_info" | |
| 39 ))); | |
| 40 data_sources.push_back(static_cast <SysLogsInterface*>( | |
| 41 new CommandLineFetcher("env", | |
| 42 "set" | |
| 43 ))); | |
| 44 data_sources.push_back(static_cast <SysLogsInterface*>( | |
| 45 new CommandLineFetcher("setxkbmap", | |
| 46 "/usr/bin/setxkbmap -print -query" | |
| 47 ))); | |
| 48 data_sources.push_back(static_cast <SysLogsInterface*>( | |
| 49 new CommandLineFetcher("xrandr", | |
| 50 "/usr/bin/xrandr --verbose" | |
| 51 ))); | |
| 52 data_sources.push_back(static_cast <SysLogsInterface*>( | |
| 53 new CommandLineFetcher("hack-33025-touchpad", | |
| 54 "/opt/google/touchpad/tpcontrol" | |
| 55 ))); | |
| 56 data_sources.push_back(static_cast <SysLogsInterface*>( | |
| 57 new CommandLineFetcher("hack-33025-touchpad_activity", | |
| 58 "/opt/google/touchpad/generate_userfeedback" | |
| 59 ))); | |
| 60 data_sources.push_back(static_cast <SysLogsInterface*>( | |
| 61 new LSBReleaseFetcher())); | |
| 62 data_sources.push_back(static_cast <SysLogsInterface*>( | |
| 63 new MemoryDetailsFetcher())); | |
| 64 return new SysLogsFetcher(data_sources); | |
| 65 } | |
| 66 | |
| 67 } // namespace system | |
| 68 } // namespace chromeos | |
| OLD | NEW |