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

Unified Diff: chrome/browser/chromeos/settings/cros_settings.h

Issue 14200028: Make CrosSettings and DeviceSettingsService non Lazy instances (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix LoginUtilsTest Created 7 years, 8 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/settings/cros_settings.h
diff --git a/chrome/browser/chromeos/settings/cros_settings.h b/chrome/browser/chromeos/settings/cros_settings.h
index 4148ee69e848f90af14a60e2851a5ac7cfdb68a0..71e5fd9310474085651089562f92991c36790f75 100644
--- a/chrome/browser/chromeos/settings/cros_settings.h
+++ b/chrome/browser/chromeos/settings/cros_settings.h
@@ -17,7 +17,6 @@
#include "content/public/browser/notification_observer.h"
namespace base {
-template <typename T> struct DefaultLazyInstanceTraits;
class ListValue;
class Value;
}
@@ -28,6 +27,9 @@ namespace chromeos {
class CrosSettings : public base::NonThreadSafe {
public:
// Class factory.
Mattias Nissler (ping if slow) 2013/04/16 16:09:51 This comment is now out of place.
stevenjb 2013/04/16 16:49:43 Done.
+ static void Initialize();
+ static bool IsInitialized();
+ static void Shutdown();
static CrosSettings* Get();
// Helper function to test if the given |path| is a valid cros setting.
@@ -92,12 +94,10 @@ class CrosSettings : public base::NonThreadSafe {
CrosSettingsProvider* GetProvider(const std::string& path) const;
private:
- friend struct base::DefaultLazyInstanceTraits<CrosSettings>;
friend class CrosSettingsTest;
- // Public for testing.
CrosSettings();
- ~CrosSettings();
+ virtual ~CrosSettings();
Mattias Nissler (ping if slow) 2013/04/16 16:09:51 why? nothing is virtual here.
stevenjb 2013/04/16 16:49:43 PrepareTrustedValues
// Fires system setting change notification.
void FireObservers(const std::string& path);
@@ -116,6 +116,17 @@ class CrosSettings : public base::NonThreadSafe {
DISALLOW_COPY_AND_ASSIGN(CrosSettings);
};
+// Helper class for unit tests. Initializes DeviceSettingsService and
+// CrosSettings for tests that need them.
+class ScopedTestCrosSettings {
+ public:
+ ScopedTestCrosSettings();
+ ~ScopedTestCrosSettings();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScopedTestCrosSettings);
+};
+
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_

Powered by Google App Engine
This is Rietveld 408576698