| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
| 16 #include "content/public/renderer/renderer_ppapi_host.h" | 16 #include "content/public/renderer/renderer_ppapi_host.h" |
| 17 #include "ipc/ipc_listener.h" | 17 #include "ipc/ipc_listener.h" |
| 18 #include "ipc/ipc_platform_file.h" | 18 #include "ipc/ipc_platform_file.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 "ppapi/thunk/ppb_file_ref_api.h" | 22 #include "ppapi/thunk/ppb_file_ref_api.h" |
| 23 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 24 #include "webkit/common/quota/quota_types.h" | 24 #include "webkit/common/quota/quota_types.h" |
| 25 | 25 |
| 26 using ppapi::host::ReplyMessageContext; | 26 using ppapi::host::ReplyMessageContext; |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 class PepperPluginInstanceImpl; | |
| 30 class QuotaFileIO; | 29 class QuotaFileIO; |
| 31 | 30 |
| 32 class PepperFileIOHost : public ppapi::host::ResourceHost, | 31 class PepperFileIOHost : public ppapi::host::ResourceHost, |
| 33 public base::SupportsWeakPtr<PepperFileIOHost>, | 32 public base::SupportsWeakPtr<PepperFileIOHost>, |
| 34 public IPC::Listener { | 33 public IPC::Listener { |
| 35 public: | 34 public: |
| 36 typedef base::Callback<void (base::PlatformFileError)> | 35 typedef base::Callback<void (base::PlatformFileError)> |
| 37 NotifyCloseFileCallback; | 36 NotifyCloseFileCallback; |
| 38 | 37 |
| 39 PepperFileIOHost(RendererPpapiHost* host, | 38 PepperFileIOHost(RendererPpapiHost* host, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 base::PlatformFileError error_code, | 98 base::PlatformFileError error_code, |
| 100 const base::PlatformFileInfo& file_info); | 99 const base::PlatformFileInfo& file_info); |
| 101 void ExecutePlatformReadCallback(ReplyMessageContext reply_context, | 100 void ExecutePlatformReadCallback(ReplyMessageContext reply_context, |
| 102 base::PlatformFileError error_code, | 101 base::PlatformFileError error_code, |
| 103 const char* data, int bytes_read); | 102 const char* data, int bytes_read); |
| 104 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, | 103 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, |
| 105 base::PlatformFileError error_code, | 104 base::PlatformFileError error_code, |
| 106 int bytes_written); | 105 int bytes_written); |
| 107 | 106 |
| 108 RendererPpapiHost* renderer_ppapi_host_; | 107 RendererPpapiHost* renderer_ppapi_host_; |
| 109 PepperPluginInstanceImpl* plugin_instance_; | 108 |
| 110 base::PlatformFile file_; | 109 base::PlatformFile file_; |
| 111 | 110 |
| 112 // The file system type specified in the Open() call. This will be | 111 // The file system type specified in the Open() call. This will be |
| 113 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not | 112 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not |
| 114 // indicate that the open command actually succeeded. | 113 // indicate that the open command actually succeeded. |
| 115 PP_FileSystemType file_system_type_; | 114 PP_FileSystemType file_system_type_; |
| 116 | 115 |
| 117 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. | 116 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. |
| 118 GURL file_system_url_; | 117 GURL file_system_url_; |
| 119 | 118 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 141 IDMap<AsyncOpenFileCallback> pending_async_open_files_; | 140 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
| 142 | 141 |
| 143 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; | 142 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; |
| 144 | 143 |
| 145 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); | 144 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); |
| 146 }; | 145 }; |
| 147 | 146 |
| 148 } // namespace content | 147 } // namespace content |
| 149 | 148 |
| 150 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 149 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
| OLD | NEW |