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

Unified Diff: webkit/plugins/ppapi/ppb_file_io_impl.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export AssertLockHeld Created 8 years, 6 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 | « webkit/plugins/ppapi/ppb_file_io_impl.h ('k') | webkit/plugins/ppapi/ppb_file_ref_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_file_io_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_file_io_impl.cc b/webkit/plugins/ppapi/ppb_file_io_impl.cc
index 7fa69bcf7753615260a112dc71c55c1b2dfe55f8..d1022709bbf48801b1fad183f63527e9f8349f14 100644
--- a/webkit/plugins/ppapi/ppb_file_io_impl.cc
+++ b/webkit/plugins/ppapi/ppb_file_io_impl.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -29,6 +29,7 @@
using ppapi::PPTimeToTime;
using ppapi::TimeToPPTime;
+using ppapi::TrackedCallback;
using ppapi::thunk::PPB_FileRef_API;
namespace webkit {
@@ -44,10 +45,11 @@ PPB_FileIO_Impl::~PPB_FileIO_Impl() {
Close();
}
-int32_t PPB_FileIO_Impl::OpenValidated(PP_Resource file_ref_resource,
- PPB_FileRef_API* file_ref_api,
- int32_t open_flags,
- PP_CompletionCallback callback) {
+int32_t PPB_FileIO_Impl::OpenValidated(
+ PP_Resource file_ref_resource,
+ PPB_FileRef_API* file_ref_api,
+ int32_t open_flags,
+ scoped_refptr<TrackedCallback> callback) {
PPB_FileRef_Impl* file_ref = static_cast<PPB_FileRef_Impl*>(file_ref_api);
int flags = 0;
@@ -79,8 +81,9 @@ int32_t PPB_FileIO_Impl::OpenValidated(PP_Resource file_ref_resource,
return PP_OK_COMPLETIONPENDING;
}
-int32_t PPB_FileIO_Impl::QueryValidated(PP_FileInfo* info,
- PP_CompletionCallback callback) {
+int32_t PPB_FileIO_Impl::QueryValidated(
+ PP_FileInfo* info,
+ scoped_refptr<TrackedCallback> callback) {
PluginDelegate* plugin_delegate = GetPluginDelegate();
if (!plugin_delegate)
return PP_ERROR_FAILED;
@@ -95,9 +98,10 @@ int32_t PPB_FileIO_Impl::QueryValidated(PP_FileInfo* info,
return PP_OK_COMPLETIONPENDING;
}
-int32_t PPB_FileIO_Impl::TouchValidated(PP_Time last_access_time,
- PP_Time last_modified_time,
- PP_CompletionCallback callback) {
+int32_t PPB_FileIO_Impl::TouchValidated(
+ PP_Time last_access_time,
+ PP_Time last_modified_time,
+ scoped_refptr<TrackedCallback> callback) {
PluginDelegate* plugin_delegate = GetPluginDelegate();
if (!plugin_delegate)
return PP_ERROR_FAILED;
@@ -114,10 +118,11 @@ int32_t PPB_FileIO_Impl::TouchValidated(PP_Time last_access_time,
return PP_OK_COMPLETIONPENDING;
}
-int32_t PPB_FileIO_Impl::ReadValidated(int64_t offset,
- char* buffer,
- int32_t bytes_to_read,
- PP_CompletionCallback callback) {
+int32_t PPB_FileIO_Impl::ReadValidated(
+ int64_t offset,
+ char* buffer,
+ int32_t bytes_to_read,
+ scoped_refptr<TrackedCallback> callback) {
PluginDelegate* plugin_delegate = GetPluginDelegate();
if (!plugin_delegate)
return PP_ERROR_FAILED;
@@ -133,10 +138,11 @@ int32_t PPB_FileIO_Impl::ReadValidated(int64_t offset,
return PP_OK_COMPLETIONPENDING;
}
-int32_t PPB_FileIO_Impl::WriteValidated(int64_t offset,
- const char* buffer,
- int32_t bytes_to_write,
- PP_CompletionCallback callback) {
+int32_t PPB_FileIO_Impl::WriteValidated(
+ int64_t offset,
+ const char* buffer,
+ int32_t bytes_to_write,
+ scoped_refptr<TrackedCallback> callback) {
PluginDelegate* plugin_delegate = GetPluginDelegate();
if (!plugin_delegate)
return PP_ERROR_FAILED;
@@ -160,8 +166,9 @@ int32_t PPB_FileIO_Impl::WriteValidated(int64_t offset,
return PP_OK_COMPLETIONPENDING;
}
-int32_t PPB_FileIO_Impl::SetLengthValidated(int64_t length,
- PP_CompletionCallback callback) {
+int32_t PPB_FileIO_Impl::SetLengthValidated(
+ int64_t length,
+ scoped_refptr<TrackedCallback> callback) {
PluginDelegate* plugin_delegate = GetPluginDelegate();
if (!plugin_delegate)
return PP_ERROR_FAILED;
@@ -184,7 +191,8 @@ int32_t PPB_FileIO_Impl::SetLengthValidated(int64_t length,
return PP_OK_COMPLETIONPENDING;
}
-int32_t PPB_FileIO_Impl::FlushValidated(PP_CompletionCallback callback) {
+int32_t PPB_FileIO_Impl::FlushValidated(
+ scoped_refptr<TrackedCallback> callback) {
PluginDelegate* plugin_delegate = GetPluginDelegate();
if (!plugin_delegate)
return PP_ERROR_FAILED;
@@ -222,8 +230,8 @@ int32_t PPB_FileIO_Impl::GetOSFileDescriptor() {
int32_t PPB_FileIO_Impl::WillWrite(int64_t offset,
int32_t bytes_to_write,
- PP_CompletionCallback callback) {
- int32_t rv = CommonCallValidation(true, OPERATION_EXCLUSIVE, callback);
+ scoped_refptr<TrackedCallback> callback) {
+ int32_t rv = CommonCallValidation(true, OPERATION_EXCLUSIVE);
if (rv != PP_OK)
return rv;
@@ -240,9 +248,10 @@ int32_t PPB_FileIO_Impl::WillWrite(int64_t offset,
return PP_OK_COMPLETIONPENDING;
}
-int32_t PPB_FileIO_Impl::WillSetLength(int64_t length,
- PP_CompletionCallback callback) {
- int32_t rv = CommonCallValidation(true, OPERATION_EXCLUSIVE, callback);
+int32_t PPB_FileIO_Impl::WillSetLength(
+ int64_t length,
+ scoped_refptr<TrackedCallback> callback) {
+ int32_t rv = CommonCallValidation(true, OPERATION_EXCLUSIVE);
if (rv != PP_OK)
return rv;
« no previous file with comments | « webkit/plugins/ppapi/ppb_file_io_impl.h ('k') | webkit/plugins/ppapi/ppb_file_ref_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698