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

Unified Diff: chrome/browser/download/download_util.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/download/download_util.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index dbed4dbedf95a378d9138d396d153b6144f6c780..57a61a4ae6a5eeeb8f6a1537e25daf2bdcafba3a 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) {

Powered by Google App Engine
This is Rietveld 408576698