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 24 matching lines...) Expand all Loading... |
89 void ExecutePlatformQueryCallback(ReplyMessageContext reply_context, | 85 void ExecutePlatformQueryCallback(ReplyMessageContext reply_context, |
90 base::PlatformFileError error_code, | 86 base::PlatformFileError error_code, |
91 const base::PlatformFileInfo& file_info); | 87 const base::PlatformFileInfo& file_info); |
92 void ExecutePlatformReadCallback(ReplyMessageContext reply_context, | 88 void ExecutePlatformReadCallback(ReplyMessageContext reply_context, |
93 base::PlatformFileError error_code, | 89 base::PlatformFileError error_code, |
94 const char* data, int bytes_read); | 90 const char* data, int bytes_read); |
95 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, | 91 void ExecutePlatformWriteCallback(ReplyMessageContext reply_context, |
96 base::PlatformFileError error_code, | 92 base::PlatformFileError error_code, |
97 int bytes_written); | 93 int bytes_written); |
98 | 94 |
| 95 RendererPpapiHost* renderer_ppapi_host_; |
| 96 |
99 base::PlatformFile file_; | 97 base::PlatformFile file_; |
100 | 98 |
101 // The file system type specified in the Open() call. This will be | 99 // The file system type specified in the Open() call. This will be |
102 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not | 100 // PP_FILESYSTEMTYPE_INVALID before open was called. This value does not |
103 // indicate that the open command actually succeeded. | 101 // indicate that the open command actually succeeded. |
104 PP_FileSystemType file_system_type_; | 102 PP_FileSystemType file_system_type_; |
105 | 103 |
106 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. | 104 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. |
107 GURL file_system_url_; | 105 GURL file_system_url_; |
108 | 106 |
(...skipping 14 matching lines...) Expand all Loading... |
123 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; | 121 base::WeakPtrFactory<PepperFileIOHost> weak_factory_; |
124 | 122 |
125 ppapi::FileIOStateManager state_manager_; | 123 ppapi::FileIOStateManager state_manager_; |
126 | 124 |
127 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); | 125 DISALLOW_COPY_AND_ASSIGN(PepperFileIOHost); |
128 }; | 126 }; |
129 | 127 |
130 } // namespace content | 128 } // namespace content |
131 | 129 |
132 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ | 130 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_IO_HOST_H_ |
OLD | NEW |