| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // ppapi::host::ResourceHost override. | 33 // ppapi::host::ResourceHost override. |
| 34 virtual int32_t OnResourceMessageReceived( | 34 virtual int32_t OnResourceMessageReceived( |
| 35 const IPC::Message& msg, | 35 const IPC::Message& msg, |
| 36 ppapi::host::HostMessageContext* context) OVERRIDE; | 36 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, | 39 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, |
| 40 PP_Resource file_ref_resource, | 40 PP_Resource file_ref_resource, |
| 41 int32_t open_flags); | 41 int32_t open_flags); |
| 42 int32_t OnHostMsgQuery(ppapi::host::HostMessageContext* context); | |
| 43 int32_t OnHostMsgTouch(ppapi::host::HostMessageContext* context, | 42 int32_t OnHostMsgTouch(ppapi::host::HostMessageContext* context, |
| 44 PP_Time last_access_time, | 43 PP_Time last_access_time, |
| 45 PP_Time last_modified_time); | 44 PP_Time last_modified_time); |
| 46 int32_t OnHostMsgRead(ppapi::host::HostMessageContext* context, | |
| 47 int64_t offset, | |
| 48 int32_t bytes_to_read); | |
| 49 int32_t OnHostMsgWrite(ppapi::host::HostMessageContext* context, | 45 int32_t OnHostMsgWrite(ppapi::host::HostMessageContext* context, |
| 50 int64_t offset, | 46 int64_t offset, |
| 51 const std::string& buffer); | 47 const std::string& buffer); |
| 52 int32_t OnHostMsgSetLength(ppapi::host::HostMessageContext* context, | 48 int32_t OnHostMsgSetLength(ppapi::host::HostMessageContext* context, |
| 53 int64_t length); | 49 int64_t length); |
| 54 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context); | 50 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context); |
| 55 int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context); | 51 int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context); |
| 56 // Private API. | 52 // Private API. |
| 57 int32_t OnHostMsgRequestOSFileHandle( | 53 int32_t OnHostMsgRequestOSFileHandle( |
| 58 ppapi::host::HostMessageContext* context); | 54 ppapi::host::HostMessageContext* context); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 73 base::PlatformFileError error_code); | 69 base::PlatformFileError error_code); |
| 74 void ExecutePlatformOpenFileCallback(ReplyMessageContext reply_context, | 70 void ExecutePlatformOpenFileCallback(ReplyMessageContext reply_context, |
| 75 base::PlatformFileError error_code, | 71 base::PlatformFileError error_code, |
| 76 base::PassPlatformFile file); | 72 base::PassPlatformFile file); |
| 77 void ExecutePlatformOpenFileSystemURLCallback( | 73 void ExecutePlatformOpenFileSystemURLCallback( |
| 78 ReplyMessageContext reply_context, | 74 ReplyMessageContext reply_context, |
| 79 base::PlatformFileError error_code, | 75 base::PlatformFileError error_code, |
| 80 base::PassPlatformFile file, | 76 base::PassPlatformFile file, |
| 81 quota::QuotaLimitType quota_policy, | 77 quota::QuotaLimitType quota_policy, |
| 82 const PluginDelegate::NotifyCloseFileCallback& callback); | 78 const PluginDelegate::NotifyCloseFileCallback& callback); |
| 83 void ExecutePlatformQueryCallback(ReplyMessageContext reply_context, | |
| 84 base::PlatformFileError error_code, | |
| 85 const base::PlatformFileInfo& file_info); | |
| 86 void ExecutePlatformReadCallback(ReplyMessageContext reply_context, | |
| 87 base::PlatformFileError error_code, | |
| 88 const char* data, int bytes_read); | |
| 89 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, | 79 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, |
| 90 base::PlatformFileError error_code, | 80 base::PlatformFileError error_code, |
| 91 int bytes_written); | 81 int bytes_written); |
| 92 | 82 |
| 83 RendererPpapiHost* renderer_ppapi_host_; |
| 84 |
| 93 // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed. | 85 // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed. |
| 94 PluginDelegate* plugin_delegate_; // Not owned. | 86 PluginDelegate* plugin_delegate_; // Not owned. |
| 95 | 87 |
| 96 base::PlatformFile file_; | 88 base::PlatformFile file_; |
| 97 | 89 |
| 98 // The file system type specified in the Open() call. This will be | 90 // The file system type specified in the Open() call. This will be |
| 99 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not | 91 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not |
| 100 // indicate that the open command actually succeeded. | 92 // indicate that the open command actually succeeded. |
| 101 PP_FileSystemType file_system_type_; | 93 PP_FileSystemType file_system_type_; |
| 102 | 94 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 120 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; | 112 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; |
| 121 | 113 |
| 122 ppapi::FileIOStateManager state_manager_; | 114 ppapi::FileIOStateManager state_manager_; |
| 123 | 115 |
| 124 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); | 116 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); |
| 125 }; | 117 }; |
| 126 | 118 |
| 127 } // namespace content | 119 } // namespace content |
| 128 | 120 |
| 129 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 121 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
| OLD | NEW |