OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/c/dev/ppb_directory_reader_dev.h" | 5 #include "ppapi/c/dev/ppb_directory_reader_dev.h" |
6 #include "ppapi/c/pp_completion_callback.h" | 6 #include "ppapi/c/pp_completion_callback.h" |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
9 #include "ppapi/thunk/thunk.h" | 9 #include "ppapi/thunk/thunk.h" |
10 #include "ppapi/thunk/ppb_directory_reader_api.h" | 10 #include "ppapi/thunk/ppb_directory_reader_api.h" |
11 #include "ppapi/thunk/resource_creation_api.h" | 11 #include "ppapi/thunk/resource_creation_api.h" |
12 | 12 |
13 namespace ppapi { | 13 namespace ppapi { |
14 namespace thunk { | 14 namespace thunk { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 PP_Resource Create(PP_Resource directory_ref) { | 18 PP_Resource Create(PP_Resource directory_ref) { |
19 EnterFunctionGivenResource<ResourceCreationAPI> enter(directory_ref, true); | 19 Resource* object = |
brettw
2012/04/21 19:50:01
I also deleted EnterFunctionGivenResource since it
| |
20 PpapiGlobals::Get()->GetResourceTracker()->GetResource(directory_ref); | |
21 if (!object) | |
22 return 0; | |
23 EnterResourceCreation enter(object->pp_instance()); | |
20 if (enter.failed()) | 24 if (enter.failed()) |
21 return 0; | 25 return 0; |
22 return enter.functions()->CreateDirectoryReader(directory_ref); | 26 return enter.functions()->CreateDirectoryReader(directory_ref); |
23 } | 27 } |
24 | 28 |
25 PP_Bool IsDirectoryReader(PP_Resource resource) { | 29 PP_Bool IsDirectoryReader(PP_Resource resource) { |
26 EnterResource<PPB_DirectoryReader_API> enter(resource, false); | 30 EnterResource<PPB_DirectoryReader_API> enter(resource, false); |
27 return PP_FromBool(enter.succeeded()); | 31 return PP_FromBool(enter.succeeded()); |
28 } | 32 } |
29 | 33 |
(...skipping 14 matching lines...) Expand all Loading... | |
44 }; | 48 }; |
45 | 49 |
46 } // namespace | 50 } // namespace |
47 | 51 |
48 const PPB_DirectoryReader_Dev_0_5* GetPPB_DirectoryReader_Dev_0_5_Thunk() { | 52 const PPB_DirectoryReader_Dev_0_5* GetPPB_DirectoryReader_Dev_0_5_Thunk() { |
49 return &g_ppb_directory_reader_thunk; | 53 return &g_ppb_directory_reader_thunk; |
50 } | 54 } |
51 | 55 |
52 } // namespace thunk | 56 } // namespace thunk |
53 } // namespace ppapi | 57 } // namespace ppapi |
OLD | NEW |