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

Unified Diff: ppapi/thunk/ppb_file_system_thunk.cc

Issue 9113044: Convert to new enter method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove common.h Created 8 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/thunk/ppb_file_system_thunk.cc
diff --git a/ppapi/thunk/ppb_file_system_thunk.cc b/ppapi/thunk/ppb_file_system_thunk.cc
index 1e82c917ed38154dced9da5a51b277bfe60a0f5c..b05b7a0941c037abc7ae0223c4c9952ce5f5dd4a 100644
--- a/ppapi/thunk/ppb_file_system_thunk.cc
+++ b/ppapi/thunk/ppb_file_system_thunk.cc
@@ -5,7 +5,6 @@
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_file_system.h"
-#include "ppapi/thunk/common.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/thunk.h"
#include "ppapi/thunk/ppb_file_system_api.h"
@@ -16,6 +15,8 @@ namespace thunk {
namespace {
+typedef EnterResource<PPB_FileSystem_API> EnterFileSystem;
+
PP_Resource Create(PP_Instance instance, PP_FileSystemType type) {
EnterFunction<ResourceCreationAPI> enter(instance, true);
yzshen1 2012/01/25 19:11:01 EnterResourceCreation?
if (enter.failed())
@@ -24,22 +25,21 @@ PP_Resource Create(PP_Instance instance, PP_FileSystemType type) {
}
PP_Bool IsFileSystem(PP_Resource resource) {
- EnterResource<PPB_FileSystem_API> enter(resource, false);
+ EnterFileSystem enter(resource, false);
return PP_FromBool(enter.succeeded());
}
int32_t Open(PP_Resource file_system,
int64 expected_size,
PP_CompletionCallback callback) {
- EnterResource<PPB_FileSystem_API> enter(file_system, true);
+ EnterFileSystem enter(file_system, callback, true);
if (enter.failed())
- return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
- int32_t result = enter.object()->Open(expected_size, callback);
- return MayForceCallback(callback, result);
+ return enter.retval();
+ return enter.SetResult(enter.object()->Open(expected_size, callback));
}
PP_FileSystemType GetType(PP_Resource file_system) {
- EnterResource<PPB_FileSystem_API> enter(file_system, true);
+ EnterFileSystem enter(file_system, true);
if (enter.failed())
return PP_FILESYSTEMTYPE_INVALID;
return enter.object()->GetType();

Powered by Google App Engine
This is Rietveld 408576698