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