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

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: Review comments 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: ppapi/proxy/file_io_resource.cc
diff --git a/ppapi/proxy/file_io_resource.cc b/ppapi/proxy/file_io_resource.cc
index f4fa6a50f87434998befcc4fb6183c58db4f66df..daa93548407284f670bf4fd22b0f8516c3c29081 100644
--- a/ppapi/proxy/file_io_resource.cc
+++ b/ppapi/proxy/file_io_resource.cc
@@ -57,8 +57,13 @@ 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.
+ if (base::GetPlatformFileInfo(
+ file_handle_->raw_handle(),
+ reinterpret_cast<base::PlatformFileInfo*>(&file_info_))) {
dmichael (off chromium) 2014/01/23 21:22:10 Please define & use an explicit conversion functio
rvargas (doing something else) 2014/01/24 03:14:54 fixed
+ return PP_OK;
+ }
+ return PP_ERROR_FAILED;
}
FileIOResource::ReadOp::ReadOp(scoped_refptr<FileHandleHolder> file_handle,
@@ -188,21 +193,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.
+ if (base::GetPlatformFileInfo(
+ file_handle_->raw_handle(),
+ reinterpret_cast<base::PlatformFileInfo*>(&file_info))) {
dmichael (off chromium) 2014/01/23 21:22:10 ditto
rvargas (doing something else) 2014/01/24 03:14:54 fixed
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 +556,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;

Powered by Google App Engine
This is Rietveld 408576698