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

Side by Side Diff: content/renderer/pepper/pepper_directory_reader_host.h

Issue 11958033: Implement Pepper proxy for PPB_DirectoryReader (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge PPB_DirectoryReader_Impl into PepperDirectoryReaderHost Created 7 years, 10 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 CONTENT_RENDERER_PEPPER_PEPPER_DIRECTORY_READER_HOST_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_DIRECTORY_READER_HOST_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/files/file_util_proxy.h"
12 #include "base/memory/weak_ptr.h"
13 #include "content/common/content_export.h"
14 #include "ppapi/c/pp_file_info.h"
15 #include "ppapi/host/host_message_context.h"
16 #include "ppapi/host/resource_host.h"
17
18 namespace ppapi {
19 struct PPB_FileRef_CreateInfo;
20 }
21
22 namespace webkit {
23 namespace ppapi {
24 class PPB_FileRef_Impl;
25 }
26 }
27
28 namespace content {
29
30 class RendererPpapiHost;
31
32 class CONTENT_EXPORT PepperDirectoryReaderHost
33 : public ppapi::host::ResourceHost,
34 public base::SupportsWeakPtr<PepperDirectoryReaderHost> {
35 public:
36 PepperDirectoryReaderHost(RendererPpapiHost* host,
37 PP_Instance instance,
38 PP_Resource resource);
39 virtual ~PepperDirectoryReaderHost();
40
41 virtual int32_t OnResourceMessageReceived(
42 const IPC::Message& msg,
43 ppapi::host::HostMessageContext* context) OVERRIDE;
44
45 bool AddNewEntries(const std::vector<base::FileUtilProxy::Entry>& entries,
46 bool has_more);
47
48 private:
49 static void OnGetEntriesCallback(void* data, int32_t result);
50 int32_t OnGetEntries(ppapi::host::HostMessageContext* host_context,
51 ppapi::HostResource resource);
52 void SendGetEntriesReply(int32_t result);
53
54 RendererPpapiHost* renderer_ppapi_host_;
55 scoped_refptr<webkit::ppapi::PPB_FileRef_Impl> directory_ref_;
56
57 ppapi::host::ReplyMessageContext reply_context_;
58 std::vector<ppapi::PPB_FileRef_CreateInfo> host_resources_;
59 std::vector<PP_FileType> file_types_;
60 bool has_more_;
61
62 DISALLOW_COPY_AND_ASSIGN(PepperDirectoryReaderHost);
63 };
64
65 }
66
67 #endif // CONTENT_RENDERER_PEPPER_PEPPER_DIRECTORY_READER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698