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

Unified Diff: ppapi/proxy/file_io_resource.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
« no previous file with comments | « ppapi/proxy/file_io_resource.h ('k') | ppapi/proxy/flash_file_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/file_io_resource.cc
diff --git a/ppapi/proxy/file_io_resource.cc b/ppapi/proxy/file_io_resource.cc
index f4fa6a50f87434998befcc4fb6183c58db4f66df..a35c9ece3d7ebb11169a71e58ebea1bd2c070136 100644
--- a/ppapi/proxy/file_io_resource.cc
+++ b/ppapi/proxy/file_io_resource.cc
@@ -57,8 +57,11 @@ FileIOResource::QueryOp::~QueryOp() {
}
int32_t FileIOResource::QueryOp::DoWork() {
- return base::GetPlatformFileInfo(file_handle_->raw_handle(), &file_info_) ?
- PP_OK : PP_ERROR_FAILED;
+ // TODO(rvargas): Convert this code to use base::File.
+ base::File file(file_handle_->raw_handle());
+ bool success = file.GetInfo(&file_info_);
+ file.TakePlatformFile();
+ return success ? PP_OK : PP_ERROR_FAILED;
}
FileIOResource::ReadOp::ReadOp(scoped_refptr<FileHandleHolder> file_handle,
@@ -188,21 +191,25 @@ int32_t FileIOResource::Query(PP_FileInfo* info,
// If the callback is blocking, perform the task on the calling thread.
if (callback->is_blocking()) {
int32_t result = PP_ERROR_FAILED;
- base::PlatformFileInfo file_info;
+ base::File::Info file_info;
// The plugin could release its reference to this instance when we release
// the proxy lock below.
scoped_refptr<FileIOResource> protect(this);
{
// Release the proxy lock while making a potentially slow file call.
ProxyAutoUnlock unlock;
- if (base::GetPlatformFileInfo(file_handle_->raw_handle(), &file_info))
+ // TODO(rvargas): Convert this code to base::File.
+ base::File file(file_handle_->raw_handle());
+ bool success = file.GetInfo(&file_info);
+ file.TakePlatformFile();
+ if (success)
result = PP_OK;
}
if (result == PP_OK) {
// This writes the file info into the plugin's PP_FileInfo struct.
- ppapi::PlatformFileInfoToPepperFileInfo(file_info,
- file_system_type_,
- info);
+ ppapi::FileInfoToPepperFileInfo(file_info,
+ file_system_type_,
+ info);
}
state_manager_.SetOperationFinished();
return result;
@@ -547,9 +554,9 @@ int32_t FileIOResource::OnQueryComplete(scoped_refptr<QueryOp> query_op,
if (result == PP_OK) {
// This writes the file info into the plugin's PP_FileInfo struct.
- ppapi::PlatformFileInfoToPepperFileInfo(query_op->file_info(),
- file_system_type_,
- info);
+ ppapi::FileInfoToPepperFileInfo(query_op->file_info(),
+ file_system_type_,
+ info);
}
state_manager_.SetOperationFinished();
return result;
« no previous file with comments | « ppapi/proxy/file_io_resource.h ('k') | ppapi/proxy/flash_file_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698