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

Unified Diff: ppapi/proxy/ppb_file_io_proxy.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated TestURLLoader to test blocking callbacks. Created 8 years, 8 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/ppb_file_io_proxy.cc
diff --git a/ppapi/proxy/ppb_file_io_proxy.cc b/ppapi/proxy/ppb_file_io_proxy.cc
index 0acd3ac79b47cafe4471c7d2c98ff8ecf428c5c3..66b8285b5e719349cdf416b56e0e966ee3da3f50 100644
--- a/ppapi/proxy/ppb_file_io_proxy.cc
+++ b/ppapi/proxy/ppb_file_io_proxy.cc
@@ -41,32 +41,32 @@ class FileIO : public PPB_FileIO_Shared {
virtual int32_t GetOSFileDescriptor() OVERRIDE;
virtual int32_t WillWrite(int64_t offset,
int32_t bytes_to_write,
- PP_CompletionCallback callback) OVERRIDE;
+ ApiCallbackType callback) OVERRIDE;
virtual int32_t WillSetLength(int64_t length,
- PP_CompletionCallback callback) OVERRIDE;
+ ApiCallbackType callback) OVERRIDE;
private:
// FileIOImpl overrides.
virtual int32_t OpenValidated(PP_Resource file_ref_resource,
PPB_FileRef_API* file_ref_api,
int32_t open_flags,
- PP_CompletionCallback callback) OVERRIDE;
+ ApiCallbackType callback) OVERRIDE;
virtual int32_t QueryValidated(PP_FileInfo* info,
- PP_CompletionCallback callback) OVERRIDE;
+ ApiCallbackType callback) OVERRIDE;
virtual int32_t TouchValidated(PP_Time last_access_time,
PP_Time last_modified_time,
- PP_CompletionCallback callback) OVERRIDE;
+ ApiCallbackType callback) OVERRIDE;
virtual int32_t ReadValidated(int64_t offset,
char* buffer,
int32_t bytes_to_read,
- PP_CompletionCallback callback) OVERRIDE;
+ ApiCallbackType callback) OVERRIDE;
virtual int32_t WriteValidated(int64_t offset,
const char* buffer,
int32_t bytes_to_write,
- PP_CompletionCallback callback) OVERRIDE;
+ ApiCallbackType callback) OVERRIDE;
virtual int32_t SetLengthValidated(int64_t length,
- PP_CompletionCallback callback) OVERRIDE;
- virtual int32_t FlushValidated(PP_CompletionCallback callback) OVERRIDE;
+ ApiCallbackType callback) OVERRIDE;
+ virtual int32_t FlushValidated(ApiCallbackType callback) OVERRIDE;
PluginDispatcher* GetDispatcher() const {
return PluginDispatcher::GetForResource(this);
@@ -98,7 +98,7 @@ int32_t FileIO::GetOSFileDescriptor() {
int32_t FileIO::WillWrite(int64_t offset,
int32_t bytes_to_write,
- PP_CompletionCallback callback) {
+ ApiCallbackType callback) {
GetDispatcher()->Send(new PpapiHostMsg_PPBFileIO_WillWrite(
kApiID, host_resource(), offset, bytes_to_write));
RegisterCallback(OPERATION_EXCLUSIVE, callback, NULL, NULL);
@@ -106,7 +106,7 @@ int32_t FileIO::WillWrite(int64_t offset,
}
int32_t FileIO::WillSetLength(int64_t length,
- PP_CompletionCallback callback) {
+ ApiCallbackType callback) {
GetDispatcher()->Send(new PpapiHostMsg_PPBFileIO_WillSetLength(
kApiID, host_resource(), length));
RegisterCallback(OPERATION_EXCLUSIVE, callback, NULL, NULL);
@@ -116,7 +116,7 @@ int32_t FileIO::WillSetLength(int64_t length,
int32_t FileIO::OpenValidated(PP_Resource file_ref_resource,
PPB_FileRef_API* file_ref_api,
int32_t open_flags,
- PP_CompletionCallback callback) {
+ ApiCallbackType callback) {
Resource* file_ref_object =
PpapiGlobals::Get()->GetResourceTracker()->GetResource(file_ref_resource);
@@ -127,7 +127,7 @@ int32_t FileIO::OpenValidated(PP_Resource file_ref_resource,
}
int32_t FileIO::QueryValidated(PP_FileInfo* info,
- PP_CompletionCallback callback) {
+ ApiCallbackType callback) {
GetDispatcher()->Send(new PpapiHostMsg_PPBFileIO_Query(
kApiID, host_resource()));
RegisterCallback(OPERATION_EXCLUSIVE, callback, NULL, info);
@@ -136,7 +136,7 @@ int32_t FileIO::QueryValidated(PP_FileInfo* info,
int32_t FileIO::TouchValidated(PP_Time last_access_time,
PP_Time last_modified_time,
- PP_CompletionCallback callback) {
+ ApiCallbackType callback) {
GetDispatcher()->Send(new PpapiHostMsg_PPBFileIO_Touch(
kApiID, host_resource(), last_access_time, last_modified_time));
RegisterCallback(OPERATION_EXCLUSIVE, callback, NULL, NULL);
@@ -146,7 +146,7 @@ int32_t FileIO::TouchValidated(PP_Time last_access_time,
int32_t FileIO::ReadValidated(int64_t offset,
char* buffer,
int32_t bytes_to_read,
- PP_CompletionCallback callback) {
+ ApiCallbackType callback) {
GetDispatcher()->Send(new PpapiHostMsg_PPBFileIO_Read(
kApiID, host_resource(), offset, bytes_to_read));
RegisterCallback(OPERATION_READ, callback, buffer, NULL);
@@ -156,7 +156,7 @@ int32_t FileIO::ReadValidated(int64_t offset,
int32_t FileIO::WriteValidated(int64_t offset,
const char* buffer,
int32_t bytes_to_write,
- PP_CompletionCallback callback) {
+ ApiCallbackType callback) {
// TODO(brettw) it would be nice to use a shared memory buffer for large
// writes rather than having to copy to a string (which will involve a number
// of extra copies to serialize over IPC).
@@ -167,14 +167,14 @@ int32_t FileIO::WriteValidated(int64_t offset,
}
int32_t FileIO::SetLengthValidated(int64_t length,
- PP_CompletionCallback callback) {
+ ApiCallbackType callback) {
GetDispatcher()->Send(new PpapiHostMsg_PPBFileIO_SetLength(
kApiID, host_resource(), length));
RegisterCallback(OPERATION_EXCLUSIVE, callback, NULL, NULL);
return PP_OK_COMPLETIONPENDING;
}
-int32_t FileIO::FlushValidated(PP_CompletionCallback callback) {
+int32_t FileIO::FlushValidated(ApiCallbackType callback) {
GetDispatcher()->Send(new PpapiHostMsg_PPBFileIO_Flush(
kApiID, host_resource()));
RegisterCallback(OPERATION_EXCLUSIVE, callback, NULL, NULL);

Powered by Google App Engine
This is Rietveld 408576698