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

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

Issue 14784002: Move DirectoryReader::ReadEntries to FileRef::ReadDirectoryEntries (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address dmichael's comments Created 7 years, 7 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
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/proxy_lock.h" 10 #include "ppapi/shared_impl/proxy_lock.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 int32_t Query(PP_Resource file_ref, 109 int32_t Query(PP_Resource file_ref,
110 PP_FileInfo* info, 110 PP_FileInfo* info,
111 PP_CompletionCallback callback) { 111 PP_CompletionCallback callback) {
112 EnterFileRef enter(file_ref, callback, true); 112 EnterFileRef enter(file_ref, callback, true);
113 if (enter.failed()) 113 if (enter.failed())
114 return enter.retval(); 114 return enter.retval();
115 return enter.SetResult(enter.object()->Query(info, 115 return enter.SetResult(enter.object()->Query(info,
116 enter.callback())); 116 enter.callback()));
117 } 117 }
118 118
119 int32_t ReadEntries(PP_Resource file_ref,
120 PP_ArrayOutput output,
121 PP_CompletionCallback callback) {
122 EnterFileRef enter(file_ref, callback, true);
123 if (enter.failed())
124 return enter.retval();
125 return enter.SetResult(enter.object()->ReadEntries(output, enter.callback()));
126 }
127
119 PP_Var GetAbsolutePath(PP_Resource file_ref) { 128 PP_Var GetAbsolutePath(PP_Resource file_ref) {
120 EnterFileRef enter(file_ref, true); 129 EnterFileRef enter(file_ref, true);
121 if (enter.failed()) 130 if (enter.failed())
122 return PP_MakeUndefined(); 131 return PP_MakeUndefined();
123 return enter.object()->GetAbsolutePath(); 132 return enter.object()->GetAbsolutePath();
124 } 133 }
125 134
126 const PPB_FileRef_1_0 g_ppb_file_ref_thunk_1_0 = { 135 const PPB_FileRef_1_0 g_ppb_file_ref_thunk_1_0 = {
127 &Create, 136 &Create,
128 &IsFileRef, 137 &IsFileRef,
(...skipping 11 matching lines...) Expand all
140 &Create, 149 &Create,
141 &IsFileRef, 150 &IsFileRef,
142 &GetFileSystemType, 151 &GetFileSystemType,
143 &GetName, 152 &GetName,
144 &GetPath, 153 &GetPath,
145 &GetParent, 154 &GetParent,
146 &MakeDirectory, 155 &MakeDirectory,
147 &Touch, 156 &Touch,
148 &Delete, 157 &Delete,
149 &Rename, 158 &Rename,
150 &Query 159 &Query,
160 &ReadEntries
151 }; 161 };
152 162
153 const PPB_FileRefPrivate g_ppb_file_ref_private_thunk = { 163 const PPB_FileRefPrivate g_ppb_file_ref_private_thunk = {
154 &GetAbsolutePath 164 &GetAbsolutePath
155 }; 165 };
156 166
157 } // namespace 167 } // namespace
158 168
159 const PPB_FileRef_1_0* GetPPB_FileRef_1_0_Thunk() { 169 const PPB_FileRef_1_0* GetPPB_FileRef_1_0_Thunk() {
160 return &g_ppb_file_ref_thunk_1_0; 170 return &g_ppb_file_ref_thunk_1_0;
161 } 171 }
162 172
163 const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() { 173 const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() {
164 return &g_ppb_file_ref_thunk_1_1; 174 return &g_ppb_file_ref_thunk_1_1;
165 } 175 }
166 176
167 const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() { 177 const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() {
168 return &g_ppb_file_ref_private_thunk; 178 return &g_ppb_file_ref_private_thunk;
169 } 179 }
170 180
171 } // namespace thunk 181 } // namespace thunk
172 } // namespace ppapi 182 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698