summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 16:42:15 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 16:42:15 +0000
commitfee46a89f493080db0838e2314b4400faeec94f3 (patch)
tree6e857fcf0b6b548b526c45d24879ad6422d50856 /chrome/browser/autofill
parentf2d1f61006eac0f8a051fa485b2cffb6b6fa74e0 (diff)
downloadchromium_src-fee46a89f493080db0838e2314b4400faeec94f3.zip
chromium_src-fee46a89f493080db0838e2314b4400faeec94f3.tar.gz
chromium_src-fee46a89f493080db0838e2314b4400faeec94f3.tar.bz2
This is a continuation of http://codereview.chromium.org/5519016/, adds a new GetInstance() method for remaining files with singleton classes under chrome/browser.
For types declared and used within the same .cc file, I changed them over to LazyInstance<T>. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5711001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68739 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r--chrome/browser/autofill/autofill_dialog_controller_mac.mm9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/autofill/autofill_dialog_controller_mac.mm b/chrome/browser/autofill/autofill_dialog_controller_mac.mm
index 990ba58..ac17b07 100644
--- a/chrome/browser/autofill/autofill_dialog_controller_mac.mm
+++ b/chrome/browser/autofill/autofill_dialog_controller_mac.mm
@@ -5,8 +5,8 @@
#import "chrome/browser/autofill/autofill_dialog_controller_mac.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
+#include "base/lazy_instance.h"
#include "base/mac_util.h"
-#include "base/singleton.h"
#include "base/sys_string_conversions.h"
#import "chrome/browser/autofill/autofill_address_model_mac.h"
#import "chrome/browser/autofill/autofill_address_sheet_controller_mac.h"
@@ -32,6 +32,9 @@ namespace {
// dialog.
typedef std::map<Profile*, AutoFillDialogController*> ProfileControllerMap;
+static base::LazyInstance<ProfileControllerMap> g_profile_controller_map(
+ base::LINKER_INITIALIZED);
+
} // namespace
// Delegate protocol that needs to be in place for the AutoFillTableView's
@@ -268,7 +271,7 @@ class PreferenceObserver : public NotificationObserver {
[self autorelease];
// Remove ourself from the map.
- ProfileControllerMap* map = Singleton<ProfileControllerMap>::get();
+ ProfileControllerMap* map = g_profile_controller_map.Pointer();
ProfileControllerMap::iterator it = map->find(profile_);
if (it != map->end()) {
map->erase(it);
@@ -633,7 +636,7 @@ class PreferenceObserver : public NotificationObserver {
profile:(Profile*)profile {
profile = profile->GetOriginalProfile();
- ProfileControllerMap* map = Singleton<ProfileControllerMap>::get();
+ ProfileControllerMap* map = g_profile_controller_map.Pointer();
DCHECK(map != NULL);
ProfileControllerMap::iterator it = map->find(profile);
if (it == map->end()) {