summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
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/download
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/download')
-rw-r--r--chrome/browser/download/download_util.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index dbed4db..57a61a4 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -16,8 +16,8 @@
#include "base/file_util.h"
#include "base/i18n/rtl.h"
#include "base/i18n/time_formatting.h"
+#include "base/lazy_instance.h"
#include "base/path_service.h"
-#include "base/singleton.h"
#include "base/string16.h"
#include "base/string_number_conversions.h"
#include "base/stringprintf.h"
@@ -108,12 +108,15 @@ class DefaultDownloadDirectory {
}
}
}
- friend struct DefaultSingletonTraits<DefaultDownloadDirectory>;
+ friend struct base::DefaultLazyInstanceTraits<DefaultDownloadDirectory>;
FilePath path_;
};
+static base::LazyInstance<DefaultDownloadDirectory>
+ g_default_download_directory(base::LINKER_INITIALIZED);
+
const FilePath& GetDefaultDownloadDirectory() {
- return Singleton<DefaultDownloadDirectory>::get()->path();
+ return g_default_download_directory.Get().path();
}
bool CreateTemporaryFileForDownload(FilePath* temp_file) {