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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

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/safe_browsing/safe_browsing_service.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index c8e3c091f89dc3834c626e885aef8917ccb79ffb..62486248eddcace961df89aaf058932df6da217b 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -6,8 +6,8 @@
#include "base/callback.h"
#include "base/command_line.h"
+#include "base/lazy_instance.h"
#include "base/path_service.h"
-#include "base/singleton.h"
#include "base/string_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_thread.h"
@@ -62,13 +62,16 @@ class SafeBrowsingServiceFactoryImpl : public SafeBrowsingServiceFactory {
}
private:
- friend struct DefaultSingletonTraits<SafeBrowsingServiceFactoryImpl>;
+ friend struct base::DefaultLazyInstanceTraits<SafeBrowsingServiceFactoryImpl>;
SafeBrowsingServiceFactoryImpl() { }
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactoryImpl);
};
+static base::LazyInstance<SafeBrowsingServiceFactoryImpl>
+ g_safe_browsing_service_factory_impl(base::LINKER_INITIALIZED);
+
struct SafeBrowsingService::WhiteListedEntry {
int render_process_host_id;
int render_view_id;
@@ -97,7 +100,7 @@ SafeBrowsingService::SafeBrowsingCheck::~SafeBrowsingCheck() {}
/* static */
SafeBrowsingService* SafeBrowsingService::CreateSafeBrowsingService() {
if (!factory_)
- factory_ = Singleton<SafeBrowsingServiceFactoryImpl>::get();
+ factory_ = g_safe_browsing_service_factory_impl.Pointer();
return factory_->CreateSafeBrowsingService();
}

Powered by Google App Engine
This is Rietveld 408576698