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

Side by Side Diff: ppapi/cpp/file_ref.cc

Issue 14784002: Move DirectoryReader::ReadEntries to FileRef::ReadDirectoryEntries (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebased 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
« no previous file with comments | « ppapi/cpp/file_ref.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('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/cpp/file_ref.h" 5 #include "ppapi/cpp/file_ref.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/cpp/completion_callback.h" 8 #include "ppapi/cpp/completion_callback.h"
9 #include "ppapi/cpp/directory_entry.h"
9 #include "ppapi/cpp/file_system.h" 10 #include "ppapi/cpp/file_system.h"
10 #include "ppapi/cpp/module_impl.h" 11 #include "ppapi/cpp/module_impl.h"
11 12
12
13 namespace pp { 13 namespace pp {
14 14
15 namespace { 15 namespace {
16 16
17 template <> const char* interface_name<PPB_FileRef_1_0>() { 17 template <> const char* interface_name<PPB_FileRef_1_0>() {
18 return PPB_FILEREF_INTERFACE_1_0; 18 return PPB_FILEREF_INTERFACE_1_0;
19 } 19 }
20 20
21 template <> const char* interface_name<PPB_FileRef_1_1>() { 21 template <> const char* interface_name<PPB_FileRef_1_1>() {
22 return PPB_FILEREF_INTERFACE_1_1; 22 return PPB_FILEREF_INTERFACE_1_1;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return cc.MayForce(PP_ERROR_NOINTERFACE); 163 return cc.MayForce(PP_ERROR_NOINTERFACE);
164 } 164 }
165 165
166 int32_t FileRef::Query(const CompletionCallbackWithOutput<PP_FileInfo>& cc) { 166 int32_t FileRef::Query(const CompletionCallbackWithOutput<PP_FileInfo>& cc) {
167 if (!has_interface<PPB_FileRef_1_1>()) 167 if (!has_interface<PPB_FileRef_1_1>())
168 return cc.MayForce(PP_ERROR_NOINTERFACE); 168 return cc.MayForce(PP_ERROR_NOINTERFACE);
169 return get_interface<PPB_FileRef_1_1>()->Query( 169 return get_interface<PPB_FileRef_1_1>()->Query(
170 pp_resource(), cc.output(), cc.pp_completion_callback()); 170 pp_resource(), cc.output(), cc.pp_completion_callback());
171 } 171 }
172 172
173 int32_t FileRef::ReadDirectoryEntries(
174 const CompletionCallbackWithOutput<std::vector<DirectoryEntry> >&
175 callback) {
176 if (!has_interface<PPB_FileRef_1_1>())
177 return callback.MayForce(PP_ERROR_NOINTERFACE);
178 return get_interface<PPB_FileRef_1_1>()->ReadDirectoryEntries(
179 pp_resource(), callback.output(), callback.pp_completion_callback());
180 }
173 181
174 } // namespace pp 182 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/file_ref.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698