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 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_DEBUGD_LOG_SOURCE_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_DEBUGD_LOG_SOURCE_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/memory/weak_ptr.h" | |
| 13 #include "chrome/browser/chromeos/system_logs/system_logs_fetcher.h" | |
| 14 | |
| 15 namespace chromeos { | |
| 16 | |
| 17 // Gathers log data from Debug Daemon. | |
| 18 class DebugDaemonLogSource : public SystemLogsSource { | |
| 19 public: | |
| 20 DebugDaemonLogSource(); | |
| 21 virtual ~DebugDaemonLogSource(); | |
| 22 | |
| 23 // Fetches logs from the daemon over dbus. After the fetch is complete, the | |
| 24 // results will be forwarded to the request supplied to the constructor and | |
| 25 // this instance will free itself. | |
| 26 // SystemLogsSource override. | |
| 27 virtual void Fetch(const SysLogsFetcherCallback& request) OVERRIDE; | |
| 28 | |
| 29 private: | |
| 30 // Callbacks for the 4 different dbus calls | |
| 31 void GotRoutes(bool succeeded, const std::vector<std::string>& routes); | |
| 32 void GotNetworkStatus(bool succeeded, const std::string& status); | |
| 33 void GotModemStatus(bool succeeded, const std::string& status); | |
| 34 void GotLogs(bool succeeded, const std::map<std::string, std::string>& logs); | |
| 35 // Sends the data to the SysLogsFetcherCallback when all the requests are | |
| 36 // completed | |
| 37 void RequestCompleted(); | |
| 38 | |
| 39 SystemLogsResponse* response_; | |
| 40 SysLogsFetcherCallback request_; | |
| 41 int pending_requests_; | |
|
satorux1
2012/08/13 18:29:03
please add num_ prefix.
tudalex(Chromium)
2012/08/14 03:24:00
Done.
| |
| 42 base::WeakPtrFactory<DebugDaemonLogSource> weak_ptr_factory_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(DebugDaemonLogSource); | |
| 45 }; | |
| 46 | |
| 47 | |
| 48 } // namespace chromeos | |
| 49 | |
| 50 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_DEBUGD_LOG_SOURCE_H_ | |
| OLD | NEW |