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

Unified Diff: ppapi/cpp/file_ref.h

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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/directory_entry.cc ('k') | ppapi/cpp/file_ref.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/file_ref.h
diff --git a/ppapi/cpp/file_ref.h b/ppapi/cpp/file_ref.h
index 49a4b98afe5f6429eca9144077a35df068252a00..b7e5e65eca75aaa155d8e262af18de73f0cc535f 100644
--- a/ppapi/cpp/file_ref.h
+++ b/ppapi/cpp/file_ref.h
@@ -17,6 +17,7 @@
namespace pp {
+class DirectoryEntry;
class FileSystem;
class CompletionCallback;
template <typename T> class CompletionCallbackWithOutput;
@@ -146,7 +147,6 @@ class FileRef : public Resource {
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
int32_t Rename(const FileRef& new_file_ref, const CompletionCallback& cc);
- ///
/// Query() queries info about a file or directory. You must have access to
/// read this file or directory if it exists in the external filesystem.
///
@@ -155,6 +155,30 @@ class FileRef : public Resource {
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
int32_t Query(const CompletionCallbackWithOutput<PP_FileInfo>& callback);
+
+ /// ReadDirectoryEntries() Reads all entries in the directory.
+ ///
+ /// @param[in] cc A <code>CompletionCallbackWithOutput</code> to be called
+ /// upon completion of ReadDirectoryEntries(). On success, the
+ /// directory entries will be passed to the given function.
+ ///
+ /// Normally you would use a CompletionCallbackFactory to allow callbacks to
+ /// be bound to your class. See completion_callback_factory.h for more
+ /// discussion on how to use this. Your callback will generally look like:
+ ///
+ /// @code
+ /// void OnReadDirectoryEntries(
+ /// int32_t result,
+ /// const std::vector<DirectoryEntry>& entries) {
+ /// if (result == PP_OK)
+ /// // use entries...
+ /// }
+ /// @endcode
+ ///
+ /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ int32_t ReadDirectoryEntries(
+ const CompletionCallbackWithOutput< std::vector<DirectoryEntry> >&
+ callback);
};
} // namespace pp
« no previous file with comments | « ppapi/cpp/directory_entry.cc ('k') | ppapi/cpp/file_ref.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698