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

Side by Side Diff: ppapi/proxy/directory_reader_resource.h

Issue 11958033: Implement Pepper proxy for PPB_DirectoryReader (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 PPAPI_PROXY_DIRECTORY_READER_H_
6 #define PPAPI_PROXY_DIRECTORY_READER_H_
7
8 #include <queue>
9
10 #include "ppapi/proxy/plugin_resource.h"
11 #include "ppapi/proxy/ppapi_proxy_export.h"
12 #include "ppapi/shared_impl/ppb_file_ref_shared.h"
13 #include "ppapi/shared_impl/tracked_callback.h"
14 #include "ppapi/thunk/ppb_directory_reader_api.h"
15
16 namespace ppapi {
17 namespace proxy {
18
19 class PPAPI_PROXY_EXPORT DirectoryReaderResource
20 : public PluginResource,
21 public NON_EXPORTED_BASE(thunk::PPB_DirectoryReader_API) {
22 public:
23 DirectoryReaderResource(Connection connection,
24 PP_Instance instance,
25 PP_Resource directory_ref);
26 virtual ~DirectoryReaderResource() {}
27
28 // Resource overrides.
29 virtual thunk::PPB_DirectoryReader_API* AsPPB_DirectoryReader_API() OVERRIDE;
30
31 // PPB_DirectoryReader_API.
32 virtual int32_t GetNextEntry(
33 PP_DirectoryEntry_Dev* entry,
34 scoped_refptr<TrackedCallback> callback) OVERRIDE;
35
36 private:
37 void OnPluginMsgGetNextEntryReply(
38 const ResourceMessageReplyParams& params,
39 const std::vector<ppapi::PPB_FileRef_CreateInfo> infos,
40 const std::vector<PP_FileType> file_types);
41 bool FillUpEntry();
42
43 PP_Resource directory_ref_;
44
45 PP_DirectoryEntry_Dev* entry_;
46 scoped_refptr<TrackedCallback> callback_;
47
48 std::queue<PP_DirectoryEntry_Dev> entries_;
49 bool has_more_;
50
51 DISALLOW_COPY_AND_ASSIGN(DirectoryReaderResource);
52 };
53
54 } // namespace proxy
55 } // namespace ppapi
56
57 #endif // PPAPI_PROXY_DIRECTORY_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698