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