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

Unified Diff: content/renderer/pepper/ppb_file_ref_impl.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
« no previous file with comments | « content/renderer/pepper/ppb_buffer_impl.cc ('k') | content/renderer/pepper/ppb_file_ref_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/ppb_file_ref_impl.h
===================================================================
--- content/renderer/pepper/ppb_file_ref_impl.h (revision 215615)
+++ content/renderer/pepper/ppb_file_ref_impl.h (working copy)
@@ -8,8 +8,13 @@
#include <string>
#include <vector>
+#include "base/callback_forward.h"
#include "base/files/file_path.h"
+#include "base/id_map.h"
#include "base/memory/linked_ptr.h"
+#include "base/platform_file.h"
+#include "ipc/ipc_listener.h"
+#include "ipc/ipc_platform_file.h"
#include "ppapi/c/pp_file_info.h"
#include "ppapi/c/ppb_file_ref.h"
#include "ppapi/shared_impl/ppb_file_ref_shared.h"
@@ -29,7 +34,8 @@
class PepperFileSystemHost;
-class PPB_FileRef_Impl : public ::ppapi::PPB_FileRef_Shared {
+class PPB_FileRef_Impl : public ::ppapi::PPB_FileRef_Shared,
+ public IPC::Listener {
public:
PPB_FileRef_Impl(const ::ppapi::PPB_FileRef_CreateInfo& info,
PP_Resource file_system);
@@ -95,6 +101,14 @@
private:
virtual ~PPB_FileRef_Impl();
+ // 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);
+
// Many mutation functions are allow only to non-external filesystems, This
// function returns true if the filesystem is opened and isn't external as an
// access check for these functions.
@@ -126,6 +140,13 @@
// return the identical string object every time it is requested.
scoped_refptr<StringVar> external_path_var_;
+ int routing_id_;
+
+ typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)>
+ AsyncOpenFileCallback;
+
+ IDMap<AsyncOpenFileCallback> pending_async_open_files_;
+
DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Impl);
};
« no previous file with comments | « content/renderer/pepper/ppb_buffer_impl.cc ('k') | content/renderer/pepper/ppb_file_ref_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698