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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 return PP_FromBool(enter.succeeded()); | 27 return PP_FromBool(enter.succeeded()); |
28 } | 28 } |
29 | 29 |
30 int32_t GetNextEntry(PP_Resource directory_reader, | 30 int32_t GetNextEntry(PP_Resource directory_reader, |
31 PP_DirectoryEntry_Dev* entry, | 31 PP_DirectoryEntry_Dev* entry, |
32 PP_CompletionCallback callback) { | 32 PP_CompletionCallback callback) { |
33 EnterResource<PPB_DirectoryReader_API> enter( | 33 EnterResource<PPB_DirectoryReader_API> enter( |
34 directory_reader, callback, true); | 34 directory_reader, callback, true); |
35 if (enter.failed()) | 35 if (enter.failed()) |
36 return enter.retval(); | 36 return enter.retval(); |
37 return enter.SetResult(enter.object()->GetNextEntry(entry, callback)); | 37 return enter.SetResult(enter.object()->GetNextEntry(entry, enter.callback())); |
38 } | 38 } |
39 | 39 |
40 const PPB_DirectoryReader_Dev g_ppb_directory_reader_thunk = { | 40 const PPB_DirectoryReader_Dev g_ppb_directory_reader_thunk = { |
41 &Create, | 41 &Create, |
42 &IsDirectoryReader, | 42 &IsDirectoryReader, |
43 &GetNextEntry | 43 &GetNextEntry |
44 }; | 44 }; |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 const PPB_DirectoryReader_Dev_0_5* GetPPB_DirectoryReader_Dev_0_5_Thunk() { | 48 const PPB_DirectoryReader_Dev_0_5* GetPPB_DirectoryReader_Dev_0_5_Thunk() { |
49 return &g_ppb_directory_reader_thunk; | 49 return &g_ppb_directory_reader_thunk; |
50 } | 50 } |
51 | 51 |
52 } // namespace thunk | 52 } // namespace thunk |
53 } // namespace ppapi | 53 } // namespace ppapi |
OLD | NEW |