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

Unified Diff: chrome/browser/ui/cocoa/clear_browsing_data_controller.mm

Issue 5711001: Add a new GetInstance() method for remaining files with singleton classes under chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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/ui/cocoa/clear_browsing_data_controller.mm
diff --git a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm
index d59e89efcb8bd585649828b59da328b65e5afb4d..c0c927e3c93ab50a47631d29aa22c72f8c0de1f5 100644
--- a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm
+++ b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm
@@ -5,9 +5,9 @@
#import "chrome/browser/ui/cocoa/clear_browsing_data_controller.h"
#include "app/l10n_util.h"
+#include "base/lazy_instance.h"
#include "base/mac_util.h"
#include "base/scoped_nsobject.h"
-#include "base/singleton.h"
#include "chrome/browser/browsing_data_remover.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -41,6 +41,9 @@ namespace {
typedef std::map<Profile*, ClearBrowsingDataController*> ProfileControllerMap;
+static base::LazyInstance<ProfileControllerMap> g_profile_controller_map(
+ base::LINKER_INITIALIZED);
+
} // namespace
@implementation ClearBrowsingDataController
@@ -74,7 +77,7 @@ typedef std::map<Profile*, ClearBrowsingDataController*> ProfileControllerMap;
// 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()) {
@@ -205,7 +208,7 @@ typedef std::map<Profile*, ClearBrowsingDataController*> ProfileControllerMap;
}
- (void)closeDialog {
- 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);

Powered by Google App Engine
This is Rietveld 408576698