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

Unified Diff: chrome/browser/extensions/system_info_provider.h

Issue 10876041: Polish the SystemInfoProvider template code and refactor StorageInfoProvider based on it (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use string16 instead of wstring to avoid Presubmit warning 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/extensions/system_info_provider.h
diff --git a/chrome/browser/extensions/system_info_provider.h b/chrome/browser/extensions/system_info_provider.h
index 38fac9e5108be049e3c1932bb9035b120f9fce9f..d9057d5ceda4713d28dd488284d6f7dbf7ecc6c2 100644
--- a/chrome/browser/extensions/system_info_provider.h
+++ b/chrome/browser/extensions/system_info_provider.h
@@ -47,10 +47,6 @@ class SystemInfoProvider {
virtual ~SystemInfoProvider() {}
- // Static method to get the single shared instance. Should be implemented
- // in the impl file for each kind of provider.
- static SystemInfoProvider<T>* Get();
-
// For testing
static void InitializeForTesting(SystemInfoProvider<T>* provider) {
DCHECK(provider != NULL);
@@ -113,12 +109,12 @@ class SystemInfoProvider {
// Template function for creating the single shared provider instance.
// Template paramter I is the type of SystemInfoProvider implementation.
template<class I>
- static SystemInfoProvider<T>* GetInstance() {
+ static I* GetInstance() {
if (!single_shared_provider_.Get().get()) {
I* impl = new I();
single_shared_provider_.Get().reset(impl);
}
- return single_shared_provider_.Get().get();
+ return static_cast<I*>(single_shared_provider_.Get().get());
}
// The latest information filled up by QueryInfo implementation. Here we

Powered by Google App Engine
This is Rietveld 408576698