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

Unified Diff: chrome/browser/media_galleries/linux/mtp_read_file_worker.cc

Issue 614893004: Refactor AppendToFile and WriteFileDescriptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 6 years, 2 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/media_galleries/linux/mtp_read_file_worker.cc
diff --git a/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc b/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc
index 7edf995a3b5f631f1af90f4cc042e384ee80a8cf..5d11427559f15bb2b64cad5252aea298e776d29a 100644
--- a/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc
+++ b/chrome/browser/media_galleries/linux/mtp_read_file_worker.cc
@@ -27,11 +27,9 @@ uint32 WriteDataChunkIntoSnapshotFileOnFileThread(
const base::FilePath& snapshot_file_path,
const std::string& data) {
DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
- int bytes_written =
- base::AppendToFile(snapshot_file_path, data.data(),
- base::checked_cast<int>(data.size()));
- return (static_cast<int>(data.size()) == bytes_written) ?
- base::checked_cast<uint32>(bytes_written) : 0;
+ return base::AppendToFile(snapshot_file_path, data.c_str(), data.size())
+ ? base::checked_cast<uint32>(data.size())
+ : 0;
}
} // namespace
« no previous file with comments | « chrome/browser/media/webrtc_rtp_dump_writer.cc ('k') | chrome/browser/media_galleries/win/mtp_device_operations_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698