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

Unified Diff: chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.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_delegate_impl_linux.cc
diff --git a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc
index 424365a08fdf1dcd0c6db7ca4893b2911b7c78ae..68bf6c682417e0aef8c4014c1f693343c36f6335 100644
--- a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc
+++ b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc
@@ -85,7 +85,7 @@ void ReadDirectoryOnUIThread(
const std::string& root,
const base::Callback<
void(const fileapi::AsyncFileUtil::EntryList&)>& success_callback,
- const base::Callback<void(base::PlatformFileError)>& error_callback) {
+ const base::Callback<void(base::File::Error)>& error_callback) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
MTPDeviceTaskHelper* task_helper =
GetDeviceTaskHelperForStorage(storage_name);
@@ -106,8 +106,8 @@ void ReadDirectoryOnUIThread(
void GetFileInfoOnUIThread(
const std::string& storage_name,
const std::string& file_path,
- const base::Callback<void(const base::PlatformFileInfo&)>& success_callback,
- const base::Callback<void(base::PlatformFileError)>& error_callback) {
+ const base::Callback<void(const base::File::Info&)>& success_callback,
+ const base::Callback<void(base::File::Error)>& error_callback) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
MTPDeviceTaskHelper* task_helper =
GetDeviceTaskHelperForStorage(storage_name);
@@ -132,7 +132,7 @@ void GetFileInfoOnUIThread(
void WriteDataIntoSnapshotFileOnUIThread(
const std::string& storage_name,
const SnapshotRequestInfo& request_info,
- const base::PlatformFileInfo& snapshot_file_info) {
+ const base::File::Info& snapshot_file_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
MTPDeviceTaskHelper* task_helper =
GetDeviceTaskHelperForStorage(storage_name);
@@ -295,7 +295,7 @@ void MTPDeviceDelegateImplLinux::EnsureInitAndRunTask(
}
void MTPDeviceDelegateImplLinux::WriteDataIntoSnapshotFile(
- const base::PlatformFileInfo& file_info) {
+ const base::File::Info& file_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
DCHECK(current_snapshot_request_info_.get());
DCHECK_GT(file_info.size, 0);
@@ -342,7 +342,7 @@ void MTPDeviceDelegateImplLinux::OnInitCompleted(bool succeeded) {
void MTPDeviceDelegateImplLinux::OnDidGetFileInfo(
const GetFileInfoSuccessCallback& success_callback,
- const base::PlatformFileInfo& file_info) {
+ const base::File::Info& file_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
success_callback.Run(file_info);
task_in_progress_ = false;
@@ -353,12 +353,12 @@ void MTPDeviceDelegateImplLinux::OnDidGetFileInfoToReadDirectory(
const std::string& root,
const ReadDirectorySuccessCallback& success_callback,
const ErrorCallback& error_callback,
- const base::PlatformFileInfo& file_info) {
+ const base::File::Info& file_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
DCHECK(task_in_progress_);
if (!file_info.is_directory) {
return HandleDeviceFileError(error_callback,
- base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY);
+ base::File::FILE_ERROR_NOT_A_DIRECTORY);
}
base::Closure task_closure =
@@ -378,21 +378,21 @@ void MTPDeviceDelegateImplLinux::OnDidGetFileInfoToReadDirectory(
void MTPDeviceDelegateImplLinux::OnDidGetFileInfoToCreateSnapshotFile(
scoped_ptr<SnapshotRequestInfo> snapshot_request_info,
- const base::PlatformFileInfo& file_info) {
+ const base::File::Info& file_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
DCHECK(!current_snapshot_request_info_.get());
DCHECK(snapshot_request_info.get());
DCHECK(task_in_progress_);
- base::PlatformFileError error = base::PLATFORM_FILE_OK;
+ base::File::Error error = base::File::FILE_OK;
if (file_info.is_directory)
- error = base::PLATFORM_FILE_ERROR_NOT_A_FILE;
+ error = base::File::FILE_ERROR_NOT_A_FILE;
else if (file_info.size < 0 || file_info.size > kuint32max)
- error = base::PLATFORM_FILE_ERROR_FAILED;
+ error = base::File::FILE_ERROR_FAILED;
- if (error != base::PLATFORM_FILE_OK)
+ if (error != base::File::FILE_OK)
return HandleDeviceFileError(snapshot_request_info->error_callback, error);
- base::PlatformFileInfo snapshot_file_info(file_info);
+ base::File::Info snapshot_file_info(file_info);
// Modify the last modified time to null. This prevents the time stamp
// verfication in LocalFileStreamReader.
snapshot_file_info.last_modified = base::Time();
@@ -416,7 +416,7 @@ void MTPDeviceDelegateImplLinux::OnDidReadDirectory(
}
void MTPDeviceDelegateImplLinux::OnDidWriteDataIntoSnapshotFile(
- const base::PlatformFileInfo& file_info,
+ const base::File::Info& file_info,
const base::FilePath& snapshot_file_path) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
DCHECK(current_snapshot_request_info_.get());
@@ -429,7 +429,7 @@ void MTPDeviceDelegateImplLinux::OnDidWriteDataIntoSnapshotFile(
}
void MTPDeviceDelegateImplLinux::OnWriteDataIntoSnapshotFileError(
- base::PlatformFileError error) {
+ base::File::Error error) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
DCHECK(current_snapshot_request_info_.get());
DCHECK(task_in_progress_);
@@ -441,7 +441,7 @@ void MTPDeviceDelegateImplLinux::OnWriteDataIntoSnapshotFileError(
void MTPDeviceDelegateImplLinux::HandleDeviceFileError(
const ErrorCallback& error_callback,
- base::PlatformFileError error) {
+ base::File::Error error) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
error_callback.Run(error);
task_in_progress_ = false;

Powered by Google App Engine
This is Rietveld 408576698