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

Unified Diff: chrome/browser/history/thumbnail_database.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/history/thumbnail_database.cc
===================================================================
--- chrome/browser/history/thumbnail_database.cc (revision 2711)
+++ chrome/browser/history/thumbnail_database.cc (working copy)
@@ -4,6 +4,7 @@
#include "chrome/browser/history/thumbnail_database.h"
+#include "base/file_util.h"
#include "base/time.h"
#include "base/string_util.h"
#include "chrome/browser/history/url_database.h"
@@ -104,11 +105,10 @@
char filename[256];
sprintf(filename, "<<< YOUR PATH HERE >>>\\%d.jpeg", idx);
- FILE* f;
- if (fopen_s(&f, filename, "wb") == 0) {
- if (!data.empty())
- fwrite(&data[0], 1, data.size(), f);
- fclose(f);
+ if (!data.empty()) {
+ file_util::WriteFile(ASCIIToWide(std::string(filename)),
+ reinterpret_cast<char*>(data.data()),
+ data.size());
}
}
#endif

Powered by Google App Engine
This is Rietveld 408576698