Chromium Code Reviews| 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..b74c00b87be988fe96c194a6c2c86ddcde63ddaf 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; |
| + |
| + // Make sure the file_system is one of the expected types. |
| EnterResourceNoLock<PPB_FileSystem_API> enter_file_system(file_system, true); |
|
yzshen1
2013/04/30 19:31:19
you should use 'false' (and also line 32).
victorhsieh
2013/04/30 22:04:32
I remember you said only Is* should have false for
yzshen1
2013/05/01 17:45:10
Sorry if I didn't explain clearly. :) The boolean
victorhsieh
2013/05/02 18:59:06
Done.
|
| - if (enter_file_system.failed()) |
| + EnterResourceNoLock<PPB_Ext_CrxFileSystem_Private_API> enter_crxfs( |
| + file_system, true); |
| + 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 |
| + // 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; |