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

Side by Side Diff: ppapi/cpp/dev/directory_reader_dev.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/dev/directory_reader_dev.h ('k') | ppapi/cpp/dev/file_chooser_dev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ppapi/cpp/dev/directory_reader_dev.h"
6
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/cpp/completion_callback.h"
9 #include "ppapi/cpp/dev/directory_entry_dev.h"
10 #include "ppapi/cpp/file_ref.h"
11 #include "ppapi/cpp/module.h"
12 #include "ppapi/cpp/module_impl.h"
13
14 namespace pp {
15
16 namespace {
17
18 template <> const char* interface_name<PPB_DirectoryReader_Dev_0_6>() {
19 return PPB_DIRECTORYREADER_DEV_INTERFACE_0_6;
20 }
21
22 } // namespace
23
24 DirectoryReader_Dev::DirectoryReader_Dev(const FileRef& directory_ref) {
25 if (!has_interface<PPB_DirectoryReader_Dev_0_6>())
26 return;
27 PassRefFromConstructor(get_interface<PPB_DirectoryReader_Dev_0_6>()->Create(
28 directory_ref.pp_resource()));
29 }
30
31 DirectoryReader_Dev::DirectoryReader_Dev(const DirectoryReader_Dev& other)
32 : Resource(other) {
33 }
34
35 int32_t DirectoryReader_Dev::ReadEntries(
36 const CompletionCallbackWithOutput< std::vector<DirectoryEntry_Dev> >&
37 callback) {
38 if (!has_interface<PPB_DirectoryReader_Dev_0_6>())
39 return callback.MayForce(PP_ERROR_NOINTERFACE);
40 return get_interface<PPB_DirectoryReader_Dev_0_6>()->ReadEntries(
41 pp_resource(), callback.output(), callback.pp_completion_callback());
42 }
43
44 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/directory_reader_dev.h ('k') | ppapi/cpp/dev/file_chooser_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698