| 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 // From ppb_file_io.idl modified Mon Mar 18 13:58:22 2013. | 5 // From ppb_file_io.idl modified Tue Apr 16 11:25:44 2013. |
| 6 | 6 |
| 7 #include "ppapi/c/pp_completion_callback.h" | 7 #include "ppapi/c/pp_completion_callback.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/c/ppb_file_io.h" | 9 #include "ppapi/c/ppb_file_io.h" |
| 10 #include "ppapi/shared_impl/tracked_callback.h" | 10 #include "ppapi/shared_impl/tracked_callback.h" |
| 11 #include "ppapi/thunk/enter.h" | 11 #include "ppapi/thunk/enter.h" |
| 12 #include "ppapi/thunk/ppb_file_io_api.h" | 12 #include "ppapi/thunk/ppb_file_io_api.h" |
| 13 #include "ppapi/thunk/ppb_instance_api.h" | 13 #include "ppapi/thunk/ppb_instance_api.h" |
| 14 #include "ppapi/thunk/resource_creation_api.h" | 14 #include "ppapi/thunk/resource_creation_api.h" |
| 15 #include "ppapi/thunk/thunk.h" | 15 #include "ppapi/thunk/thunk.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 VLOG(4) << "PPB_FileIO::Flush()"; | 113 VLOG(4) << "PPB_FileIO::Flush()"; |
| 114 EnterResource<PPB_FileIO_API> enter(file_io, callback, true); | 114 EnterResource<PPB_FileIO_API> enter(file_io, callback, true); |
| 115 if (enter.failed()) | 115 if (enter.failed()) |
| 116 return enter.retval(); | 116 return enter.retval(); |
| 117 return enter.SetResult(enter.object()->Flush(enter.callback())); | 117 return enter.SetResult(enter.object()->Flush(enter.callback())); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void Close(PP_Resource file_io) { | 120 void Close(PP_Resource file_io) { |
| 121 VLOG(4) << "PPB_FileIO::Close()"; | 121 VLOG(4) << "PPB_FileIO::Close()"; |
| 122 EnterResource<PPB_FileIO_API> enter(file_io, true); | 122 EnterResource<PPB_FileIO_API> enter(file_io, true); |
| 123 if (enter.succeeded()) | 123 if (enter.failed()) |
| 124 enter.object()->Close(); | 124 return; |
| 125 enter.object()->Close(); |
| 125 } | 126 } |
| 126 | 127 |
| 127 int32_t ReadToArray(PP_Resource file_io, | 128 int32_t ReadToArray(PP_Resource file_io, |
| 128 int64_t offset, | 129 int64_t offset, |
| 129 int32_t max_read_length, | 130 int32_t max_read_length, |
| 130 struct PP_ArrayOutput* output, | 131 struct PP_ArrayOutput* output, |
| 131 struct PP_CompletionCallback callback) { | 132 struct PP_CompletionCallback callback) { |
| 132 VLOG(4) << "PPB_FileIO::ReadToArray()"; | 133 VLOG(4) << "PPB_FileIO::ReadToArray()"; |
| 133 EnterResource<PPB_FileIO_API> enter(file_io, callback, true); | 134 EnterResource<PPB_FileIO_API> enter(file_io, callback, true); |
| 134 if (enter.failed()) | 135 if (enter.failed()) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 const PPB_FileIO_1_0* GetPPB_FileIO_1_0_Thunk() { | 172 const PPB_FileIO_1_0* GetPPB_FileIO_1_0_Thunk() { |
| 172 return &g_ppb_fileio_thunk_1_0; | 173 return &g_ppb_fileio_thunk_1_0; |
| 173 } | 174 } |
| 174 | 175 |
| 175 const PPB_FileIO_1_1* GetPPB_FileIO_1_1_Thunk() { | 176 const PPB_FileIO_1_1* GetPPB_FileIO_1_1_Thunk() { |
| 176 return &g_ppb_fileio_thunk_1_1; | 177 return &g_ppb_fileio_thunk_1_1; |
| 177 } | 178 } |
| 178 | 179 |
| 179 } // namespace thunk | 180 } // namespace thunk |
| 180 } // namespace ppapi | 181 } // namespace ppapi |
| OLD | NEW |