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

Unified Diff: ppapi/thunk/ppb_file_ref_thunk.cc

Issue 14188019: CRX FileSystem Pepper private API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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/thunk/ppb_file_ref_thunk.cc
diff --git a/ppapi/thunk/ppb_file_ref_thunk.cc b/ppapi/thunk/ppb_file_ref_thunk.cc
index 3c56c5cabc3cfbea44e6ca15773bf0f965f55481..986a3c0b48d2ecd9830e17b7a879a30774ed1fdf 100644
--- a/ppapi/thunk/ppb_file_ref_thunk.cc
+++ b/ppapi/thunk/ppb_file_ref_thunk.cc
@@ -7,6 +7,7 @@
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_file_ref_private.h"
+#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
@@ -24,10 +25,19 @@ typedef EnterResource<PPB_FileRef_API> EnterFileRef;
PP_Resource Create(PP_Resource file_system, const char* path) {
ppapi::ProxyAutoLock lock;
- EnterResourceNoLock<PPB_FileSystem_API> enter_file_system(file_system, true);
- if (enter_file_system.failed())
+
+ // Make sure the file_system is one of the expected types.
+ EnterResourceNoLock<PPB_FileSystem_API> enter_file_system(file_system, false);
+ EnterResourceNoLock<PPB_Ext_CrxFileSystem_Private_API> enter_crxfs(
+ file_system, false);
+ if (enter_file_system.failed() && enter_crxfs.failed())
return 0;
- PP_Instance instance = enter_file_system.resource()->pp_instance();
+
+ // Since file_system is either type of filesystem above, we don't need to
palmer 2013/05/02 21:30:09 Style: |file_system|
victorhsieh 2013/05/03 17:26:58 Reverted these change as it's no longer needed.
+ // check null-ness below.
+ Resource* res = PpapiGlobals::Get()->GetResourceTracker()->
+ GetResource(file_system);
+ PP_Instance instance = res->pp_instance();
EnterResourceCreationNoLock enter(instance);
if (enter.failed())
return 0;

Powered by Google App Engine
This is Rietveld 408576698