| 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/pp_file_info.h" | 5 #include "ppapi/c/pp_file_info.h" |
| 6 #include "ppapi/c/ppb_file_ref.h" | 6 #include "ppapi/c/ppb_file_ref.h" |
| 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/private/ppb_file_ref_private.h" | 9 #include "ppapi/c/private/ppb_file_ref_private.h" |
| 10 #include "ppapi/shared_impl/file_ref_create_info.h" | 10 #include "ppapi/shared_impl/file_ref_create_info.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return enter.object()->GetParent(); | 80 return enter.object()->GetParent(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 int32_t MakeDirectory(PP_Resource directory_ref, | 83 int32_t MakeDirectory(PP_Resource directory_ref, |
| 84 PP_Bool make_ancestors, | 84 PP_Bool make_ancestors, |
| 85 PP_CompletionCallback callback) { | 85 PP_CompletionCallback callback) { |
| 86 VLOG(4) << "PPB_FileRef::MakeDirectory()"; | 86 VLOG(4) << "PPB_FileRef::MakeDirectory()"; |
| 87 EnterFileRef enter(directory_ref, callback, true); | 87 EnterFileRef enter(directory_ref, callback, true); |
| 88 if (enter.failed()) | 88 if (enter.failed()) |
| 89 return enter.retval(); | 89 return enter.retval(); |
| 90 int32_t flag = make_ancestors ? PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS | 90 return enter.SetResult(enter.object()->MakeDirectory(make_ancestors, |
| 91 : PP_MAKEDIRECTORYFLAG_NONE; | 91 enter.callback())); |
| 92 return enter.SetResult(enter.object()->MakeDirectory( | |
| 93 flag, enter.callback())); | |
| 94 } | |
| 95 | |
| 96 int32_t MakeDirectory_1_2(PP_Resource directory_ref, | |
| 97 int32_t make_directory_flags, | |
| 98 PP_CompletionCallback callback) { | |
| 99 VLOG(4) << "PPB_FileRef::MakeDirectory()"; | |
| 100 EnterFileRef enter(directory_ref, callback, true); | |
| 101 if (enter.failed()) | |
| 102 return enter.retval(); | |
| 103 return enter.SetResult(enter.object()->MakeDirectory( | |
| 104 make_directory_flags, enter.callback())); | |
| 105 } | 92 } |
| 106 | 93 |
| 107 int32_t Touch(PP_Resource file_ref, | 94 int32_t Touch(PP_Resource file_ref, |
| 108 PP_Time last_access_time, | 95 PP_Time last_access_time, |
| 109 PP_Time last_modified_time, | 96 PP_Time last_modified_time, |
| 110 PP_CompletionCallback callback) { | 97 PP_CompletionCallback callback) { |
| 111 VLOG(4) << "PPB_FileRef::Touch()"; | 98 VLOG(4) << "PPB_FileRef::Touch()"; |
| 112 EnterFileRef enter(file_ref, callback, true); | 99 EnterFileRef enter(file_ref, callback, true); |
| 113 if (enter.failed()) | 100 if (enter.failed()) |
| 114 return enter.retval(); | 101 return enter.retval(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 &GetPath, | 173 &GetPath, |
| 187 &GetParent, | 174 &GetParent, |
| 188 &MakeDirectory, | 175 &MakeDirectory, |
| 189 &Touch, | 176 &Touch, |
| 190 &Delete, | 177 &Delete, |
| 191 &Rename, | 178 &Rename, |
| 192 &Query, | 179 &Query, |
| 193 &ReadDirectoryEntries | 180 &ReadDirectoryEntries |
| 194 }; | 181 }; |
| 195 | 182 |
| 196 const PPB_FileRef_1_2 g_ppb_file_ref_thunk_1_2 = { | |
| 197 &Create, | |
| 198 &IsFileRef, | |
| 199 &GetFileSystemType, | |
| 200 &GetName, | |
| 201 &GetPath, | |
| 202 &GetParent, | |
| 203 &MakeDirectory_1_2, | |
| 204 &Touch, | |
| 205 &Delete, | |
| 206 &Rename, | |
| 207 &Query, | |
| 208 &ReadDirectoryEntries | |
| 209 }; | |
| 210 | |
| 211 const PPB_FileRefPrivate g_ppb_file_ref_private_thunk = { | 183 const PPB_FileRefPrivate g_ppb_file_ref_private_thunk = { |
| 212 &GetAbsolutePath | 184 &GetAbsolutePath |
| 213 }; | 185 }; |
| 214 | 186 |
| 215 } // namespace | 187 } // namespace |
| 216 | 188 |
| 217 const PPB_FileRef_1_0* GetPPB_FileRef_1_0_Thunk() { | 189 const PPB_FileRef_1_0* GetPPB_FileRef_1_0_Thunk() { |
| 218 return &g_ppb_file_ref_thunk_1_0; | 190 return &g_ppb_file_ref_thunk_1_0; |
| 219 } | 191 } |
| 220 | 192 |
| 221 const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() { | 193 const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() { |
| 222 return &g_ppb_file_ref_thunk_1_1; | 194 return &g_ppb_file_ref_thunk_1_1; |
| 223 } | 195 } |
| 224 | 196 |
| 225 const PPB_FileRef_1_2* GetPPB_FileRef_1_2_Thunk() { | |
| 226 return &g_ppb_file_ref_thunk_1_2; | |
| 227 } | |
| 228 | |
| 229 const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() { | 197 const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() { |
| 230 return &g_ppb_file_ref_private_thunk; | 198 return &g_ppb_file_ref_private_thunk; |
| 231 } | 199 } |
| 232 | 200 |
| 233 } // namespace thunk | 201 } // namespace thunk |
| 234 } // namespace ppapi | 202 } // namespace ppapi |
| OLD | NEW |