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

Unified Diff: trunk/src/ui/base/resource/data_pack.cc

Issue 105823009: Revert 239280 "Move more file_util functions to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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
« no previous file with comments | « trunk/src/tools/imagediff/image_diff.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/base/resource/data_pack.cc
===================================================================
--- trunk/src/ui/base/resource/data_pack.cc (revision 239399)
+++ trunk/src/ui/base/resource/data_pack.cc (working copy)
@@ -216,13 +216,13 @@
bool DataPack::WritePack(const base::FilePath& path,
const std::map<uint16, base::StringPiece>& resources,
TextEncodingType textEncodingType) {
- FILE* file = base::OpenFile(path, "wb");
+ FILE* file = file_util::OpenFile(path, "wb");
if (!file)
return false;
if (fwrite(&kFileFormatVersion, sizeof(kFileFormatVersion), 1, file) != 1) {
LOG(ERROR) << "Failed to write file version";
- base::CloseFile(file);
+ file_util::CloseFile(file);
return false;
}
@@ -231,7 +231,7 @@
uint32 entry_count = resources.size();
if (fwrite(&entry_count, sizeof(entry_count), 1, file) != 1) {
LOG(ERROR) << "Failed to write entry count";
- base::CloseFile(file);
+ file_util::CloseFile(file);
return false;
}
@@ -239,14 +239,14 @@
textEncodingType != BINARY) {
LOG(ERROR) << "Invalid text encoding type, got " << textEncodingType
<< ", expected between " << BINARY << " and " << UTF16;
- base::CloseFile(file);
+ file_util::CloseFile(file);
return false;
}
uint8 write_buffer = textEncodingType;
if (fwrite(&write_buffer, sizeof(uint8), 1, file) != 1) {
LOG(ERROR) << "Failed to write file text resources encoding";
- base::CloseFile(file);
+ file_util::CloseFile(file);
return false;
}
@@ -260,13 +260,13 @@
uint16 resource_id = it->first;
if (fwrite(&resource_id, sizeof(resource_id), 1, file) != 1) {
LOG(ERROR) << "Failed to write id for " << resource_id;
- base::CloseFile(file);
+ file_util::CloseFile(file);
return false;
}
if (fwrite(&data_offset, sizeof(data_offset), 1, file) != 1) {
LOG(ERROR) << "Failed to write offset for " << resource_id;
- base::CloseFile(file);
+ file_util::CloseFile(file);
return false;
}
@@ -278,13 +278,13 @@
uint16 resource_id = 0;
if (fwrite(&resource_id, sizeof(resource_id), 1, file) != 1) {
LOG(ERROR) << "Failed to write extra resource id.";
- base::CloseFile(file);
+ file_util::CloseFile(file);
return false;
}
if (fwrite(&data_offset, sizeof(data_offset), 1, file) != 1) {
LOG(ERROR) << "Failed to write extra offset.";
- base::CloseFile(file);
+ file_util::CloseFile(file);
return false;
}
@@ -293,12 +293,12 @@
it != resources.end(); ++it) {
if (fwrite(it->second.data(), it->second.length(), 1, file) != 1) {
LOG(ERROR) << "Failed to write data for " << it->first;
- base::CloseFile(file);
+ file_util::CloseFile(file);
return false;
}
}
- base::CloseFile(file);
+ file_util::CloseFile(file);
return true;
}
« no previous file with comments | « trunk/src/tools/imagediff/image_diff.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698