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

Unified Diff: base/file_util_win.cc

Issue 6043: Added dangerous download prompting. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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
Index: base/file_util_win.cc
===================================================================
--- base/file_util_win.cc (revision 2758)
+++ base/file_util_win.cc (working copy)
@@ -376,13 +376,19 @@
}
bool CreateTemporaryFileName(std::wstring* temp_file) {
- wchar_t temp_name[MAX_PATH + 1];
std::wstring temp_path;
if (!GetTempDir(&temp_path))
return false;
- if (!GetTempFileName(temp_path.c_str(), L"", 0, temp_name))
+ return CreateTemporaryFileNameInDir(temp_path, temp_file);
+}
+
+bool CreateTemporaryFileNameInDir(const std::wstring& dir,
+ std::wstring* temp_file) {
+ wchar_t temp_name[MAX_PATH + 1];
+
+ if (!GetTempFileName(dir.c_str(), L"", 0, temp_name))
return false; // fail!
DWORD path_len = GetLongPathName(temp_name, temp_name, MAX_PATH);

Powered by Google App Engine
This is Rietveld 408576698