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

Unified Diff: chrome/browser/download/download_file.cc

Issue 6005: Cross-platform equivalent of fopen, _wfopen_s etc.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 3 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: chrome/browser/download/download_file.cc
===================================================================
--- chrome/browser/download/download_file.cc (revision 2711)
+++ chrome/browser/download/download_file.cc (working copy)
@@ -67,7 +67,7 @@
bool DownloadFile::Initialize() {
if (file_util::CreateTemporaryFileName(&full_path_))
- return Open(L"wb");
+ return Open("wb");
return false;
}
@@ -107,22 +107,22 @@
if (!in_progress_)
return true;
- if (!Open(L"a+b"))
+ if (!Open("a+b"))
return false;
return true;
}
void DownloadFile::Close() {
if (file_) {
- fclose(file_);
+ file_util::CloseFile(file_);
file_ = NULL;
}
}
-bool DownloadFile::Open(const wchar_t* open_mode) {
+bool DownloadFile::Open(const char* open_mode) {
DCHECK(!full_path_.empty());
- if (_wfopen_s(&file_, full_path_.c_str(), open_mode)) {
- file_ = NULL;
+ file_ = file_util::OpenFile(full_path_, open_mode);
+ if (!file_) {
return false;
}
// Sets the Zone to tell Windows that this file comes from the internet.

Powered by Google App Engine
This is Rietveld 408576698