| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_DIRECTORY_READER_IMPL_H_ | |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_DIRECTORY_READER_IMPL_H_ | |
| 7 | |
| 8 #include <queue> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/files/file_util_proxy.h" | |
| 12 #include "ppapi/shared_impl/resource.h" | |
| 13 #include "ppapi/thunk/ppb_directory_reader_api.h" | |
| 14 | |
| 15 struct PP_DirectoryEntry_Dev; | |
| 16 | |
| 17 namespace webkit { | |
| 18 namespace ppapi { | |
| 19 | |
| 20 class PPB_FileRef_Impl; | |
| 21 | |
| 22 class PPB_DirectoryReader_Impl | |
| 23 : public ::ppapi::Resource, | |
| 24 public ::ppapi::thunk::PPB_DirectoryReader_API { | |
| 25 public: | |
| 26 explicit PPB_DirectoryReader_Impl(PPB_FileRef_Impl* directory_ref); | |
| 27 virtual ~PPB_DirectoryReader_Impl(); | |
| 28 | |
| 29 static PP_Resource Create(PP_Resource directory_ref); | |
| 30 | |
| 31 // Resource overrides. | |
| 32 virtual ::ppapi::thunk::PPB_DirectoryReader_API* AsPPB_DirectoryReader_API() | |
| 33 OVERRIDE; | |
| 34 | |
| 35 // PPB_DirectoryReader_API implementation. | |
| 36 virtual int32_t GetNextEntry( | |
| 37 PP_DirectoryEntry_Dev* entry, | |
| 38 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; | |
| 39 | |
| 40 void AddNewEntries(const std::vector<base::FileUtilProxy::Entry>& entries, | |
| 41 bool has_more); | |
| 42 | |
| 43 private: | |
| 44 bool FillUpEntry(); | |
| 45 | |
| 46 scoped_refptr<PPB_FileRef_Impl> directory_ref_; | |
| 47 std::queue<base::FileUtilProxy::Entry> entries_; | |
| 48 bool has_more_; | |
| 49 PP_DirectoryEntry_Dev* entry_; | |
| 50 }; | |
| 51 | |
| 52 } // namespace ppapi | |
| 53 } // namespace webkit | |
| 54 | |
| 55 #endif // WEBKIT_PLUGINS_PPAPI_PPB_DIRECTORY_READER_IMPL_H_ | |
| OLD | NEW |