| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
| 14 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 14 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
| 15 #include "ipc/ipc_listener.h" | 15 #include "ipc/ipc_listener.h" |
| 16 #include "ipc/ipc_platform_file.h" | 16 #include "ipc/ipc_platform_file.h" |
| 17 #include "ppapi/c/pp_file_info.h" | 17 #include "ppapi/c/pp_file_info.h" |
| 18 #include "ppapi/c/pp_time.h" | 18 #include "ppapi/c/pp_time.h" |
| 19 #include "ppapi/host/host_message_context.h" | 19 #include "ppapi/host/host_message_context.h" |
| 20 #include "ppapi/host/resource_host.h" | 20 #include "ppapi/host/resource_host.h" |
| 21 #include "ppapi/shared_impl/file_io_state_manager.h" | 21 #include "ppapi/shared_impl/file_io_state_manager.h" |
| 22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 23 #include "webkit/browser/fileapi/file_system_context.h" | 23 #include "webkit/browser/fileapi/file_system_context.h" |
| 24 | 24 |
| 25 namespace ppapi { |
| 26 struct FileGrowth; |
| 27 } |
| 28 |
| 25 namespace content { | 29 namespace content { |
| 26 class PepperFileSystemBrowserHost; | 30 class PepperFileSystemBrowserHost; |
| 27 | 31 |
| 28 class PepperFileIOHost : public ppapi::host::ResourceHost, | 32 class PepperFileIOHost : public ppapi::host::ResourceHost, |
| 29 public base::SupportsWeakPtr<PepperFileIOHost> { | 33 public base::SupportsWeakPtr<PepperFileIOHost> { |
| 30 public: | 34 public: |
| 31 typedef base::Callback<void (base::PlatformFileError)> | 35 typedef base::Callback<void (base::PlatformFileError)> |
| 32 NotifyCloseFileCallback; | 36 NotifyCloseFileCallback; |
| 33 | 37 |
| 34 PepperFileIOHost(BrowserPpapiHostImpl* host, | 38 PepperFileIOHost(BrowserPpapiHostImpl* host, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 50 private: | 54 private: |
| 51 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, | 55 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, |
| 52 PP_Resource file_ref_resource, | 56 PP_Resource file_ref_resource, |
| 53 int32_t open_flags); | 57 int32_t open_flags); |
| 54 int32_t OnHostMsgTouch(ppapi::host::HostMessageContext* context, | 58 int32_t OnHostMsgTouch(ppapi::host::HostMessageContext* context, |
| 55 PP_Time last_access_time, | 59 PP_Time last_access_time, |
| 56 PP_Time last_modified_time); | 60 PP_Time last_modified_time); |
| 57 int32_t OnHostMsgSetLength(ppapi::host::HostMessageContext* context, | 61 int32_t OnHostMsgSetLength(ppapi::host::HostMessageContext* context, |
| 58 int64_t length); | 62 int64_t length); |
| 59 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context, | 63 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context, |
| 60 int64_t max_written_offset); | 64 const ppapi::FileGrowth& file_growth); |
| 61 int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context); | 65 int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context); |
| 62 int32_t OnHostMsgRequestOSFileHandle( | 66 int32_t OnHostMsgRequestOSFileHandle( |
| 63 ppapi::host::HostMessageContext* context); | 67 ppapi::host::HostMessageContext* context); |
| 64 | 68 |
| 65 void GotPluginAllowedToCallRequestOSFileHandle( | 69 void GotPluginAllowedToCallRequestOSFileHandle( |
| 66 ppapi::host::ReplyMessageContext reply_context, | 70 ppapi::host::ReplyMessageContext reply_context, |
| 67 bool plugin_allowed); | 71 bool plugin_allowed); |
| 68 | 72 |
| 69 // Callback handlers. These mostly convert the PlatformFileError to the | 73 // Callback handlers. These mostly convert the PlatformFileError to the |
| 70 // PP_Error code and send back the reply. Note that the argument | 74 // PP_Error code and send back the reply. Note that the argument |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 scoped_refptr<base::MessageLoopProxy> file_message_loop_; | 140 scoped_refptr<base::MessageLoopProxy> file_message_loop_; |
| 137 | 141 |
| 138 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; | 142 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; |
| 139 | 143 |
| 140 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); | 144 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); |
| 141 }; | 145 }; |
| 142 | 146 |
| 143 } // namespace content | 147 } // namespace content |
| 144 | 148 |
| 145 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 149 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
| OLD | NEW |