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

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: fix DirectoryReader creation thunk (crbug/171539) 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..3c5bfc67bf3681c5e6a424e4ffcc0094d881740e
--- /dev/null
+++ b/content/renderer/pepper/pepper_directory_reader_host.h
@@ -0,0 +1,61 @@
+// 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 "content/common/content_export.h"
+#include "ipc/ipc_message.h"
+#include "ppapi/host/host_message_context.h"
+#include "ppapi/host/resource_host.h"
+#include "ppapi/proxy/enter_proxy.h"
yzshen1 2013/01/24 21:55:43 This can be moved to the .cc file. (And some other
nhiroki 2013/01/25 12:27:17 Done.
+#include "ppapi/proxy/resource_message_params.h"
+#include "ppapi/shared_impl/ppb_file_ref_shared.h"
yzshen1 2013/01/24 21:55:43 Could you please forward declare things like this
nhiroki 2013/01/25 12:27:17 Done.
+#include "ppapi/thunk/resource_creation_api.h"
yzshen1 2013/01/24 21:55:43 you don't need this.
nhiroki 2013/01/25 12:27:17 Done.
+#include "webkit/plugins/ppapi/ppb_directory_reader_impl.h"
+
+namespace content {
+
+class RendererPpapiHost;
+
+class CONTENT_EXPORT PepperDirectoryReaderHost
yzshen1 2013/01/24 21:55:43 Is it better to remove the ppb_directory_reader_im
nhiroki 2013/01/25 12:27:17 I think so too! There is some redundant codes here
yzshen1 2013/01/28 17:52:34 Do you mean you will do it in this CL or a separat
nhiroki 2013/01/29 05:10:34 I intended to make a separate CL. Okay, let me see
+ : public ppapi::host::ResourceHost,
+ public base::SupportsWeakPtr<PepperDirectoryReaderHost> {
yzshen1 2013/01/24 21:55:43 add include, please.
nhiroki 2013/01/25 12:27:17 Done.
+ 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;
+
+ private:
+ static void OnGetNextEntryCallback(void* data, int32_t result);
+ int32_t OnGetNextEntry(ppapi::host::HostMessageContext* host_context,
+ ppapi::HostResource resource);
+ int32_t GetNextEntryInternal();
+ void SendGetNextEntryReply(int32_t result);
+ void PushEntry(const PP_DirectoryEntry_Dev& entry);
+
+ PP_Instance instance_;
+ PP_DirectoryEntry_Dev entry_;
+ ppapi::HostResource host_resource_;
+
+ PP_Resource directory_reader_;
+
+ ppapi::host::ReplyMessageContext reply_context_;
+ std::vector<ppapi::PPB_FileRef_CreateInfo> host_resources_;
+ std::vector<PP_FileType> file_types_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperDirectoryReaderHost);
+};
+
+}
+
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_DIRECTORY_READER_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698