Chromium Code Reviews| 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..48c44a560dca18d3945e3551aca2f60efbe840ea 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) |
|
Lei Zhang
2014/04/28 19:47:00
nit: only 1 space after ||
rvargas (doing something else)
2014/04/28 19:53:15
Done.
|
| 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; |
| } |