Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: ppapi/thunk/ppb_file_ref_thunk.cc

Issue 113363004: PPAPI: Add new PPB_FileRef.MakeDirectory to support exclusive operation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/thunk/ppb_file_ref_api.h ('k') | ppapi/thunk/thunk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 int32_t flag = make_ancestors ? PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS
91 enter.callback())); 91 : PP_MAKEDIRECTORYFLAG_NONE;
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()));
92 } 105 }
93 106
94 int32_t Touch(PP_Resource file_ref, 107 int32_t Touch(PP_Resource file_ref,
95 PP_Time last_access_time, 108 PP_Time last_access_time,
96 PP_Time last_modified_time, 109 PP_Time last_modified_time,
97 PP_CompletionCallback callback) { 110 PP_CompletionCallback callback) {
98 VLOG(4) << "PPB_FileRef::Touch()"; 111 VLOG(4) << "PPB_FileRef::Touch()";
99 EnterFileRef enter(file_ref, callback, true); 112 EnterFileRef enter(file_ref, callback, true);
100 if (enter.failed()) 113 if (enter.failed())
101 return enter.retval(); 114 return enter.retval();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 &GetPath, 186 &GetPath,
174 &GetParent, 187 &GetParent,
175 &MakeDirectory, 188 &MakeDirectory,
176 &Touch, 189 &Touch,
177 &Delete, 190 &Delete,
178 &Rename, 191 &Rename,
179 &Query, 192 &Query,
180 &ReadDirectoryEntries 193 &ReadDirectoryEntries
181 }; 194 };
182 195
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
183 const PPB_FileRefPrivate g_ppb_file_ref_private_thunk = { 211 const PPB_FileRefPrivate g_ppb_file_ref_private_thunk = {
184 &GetAbsolutePath 212 &GetAbsolutePath
185 }; 213 };
186 214
187 } // namespace 215 } // namespace
188 216
189 const PPB_FileRef_1_0* GetPPB_FileRef_1_0_Thunk() { 217 const PPB_FileRef_1_0* GetPPB_FileRef_1_0_Thunk() {
190 return &g_ppb_file_ref_thunk_1_0; 218 return &g_ppb_file_ref_thunk_1_0;
191 } 219 }
192 220
193 const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() { 221 const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() {
194 return &g_ppb_file_ref_thunk_1_1; 222 return &g_ppb_file_ref_thunk_1_1;
195 } 223 }
196 224
225 const PPB_FileRef_1_2* GetPPB_FileRef_1_2_Thunk() {
226 return &g_ppb_file_ref_thunk_1_2;
227 }
228
197 const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() { 229 const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() {
198 return &g_ppb_file_ref_private_thunk; 230 return &g_ppb_file_ref_private_thunk;
199 } 231 }
200 232
201 } // namespace thunk 233 } // namespace thunk
202 } // namespace ppapi 234 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_file_ref_api.h ('k') | ppapi/thunk/thunk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698