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

Unified Diff: content/renderer/pepper/pepper_file_io_host.h

Issue 20777009: A few more cleanups to the pepper code. Dispatch IPCs in the sockets implementations directly by ha… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix browsertest Created 7 years, 4 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_file_io_host.h
===================================================================
--- content/renderer/pepper/pepper_file_io_host.h (revision 215615)
+++ content/renderer/pepper/pepper_file_io_host.h (working copy)
@@ -10,9 +10,12 @@
#include "base/basictypes.h"
#include "base/callback_forward.h"
+#include "base/id_map.h"
#include "base/memory/weak_ptr.h"
#include "base/platform_file.h"
#include "content/public/renderer/renderer_ppapi_host.h"
+#include "ipc/ipc_listener.h"
+#include "ipc/ipc_platform_file.h"
#include "ppapi/host/host_message_context.h"
#include "ppapi/host/resource_host.h"
#include "ppapi/shared_impl/file_io_state_manager.h"
@@ -26,7 +29,8 @@
class QuotaFileIO;
class PepperFileIOHost : public ppapi::host::ResourceHost,
- public base::SupportsWeakPtr<PepperFileIOHost> {
+ public base::SupportsWeakPtr<PepperFileIOHost>,
+ public IPC::Listener {
public:
typedef base::Callback<void (base::PlatformFileError)>
NotifyCloseFileCallback;
@@ -42,6 +46,14 @@
ppapi::host::HostMessageContext* context) OVERRIDE;
private:
+ // IPC::Listener implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ void OnAsyncFileOpened(
+ base::PlatformFileError error_code,
+ IPC::PlatformFileForTransit file_for_transit,
+ int message_id);
+
int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context,
PP_Resource file_ref_resource,
int32_t open_flags);
@@ -124,6 +136,13 @@
ppapi::FileIOStateManager state_manager_;
+ int routing_id_;
+
+ typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)>
+ AsyncOpenFileCallback;
+
+ IDMap<AsyncOpenFileCallback> pending_async_open_files_;
+
DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost);
};
« no previous file with comments | « content/renderer/pepper/pepper_browser_connection.cc ('k') | content/renderer/pepper/pepper_file_io_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698