summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
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/net
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/net')
-rw-r--r--chrome/browser/net/predictor_api.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/net/predictor_api.cc b/chrome/browser/net/predictor_api.cc
index 33bf25d..6898dfa 100644
--- a/chrome/browser/net/predictor_api.cc
+++ b/chrome/browser/net/predictor_api.cc
@@ -8,7 +8,7 @@
#include <string>
#include "base/metrics/field_trial.h"
-#include "base/singleton.h"
+#include "base/lazy_instance.h"
#include "base/stl_util-inl.h"
#include "base/string_number_conversions.h"
#include "base/thread.h"
@@ -330,7 +330,8 @@ class OffTheRecordObserver : public NotificationObserver {
}
private:
- friend struct DefaultSingletonTraits<OffTheRecordObserver>;
+ friend struct base::DefaultLazyInstanceTraits<OffTheRecordObserver>;
+
OffTheRecordObserver() : count_off_the_record_windows_(0) {}
~OffTheRecordObserver() {}
@@ -340,6 +341,9 @@ class OffTheRecordObserver : public NotificationObserver {
DISALLOW_COPY_AND_ASSIGN(OffTheRecordObserver);
};
+static base::LazyInstance<OffTheRecordObserver> g_off_the_record_observer(
+ base::LINKER_INITIALIZED);
+
//------------------------------------------------------------------------------
// This section supports the about:dns page.
//------------------------------------------------------------------------------
@@ -576,7 +580,7 @@ PredictorInit::PredictorInit(PrefService* user_prefs,
// We will register the incognito observer regardless of whether prefetching
// is enabled, as it is also used to clear the host cache.
- Singleton<OffTheRecordObserver>::get()->Register();
+ g_off_the_record_observer.Get().Register();
if (trial_->group() != disabled_prefetch) {
// Initialize the DNS prefetch system.