| 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 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // necessary information to reply. | 77 // necessary information to reply. |
| 78 void ExecutePlatformGeneralCallback(ReplyMessageContext reply_context, | 78 void ExecutePlatformGeneralCallback(ReplyMessageContext reply_context, |
| 79 base::PlatformFileError error_code); | 79 base::PlatformFileError error_code); |
| 80 void ExecutePlatformOpenFileCallback(ReplyMessageContext reply_context, | 80 void ExecutePlatformOpenFileCallback(ReplyMessageContext reply_context, |
| 81 base::PlatformFileError error_code, | 81 base::PlatformFileError error_code, |
| 82 base::PassPlatformFile file); | 82 base::PassPlatformFile file); |
| 83 void ExecutePlatformOpenFileSystemURLCallback( | 83 void ExecutePlatformOpenFileSystemURLCallback( |
| 84 ReplyMessageContext reply_context, | 84 ReplyMessageContext reply_context, |
| 85 base::PlatformFileError error_code, | 85 base::PlatformFileError error_code, |
| 86 base::PassPlatformFile file, | 86 base::PassPlatformFile file, |
| 87 quota::QuotaLimitType quota_policy, |
| 87 const PluginDelegate::NotifyCloseFileCallback& callback); | 88 const PluginDelegate::NotifyCloseFileCallback& callback); |
| 88 void ExecutePlatformQueryCallback(ReplyMessageContext reply_context, | 89 void ExecutePlatformQueryCallback(ReplyMessageContext reply_context, |
| 89 base::PlatformFileError error_code, | 90 base::PlatformFileError error_code, |
| 90 const base::PlatformFileInfo& file_info); | 91 const base::PlatformFileInfo& file_info); |
| 91 void ExecutePlatformReadCallback(ReplyMessageContext reply_context, | 92 void ExecutePlatformReadCallback(ReplyMessageContext reply_context, |
| 92 base::PlatformFileError error_code, | 93 base::PlatformFileError error_code, |
| 93 const char* data, int bytes_read); | 94 const char* data, int bytes_read); |
| 94 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, | 95 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, |
| 95 base::PlatformFileError error_code, | 96 base::PlatformFileError error_code, |
| 96 int bytes_written); | 97 int bytes_written); |
| 97 void ExecutePlatformWillWriteCallback(ReplyMessageContext reply_context, | 98 void ExecutePlatformWillWriteCallback(ReplyMessageContext reply_context, |
| 98 base::PlatformFileError error_code, | 99 base::PlatformFileError error_code, |
| 99 int bytes_written); | 100 int bytes_written); |
| 100 | 101 |
| 101 // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed. | 102 // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed. |
| 102 webkit::ppapi::PluginDelegate* plugin_delegate_; // Not owned. | 103 webkit::ppapi::PluginDelegate* plugin_delegate_; // Not owned. |
| 103 | 104 |
| 104 base::PlatformFile file_; | 105 base::PlatformFile file_; |
| 105 | 106 |
| 106 // The file system type specified in the Open() call. This will be | 107 // The file system type specified in the Open() call. This will be |
| 107 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not | 108 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not |
| 108 // indicate that the open command actually succeeded. | 109 // indicate that the open command actually succeeded. |
| 109 PP_FileSystemType file_system_type_; | 110 PP_FileSystemType file_system_type_; |
| 110 | 111 |
| 111 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. | 112 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. |
| 112 GURL file_system_url_; | 113 GURL file_system_url_; |
| 113 | 114 |
| 115 // Used to check if we can pass file handle to plugins. |
| 116 quota::QuotaLimitType quota_policy_; |
| 117 |
| 114 // Callback function for notifying when the file handle is closed. | 118 // Callback function for notifying when the file handle is closed. |
| 115 PluginDelegate::NotifyCloseFileCallback notify_close_file_callback_; | 119 PluginDelegate::NotifyCloseFileCallback notify_close_file_callback_; |
| 116 | 120 |
| 117 // Pointer to a QuotaFileIO instance, which is valid only while a file | 121 // Pointer to a QuotaFileIO instance, which is valid only while a file |
| 118 // of type PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY} is opened. | 122 // of type PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY} is opened. |
| 119 scoped_ptr<webkit::ppapi::QuotaFileIO> quota_file_io_; | 123 scoped_ptr<webkit::ppapi::QuotaFileIO> quota_file_io_; |
| 120 | 124 |
| 121 bool is_running_in_process_; | 125 bool is_running_in_process_; |
| 122 | 126 |
| 123 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; | 127 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; |
| 124 | 128 |
| 125 ppapi::FileIOStateManager state_manager_; | 129 ppapi::FileIOStateManager state_manager_; |
| 126 | 130 |
| 127 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); | 131 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); |
| 128 }; | 132 }; |
| 129 | 133 |
| 130 } // namespace content | 134 } // namespace content |
| 131 | 135 |
| 132 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 136 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
| OLD | NEW |