OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/pp_completion_callback.h" | 5 #include "ppapi/c/pp_completion_callback.h" |
6 #include "ppapi/c/pp_errors.h" | 6 #include "ppapi/c/pp_errors.h" |
7 #include "ppapi/c/private/ppb_ext_crx_file_system_private.h" | 7 #include "ppapi/c/private/ppb_ext_crx_file_system_private.h" |
8 #include "ppapi/shared_impl/tracked_callback.h" | 8 #include "ppapi/shared_impl/tracked_callback.h" |
9 #include "ppapi/thunk/enter.h" | 9 #include "ppapi/thunk/enter.h" |
10 #include "ppapi/thunk/ppb_instance_api.h" | 10 #include "ppapi/thunk/ppb_instance_api.h" |
11 #include "ppapi/thunk/ppb_isolated_file_system_private_api.h" | 11 #include "ppapi/thunk/ppb_isolated_file_system_private_api.h" |
12 #include "ppapi/thunk/resource_creation_api.h" | 12 #include "ppapi/thunk/resource_creation_api.h" |
13 #include "ppapi/thunk/thunk.h" | 13 #include "ppapi/thunk/thunk.h" |
14 | 14 |
15 namespace ppapi { | 15 namespace ppapi { |
16 namespace thunk { | 16 namespace thunk { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 int32_t Open(PP_Instance instance, | 20 int32_t Open(PP_Instance instance, |
21 PP_Resource* file_system, | 21 PP_Resource* file_system, |
22 struct PP_CompletionCallback callback) { | 22 struct PP_CompletionCallback callback) { |
23 VLOG(4) << "PPB_Ext_CrxFileSystem_Private::Open()"; | 23 VLOG(4) << "PPB_Ext_CrxFileSystem_Private::Open()"; |
24 EnterInstanceAPI<PPB_IsolatedFileSystem_Private_API> enter(instance, | 24 EnterInstanceAPI<PPB_IsolatedFileSystem_Private_API> enter(instance, |
25 callback); | 25 callback); |
26 if (enter.failed()) | 26 if (enter.failed()) |
27 return enter.retval(); | 27 return enter.retval(); |
28 return enter.SetResult(enter.functions()->Open( | 28 return enter.SetResult( |
29 instance, | 29 enter.functions()->Open(instance, |
30 PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX, | 30 PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX, |
31 file_system, | 31 file_system, |
32 enter.callback())); | 32 enter.callback())); |
33 } | 33 } |
34 | 34 |
35 const PPB_Ext_CrxFileSystem_Private_0_1 | 35 const PPB_Ext_CrxFileSystem_Private_0_1 |
36 g_ppb_ext_crxfilesystem_private_thunk_0_1 = { | 36 g_ppb_ext_crxfilesystem_private_thunk_0_1 = {&Open}; |
37 &Open | |
38 }; | |
39 | 37 |
40 } // namespace | 38 } // namespace |
41 | 39 |
42 const PPB_Ext_CrxFileSystem_Private_0_1* | 40 const PPB_Ext_CrxFileSystem_Private_0_1* |
43 GetPPB_Ext_CrxFileSystem_Private_0_1_Thunk() { | 41 GetPPB_Ext_CrxFileSystem_Private_0_1_Thunk() { |
44 return &g_ppb_ext_crxfilesystem_private_thunk_0_1; | 42 return &g_ppb_ext_crxfilesystem_private_thunk_0_1; |
45 } | 43 } |
46 | 44 |
47 } // namespace thunk | 45 } // namespace thunk |
48 } // namespace ppapi | 46 } // namespace ppapi |
OLD | NEW |