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

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

Issue 14200028: Make CrosSettings and DeviceSettingsService non Lazy instances (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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/device_settings_service.h
diff --git a/chrome/browser/chromeos/settings/device_settings_service.h b/chrome/browser/chromeos/settings/device_settings_service.h
index aa30fb5708b237e35748ecb48de0124c157085bf..0c66d37324b782c8f2092e3781a774bec5badca9 100644
--- a/chrome/browser/chromeos/settings/device_settings_service.h
+++ b/chrome/browser/chromeos/settings/device_settings_service.h
@@ -17,10 +17,6 @@
#include "chrome/browser/policy/cloud/cloud_policy_validator.h"
#include "chromeos/dbus/session_manager_client.h"
-namespace base {
-template <typename T> struct DefaultLazyInstanceTraits;
-}
-
namespace crypto {
class RSAPrivateKey;
}
@@ -110,21 +106,24 @@ class DeviceSettingsService : public SessionManagerClient::Observer {
virtual void DeviceSettingsUpdated() = 0;
};
+ // Manage singleton instance.
+ static void Initialize();
+ static bool IsInitialized();
+ static void Shutdown();
+ static DeviceSettingsService* Get();
+
// Creates a device settings service instance. This is meant for unit tests,
- // production code uses the singleton returned by Get() below.
+ // production code uses the singleton returned by Get() above.
DeviceSettingsService();
- ~DeviceSettingsService();
-
- // Returns the singleton instance.
- static DeviceSettingsService* Get();
+ virtual ~DeviceSettingsService();
// To be called on startup once threads are initialized and DBus is ready.
- void Initialize(SessionManagerClient* session_manager_client,
- scoped_refptr<OwnerKeyUtil> owner_key_util);
+ void SetSessionManager(SessionManagerClient* session_manager_client,
+ scoped_refptr<OwnerKeyUtil> owner_key_util);
// Prevents the service from making further calls to session_manager_client
// and stops any pending operations.
- void Shutdown();
+ void UnsetSessionManager();
// Returns the currently active device settings. Returns NULL if the device
// settings have not been retrieved from session_manager yet.

Powered by Google App Engine
This is Rietveld 408576698