OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_file_io_trusted_dev.h" | |
6 #include "ppapi/c/pp_completion_callback.h" | 5 #include "ppapi/c/pp_completion_callback.h" |
7 #include "ppapi/c/pp_errors.h" | 6 #include "ppapi/c/pp_errors.h" |
| 7 #include "ppapi/c/trusted/ppb_file_io_trusted.h" |
8 #include "ppapi/thunk/common.h" | 8 #include "ppapi/thunk/common.h" |
9 #include "ppapi/thunk/enter.h" | 9 #include "ppapi/thunk/enter.h" |
10 #include "ppapi/thunk/thunk.h" | 10 #include "ppapi/thunk/thunk.h" |
11 #include "ppapi/thunk/ppb_file_io_api.h" | 11 #include "ppapi/thunk/ppb_file_io_api.h" |
12 #include "ppapi/thunk/resource_creation_api.h" | 12 #include "ppapi/thunk/resource_creation_api.h" |
13 | 13 |
14 namespace ppapi { | 14 namespace ppapi { |
15 namespace thunk { | 15 namespace thunk { |
16 | 16 |
17 namespace { | 17 namespace { |
(...skipping 19 matching lines...) Expand all Loading... |
37 int32_t WillSetLength(PP_Resource file_io, | 37 int32_t WillSetLength(PP_Resource file_io, |
38 int64_t length, | 38 int64_t length, |
39 PP_CompletionCallback callback) { | 39 PP_CompletionCallback callback) { |
40 EnterResource<PPB_FileIO_API> enter(file_io, true); | 40 EnterResource<PPB_FileIO_API> enter(file_io, true); |
41 if (enter.failed()) | 41 if (enter.failed()) |
42 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); | 42 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); |
43 int32_t result = enter.object()->WillSetLength(length, callback); | 43 int32_t result = enter.object()->WillSetLength(length, callback); |
44 return MayForceCallback(callback, result); | 44 return MayForceCallback(callback, result); |
45 } | 45 } |
46 | 46 |
47 const PPB_FileIOTrusted_Dev g_ppb_file_io_trusted_thunk = { | 47 const PPB_FileIOTrusted g_ppb_file_io_trusted_thunk = { |
48 &GetOSFileDescriptor, | 48 &GetOSFileDescriptor, |
49 &WillWrite, | 49 &WillWrite, |
50 &WillSetLength | 50 &WillSetLength |
51 }; | 51 }; |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 const PPB_FileIOTrusted_Dev* GetPPB_FileIOTrusted_Thunk() { | 55 const PPB_FileIOTrusted* GetPPB_FileIOTrusted_Thunk() { |
56 return &g_ppb_file_io_trusted_thunk; | 56 return &g_ppb_file_io_trusted_thunk; |
57 } | 57 } |
58 | 58 |
59 } // namespace thunk | 59 } // namespace thunk |
60 } // namespace ppapi | 60 } // namespace ppapi |
OLD | NEW |