OLD | NEW |
---|---|
(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/memory/weak_ptr.h" | |
12 #include "content/common/content_export.h" | |
13 #include "ppapi/host/host_message_context.h" | |
14 #include "ppapi/host/resource_host.h" | |
15 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" | |
16 | |
17 namespace ppapi { | |
18 struct PPB_FileRef_CreateInfo; | |
19 } | |
20 | |
21 namespace content { | |
22 | |
23 class RendererPpapiHost; | |
24 | |
25 class CONTENT_EXPORT PepperDirectoryReaderHost | |
26 : public ppapi::host::ResourceHost, | |
27 public base::SupportsWeakPtr<PepperDirectoryReaderHost> { | |
dmichael (off chromium)
2013/01/29 21:22:42
^^^ Please just use a WeakPtrFactory, since you on
nhiroki
2013/01/30 09:24:51
Done.
| |
28 public: | |
29 PepperDirectoryReaderHost(RendererPpapiHost* host, | |
30 PP_Instance instance, | |
31 PP_Resource resource); | |
32 virtual ~PepperDirectoryReaderHost(); | |
33 | |
34 virtual int32_t OnResourceMessageReceived( | |
35 const IPC::Message& msg, | |
36 ppapi::host::HostMessageContext* context) OVERRIDE; | |
37 | |
38 private: | |
39 static void OnGetNextEntryCallback(void* data, int32_t result); | |
40 int32_t OnGetNextEntry(ppapi::host::HostMessageContext* host_context, | |
41 ppapi::HostResource resource); | |
42 int32_t GetNextEntryInternal(); | |
43 void SendGetNextEntryReply(int32_t result); | |
44 void PushEntry(const PP_DirectoryEntry_Dev& entry); | |
45 | |
46 PP_Instance instance_; | |
47 PP_DirectoryEntry_Dev entry_; | |
48 ppapi::HostResource host_resource_; | |
49 | |
50 PP_Resource directory_reader_; | |
51 | |
52 ppapi::host::ReplyMessageContext reply_context_; | |
53 std::vector<ppapi::PPB_FileRef_CreateInfo> host_resources_; | |
54 std::vector<PP_FileType> file_types_; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(PepperDirectoryReaderHost); | |
57 }; | |
58 | |
59 } | |
60 | |
61 #endif // CONTENT_RENDERER_PEPPER_PEPPER_DIRECTORY_READER_HOST_H_ | |
OLD | NEW |