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

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: Rebase 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 655e17b98a72e97d14d3539818eb20b6b78abbec..50f6291400d111d00acb186aba83813b121fb75e 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
@@ -86,7 +86,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);
@@ -107,8 +107,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);
@@ -133,7 +133,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);
@@ -341,7 +341,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);
@@ -388,7 +388,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;
@@ -399,12 +399,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 =
@@ -424,21 +424,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();
@@ -454,18 +454,18 @@ void MTPDeviceDelegateImplLinux::OnDidGetFileInfoToCreateSnapshotFile(
void MTPDeviceDelegateImplLinux::OnDidGetFileInfoToReadBytes(
const ReadBytesRequest& request,
- const base::PlatformFileInfo& file_info) {
+ const base::File::Info& file_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
DCHECK(request.buf);
DCHECK(request.buf_len >= 0);
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(request.error_callback, error);
ReadBytesRequest new_request(
@@ -494,7 +494,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());
@@ -507,7 +507,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_);
@@ -529,7 +529,7 @@ void MTPDeviceDelegateImplLinux::OnDidReadBytes(
void MTPDeviceDelegateImplLinux::HandleDeviceFileError(
const ErrorCallback& error_callback,
- base::PlatformFileError error) {
+ base::File::Error error) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
DCHECK(task_in_progress_);
error_callback.Run(error);

Powered by Google App Engine
This is Rietveld 408576698