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

Unified Diff: base/linux_util.cc

Issue 2042003: Switch some Singletons to use LeakySingleton. Base URL: http://src.chromium.org/git/chromium.git
Patch Set: More build fixes. Created 10 years, 7 months 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
« no previous file with comments | « base/i18n/number_formatting.cc ('k') | base/logging_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/linux_util.cc
diff --git a/base/linux_util.cc b/base/linux_util.cc
index 0ad9bb0e3e39a158ce58ade35845deca6ebf8a03..3705b45a658457879dad7b6323e4a9a10a42834e 100644
--- a/base/linux_util.cc
+++ b/base/linux_util.cc
@@ -36,14 +36,9 @@ class LinuxDistroHelper {
public:
// Retrieves the Singleton.
static LinuxDistroHelper* Get() {
- return Singleton<LinuxDistroHelper>::get();
+ return LeakySingleton<LinuxDistroHelper>::get();
}
- // The simple state machine goes from:
- // STATE_DID_NOT_CHECK -> STATE_CHECK_STARTED -> STATE_CHECK_FINISHED.
- LinuxDistroHelper() : state_(STATE_DID_NOT_CHECK) {}
- ~LinuxDistroHelper() {}
-
// Retrieve the current state, if we're in STATE_DID_NOT_CHECK,
// we automatically move to STATE_CHECK_STARTED so nobody else will
// do the check.
@@ -64,6 +59,13 @@ class LinuxDistroHelper {
}
private:
+ friend struct DefaultSingletonTraits<LinuxDistroHelper>;
+
+ // The simple state machine goes from:
+ // STATE_DID_NOT_CHECK -> STATE_CHECK_STARTED -> STATE_CHECK_FINISHED.
+ LinuxDistroHelper() : state_(STATE_DID_NOT_CHECK) {}
+ ~LinuxDistroHelper() {}
+
Lock lock_;
LinuxDistroState state_;
};
« no previous file with comments | « base/i18n/number_formatting.cc ('k') | base/logging_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698