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

Unified Diff: webkit/plugins/ppapi/ppb_file_ref_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_ref_impl.h ('k') | webkit/plugins/ppapi/ppb_file_system_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_ref_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_file_ref_impl.cc b/webkit/plugins/ppapi/ppb_file_ref_impl.cc
index 48115e56043ef18cc054a592d63bf35608780a53..a3864f8be33c470dd034fc59d2c8a266724a7559 100644
--- a/webkit/plugins/ppapi/ppb_file_ref_impl.cc
+++ b/webkit/plugins/ppapi/ppb_file_ref_impl.cc
@@ -25,6 +25,7 @@ using ppapi::HostResource;
using ppapi::PPB_FileRef_CreateInfo;
using ppapi::PPTimeToTime;
using ppapi::StringVar;
+using ppapi::TrackedCallback;
using ppapi::thunk::EnterResourceNoLock;
using ppapi::thunk::PPB_FileRef_API;
using ppapi::thunk::PPB_FileSystem_API;
@@ -165,10 +166,9 @@ PP_Resource PPB_FileRef_Impl::GetParent() {
return parent_ref->GetReference();
}
-int32_t PPB_FileRef_Impl::MakeDirectory(PP_Bool make_ancestors,
- PP_CompletionCallback callback) {
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
+int32_t PPB_FileRef_Impl::MakeDirectory(
+ PP_Bool make_ancestors,
+ scoped_refptr<TrackedCallback> callback) {
if (!IsValidNonExternalFileSystem())
return PP_ERROR_NOACCESS;
@@ -184,9 +184,7 @@ int32_t PPB_FileRef_Impl::MakeDirectory(PP_Bool make_ancestors,
int32_t PPB_FileRef_Impl::Touch(PP_Time last_access_time,
PP_Time last_modified_time,
- PP_CompletionCallback callback) {
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
+ scoped_refptr<TrackedCallback> callback) {
if (!IsValidNonExternalFileSystem())
return PP_ERROR_NOACCESS;
@@ -202,9 +200,7 @@ int32_t PPB_FileRef_Impl::Touch(PP_Time last_access_time,
return PP_OK_COMPLETIONPENDING;
}
-int32_t PPB_FileRef_Impl::Delete(PP_CompletionCallback callback) {
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
+int32_t PPB_FileRef_Impl::Delete(scoped_refptr<TrackedCallback> callback) {
if (!IsValidNonExternalFileSystem())
return PP_ERROR_NOACCESS;
@@ -219,9 +215,7 @@ int32_t PPB_FileRef_Impl::Delete(PP_CompletionCallback callback) {
}
int32_t PPB_FileRef_Impl::Rename(PP_Resource new_pp_file_ref,
- PP_CompletionCallback callback) {
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
+ scoped_refptr<TrackedCallback> callback) {
EnterResourceNoLock<PPB_FileRef_API> enter(new_pp_file_ref, true);
if (enter.failed())
return PP_ERROR_BADRESOURCE;
« no previous file with comments | « webkit/plugins/ppapi/ppb_file_ref_impl.h ('k') | webkit/plugins/ppapi/ppb_file_system_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698