| 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_;
|
| };
|
|
|