Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_SYSINFO_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_SYSINFO_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_SYSINFO_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_SYSINFO_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | |
| 9 | 10 |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/singleton.h" | |
| 13 #include "base/synchronization/lock.h" | |
| 11 #include "chrome/browser/cancelable_request.h" | 14 #include "chrome/browser/cancelable_request.h" |
| 12 | 15 |
| 16 | |
| 13 class CancelableRequestConsumerBase; | 17 class CancelableRequestConsumerBase; |
| 14 | 18 |
| 15 namespace chromeos { | 19 namespace chromeos { |
| 16 namespace system { | 20 namespace system { |
| 17 | 21 |
| 18 typedef std::map<std::string, std::string> SysInfoResponse; | 22 typedef std::map<std::string, std::string> SysInfoResponse; |
|
rkc
2012/08/02 18:40:54
This would make more sense as SystemInfoData
| |
| 19 | 23 |
| 20 // Provides CancelableRequests for fetching system info (network state, etc) | 24 // Provides CancelableRequests for fetching system info (network state, etc) |
| 21 // from the ChromeOS debug daemon. | 25 // from the ChromeOS debug daemon. |
| 22 class SysInfoProvider : public CancelableRequestProvider { | 26 class SysInfoProvider : public CancelableRequestProvider { |
| 23 public: | 27 public: |
| 24 // Allocates a new SysInfoProvider and returns it. | 28 // Allocates a new SysInfoProvider and returns it. |
| 25 static SysInfoProvider* Create(); | 29 static SysInfoProvider* Create(); |
| 26 virtual ~SysInfoProvider() {} | 30 virtual ~SysInfoProvider() {} |
| 27 | 31 |
| 28 typedef base::Callback<void(SysInfoResponse*)> FetchCompleteCallback; | 32 typedef base::Callback<void(SysInfoResponse*)> FetchCompleteCallback; |
| 29 | 33 |
| 30 // Fetches system info from the debug daemon, attributing the request to | 34 // Fetches system info from the debug daemon, attributing the request to |
| 31 // |consumer|. Calls |callback| when all information has been fetched. | 35 // |consumer|. Calls |callback| when all information has been fetched. |
| 32 virtual Handle Fetch(CancelableRequestConsumerBase* consumer, | 36 virtual Handle Fetch(CancelableRequestConsumerBase* consumer, |
| 33 const FetchCompleteCallback& callback) = 0; | 37 const FetchCompleteCallback& callback) = 0; |
| 34 }; | 38 }; |
| 35 | 39 |
| 36 } // namespace system | 40 } // namespace system |
| 37 } // namespace chromeos | 41 } // namespace chromeos |
| 38 | 42 |
| 43 | |
| 39 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_SYSINFO_PROVIDER_H_ | 44 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_SYSINFO_PROVIDER_H_ |
| OLD | NEW |