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

Unified Diff: chrome/utility/media_galleries/iapps_xml_utils.cc

Issue 252683006: Remove ClosePlatformFile from media galleries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra space Created 6 years, 8 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
« no previous file with comments | « chrome/utility/media_galleries/iapps_xml_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/media_galleries/iapps_xml_utils.cc
diff --git a/chrome/utility/media_galleries/iapps_xml_utils.cc b/chrome/utility/media_galleries/iapps_xml_utils.cc
index 1c2b0b77180b5ba90b25290ecf85db78221e8877..987b6c193ecd7f1618b64840cb7773a65b3f1bf6 100644
--- a/chrome/utility/media_galleries/iapps_xml_utils.cc
+++ b/chrome/utility/media_galleries/iapps_xml_utils.cc
@@ -77,28 +77,23 @@ bool ReadInteger(XmlReader* reader, uint64* result) {
return base::StringToUint64(value, result);
}
-std::string ReadPlatformFileAsString(const base::PlatformFile file) {
+std::string ReadFileAsString(base::File file) {
std::string result;
- if (file == base::kInvalidPlatformFileValue)
+ if (!file.IsValid())
return result;
// A "reasonable" artificial limit.
// TODO(vandebo): Add a UMA to figure out what common values are.
const int64 kMaxLibraryFileSize = 150 * 1024 * 1024;
- base::PlatformFileInfo file_info;
- if (!base::GetPlatformFileInfo(file, &file_info) ||
- file_info.size > kMaxLibraryFileSize) {
- base::ClosePlatformFile(file);
+ base::File::Info file_info;
+ if (!file.GetInfo(&file_info) || file_info.size > kMaxLibraryFileSize)
return result;
- }
result.resize(file_info.size);
- int bytes_read =
- base::ReadPlatformFile(file, 0, string_as_array(&result), file_info.size);
+ int bytes_read = file.Read(0, string_as_array(&result), file_info.size);
if (bytes_read != file_info.size)
result.clear();
- base::ClosePlatformFile(file);
return result;
}
« no previous file with comments | « chrome/utility/media_galleries/iapps_xml_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698