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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_directory_reader_host.h
diff --git a/content/renderer/pepper/pepper_directory_reader_host.h b/content/renderer/pepper/pepper_directory_reader_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..dc6871aee8efc4c3d418b31f64a07d0c2bb717f2
--- /dev/null
+++ b/content/renderer/pepper/pepper_directory_reader_host.h
@@ -0,0 +1,67 @@
+// 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 CONTENT_RENDERER_PEPPER_PEPPER_DIRECTORY_READER_HOST_H_
+#define CONTENT_RENDERER_PEPPER_PEPPER_DIRECTORY_READER_HOST_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/files/file_util_proxy.h"
+#include "base/memory/weak_ptr.h"
+#include "content/common/content_export.h"
+#include "ppapi/c/pp_file_info.h"
+#include "ppapi/host/host_message_context.h"
+#include "ppapi/host/resource_host.h"
+
+namespace ppapi {
+struct PPB_FileRef_CreateInfo;
+}
+
+namespace webkit {
+namespace ppapi {
+class PPB_FileRef_Impl;
+}
+}
+
+namespace content {
+
+class RendererPpapiHost;
+
+class CONTENT_EXPORT PepperDirectoryReaderHost
+ : public ppapi::host::ResourceHost,
+ public base::SupportsWeakPtr<PepperDirectoryReaderHost> {
+ public:
+ PepperDirectoryReaderHost(RendererPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource);
+ virtual ~PepperDirectoryReaderHost();
+
+ virtual int32_t OnResourceMessageReceived(
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) OVERRIDE;
+
+ bool AddNewEntries(const std::vector<base::FileUtilProxy::Entry>& entries,
+ bool has_more);
+
+ private:
+ static void OnGetEntriesCallback(void* data, int32_t result);
+ int32_t OnGetEntries(ppapi::host::HostMessageContext* host_context,
+ ppapi::HostResource resource);
+ void SendGetEntriesReply(int32_t result);
+
+ RendererPpapiHost* renderer_ppapi_host_;
+ scoped_refptr<webkit::ppapi::PPB_FileRef_Impl> directory_ref_;
+
+ ppapi::host::ReplyMessageContext reply_context_;
+ std::vector<ppapi::PPB_FileRef_CreateInfo> host_resources_;
+ std::vector<PP_FileType> file_types_;
+ bool has_more_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperDirectoryReaderHost);
+};
+
+}
+
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_DIRECTORY_READER_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698