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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page.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_blocking_page.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index 9bc9f7d3b136433946ff3b27c195bf81ff2dc5bc..bc72883021db1848d3a3718cdf84f3d7735f6e32 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -11,7 +11,7 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/i18n/rtl.h"
-#include "base/singleton.h"
+#include "base/lazy_instance.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
@@ -86,13 +86,17 @@ class SafeBrowsingBlockingPageFactoryImpl
}
private:
- friend struct DefaultSingletonTraits<SafeBrowsingBlockingPageFactoryImpl>;
+ friend struct base::DefaultLazyInstanceTraits<
+ SafeBrowsingBlockingPageFactoryImpl>;
SafeBrowsingBlockingPageFactoryImpl() { }
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageFactoryImpl);
};
+static base::LazyInstance<SafeBrowsingBlockingPageFactoryImpl>
+ g_safe_browsing_blocking_page_factory_impl(base::LINKER_INITIALIZED);
+
SafeBrowsingBlockingPage::SafeBrowsingBlockingPage(
SafeBrowsingService* sb_service,
TabContents* tab_contents,
@@ -541,7 +545,7 @@ void SafeBrowsingBlockingPage::ShowBlockingPage(
// Set up the factory if this has not been done already (tests do that
// before this method is called).
if (!factory_)
- factory_ = Singleton<SafeBrowsingBlockingPageFactoryImpl>::get();
+ factory_ = g_safe_browsing_blocking_page_factory_impl.Pointer();
SafeBrowsingBlockingPage* blocking_page =
factory_->CreateSafeBrowsingPage(sb_service, tab_contents, resources);
blocking_page->Show();

Powered by Google App Engine
This is Rietveld 408576698