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

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

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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_device_task_helper.cc
diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc b/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc
index afbe77a4223b9c19ad1745d61522510cb2f6564a..b3f64cab99e2ca2d222b76db309dfe135c4623ff 100644
--- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc
+++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc
@@ -61,7 +61,7 @@ void MTPDeviceTaskHelper::GetFileInfoByPath(
const ErrorCallback& error_callback) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (device_handle_.empty())
- return HandleDeviceError(error_callback, base::PLATFORM_FILE_ERROR_FAILED);
+ return HandleDeviceError(error_callback, base::File::FILE_ERROR_FAILED);
GetMediaTransferProtocolManager()->GetFileInfoByPath(
device_handle_, file_path,
@@ -77,7 +77,7 @@ void MTPDeviceTaskHelper::ReadDirectoryByPath(
const ErrorCallback& error_callback) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (device_handle_.empty())
- return HandleDeviceError(error_callback, base::PLATFORM_FILE_ERROR_FAILED);
+ return HandleDeviceError(error_callback, base::File::FILE_ERROR_FAILED);
GetMediaTransferProtocolManager()->ReadDirectoryByPath(
device_handle_, dir_path,
@@ -89,11 +89,11 @@ void MTPDeviceTaskHelper::ReadDirectoryByPath(
void MTPDeviceTaskHelper::WriteDataIntoSnapshotFile(
const SnapshotRequestInfo& request_info,
- const base::PlatformFileInfo& snapshot_file_info) {
+ const base::File::Info& snapshot_file_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (device_handle_.empty()) {
return HandleDeviceError(request_info.error_callback,
- base::PLATFORM_FILE_ERROR_FAILED);
+ base::File::FILE_ERROR_FAILED);
}
if (!read_file_worker_)
@@ -129,10 +129,10 @@ void MTPDeviceTaskHelper::OnGetFileInfo(
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (error) {
return HandleDeviceError(error_callback,
- base::PLATFORM_FILE_ERROR_NOT_FOUND);
+ base::File::FILE_ERROR_NOT_FOUND);
}
- base::PlatformFileInfo file_entry_info;
+ base::File::Info file_entry_info;
file_entry_info.size = file_entry.file_size();
file_entry_info.is_directory =
file_entry.file_type() == MtpFileEntry::FILE_TYPE_FOLDER;
@@ -154,7 +154,7 @@ void MTPDeviceTaskHelper::OnDidReadDirectoryByPath(
bool error) const {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (error)
- return HandleDeviceError(error_callback, base::PLATFORM_FILE_ERROR_FAILED);
+ return HandleDeviceError(error_callback, base::File::FILE_ERROR_FAILED);
fileapi::AsyncFileUtil::EntryList entries;
base::FilePath current;
@@ -174,7 +174,7 @@ void MTPDeviceTaskHelper::OnDidReadDirectoryByPath(
void MTPDeviceTaskHelper::HandleDeviceError(
const ErrorCallback& error_callback,
- base::PlatformFileError error) const {
+ base::File::Error error) const {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
content::BrowserThread::PostTask(content::BrowserThread::IO,
FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698