Chromium Code Reviews| Index: ppapi/proxy/directory_reader_resource.h |
| diff --git a/ppapi/proxy/directory_reader_resource.h b/ppapi/proxy/directory_reader_resource.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a87983da328e56faafada3380b771f402a53fb20 |
| --- /dev/null |
| +++ b/ppapi/proxy/directory_reader_resource.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef PPAPI_PROXY_DIRECTORY_READER_H_ |
|
yzshen1
2013/01/24 21:55:43
Please name it after the path exactly.
nhiroki
2013/01/25 12:27:17
Good eye, thanks!
|
| +#define PPAPI_PROXY_DIRECTORY_READER_H_ |
| + |
| +#include <queue> |
| +#include <vector> |
| + |
| +#include "ppapi/proxy/plugin_resource.h" |
| +#include "ppapi/proxy/ppapi_proxy_export.h" |
| +#include "ppapi/shared_impl/ppb_file_ref_shared.h" |
| +#include "ppapi/shared_impl/tracked_callback.h" |
| +#include "ppapi/thunk/ppb_directory_reader_api.h" |
| + |
| +namespace ppapi { |
| +namespace proxy { |
| + |
| +class PPAPI_PROXY_EXPORT DirectoryReaderResource |
| + : public PluginResource, |
| + public NON_EXPORTED_BASE(thunk::PPB_DirectoryReader_API) { |
| + public: |
| + DirectoryReaderResource(Connection connection, |
| + PP_Instance instance, |
| + PP_Resource directory_ref); |
| + virtual ~DirectoryReaderResource() {} |
| + |
| + // Resource overrides. |
| + virtual thunk::PPB_DirectoryReader_API* AsPPB_DirectoryReader_API() OVERRIDE; |
|
yzshen1
2013/01/24 21:55:43
Please add include for OVERRIDE.
nhiroki
2013/01/25 12:27:17
Done.
|
| + |
| + // PPB_DirectoryReader_API. |
| + virtual int32_t GetNextEntry( |
| + PP_DirectoryEntry_Dev* entry, |
| + scoped_refptr<TrackedCallback> callback) OVERRIDE; |
| + |
| + private: |
| + void OnPluginMsgGetNextEntryReply( |
| + const ResourceMessageReplyParams& params, |
| + const std::vector<ppapi::PPB_FileRef_CreateInfo> infos, |
|
yzshen1
2013/01/24 21:55:43
Please use const &
nhiroki
2013/01/25 12:27:17
Done.
|
| + const std::vector<PP_FileType> file_types); |
|
yzshen1
2013/01/24 21:55:43
ditto
nhiroki
2013/01/25 12:27:17
Done.
|
| + bool FillUpEntry(); |
| + |
| + PP_Resource directory_ref_; |
|
yzshen1
2013/01/24 21:55:43
This might go away at any time because you don't h
nhiroki
2013/01/25 12:27:17
Added AddRefResource() and ReleaseResource().
|
| + |
| + PP_DirectoryEntry_Dev* entry_; |
| + scoped_refptr<TrackedCallback> callback_; |
| + |
| + std::queue<PP_DirectoryEntry_Dev> entries_; |
| + bool has_more_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DirectoryReaderResource); |
|
yzshen1
2013/01/24 21:55:43
Please add include.
nhiroki
2013/01/25 12:27:17
Done.
|
| +}; |
| + |
| +} // namespace proxy |
| +} // namespace ppapi |
| + |
| +#endif // PPAPI_PROXY_DIRECTORY_READER_H_ |