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 WEBKIT_PLUGINS_PPAPI_PPB_FILE_IO_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FILE_IO_IMPL_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_IO_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FILE_IO_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // Returns the plugin delegate for this resource if it exists, or NULL if it | 68 // Returns the plugin delegate for this resource if it exists, or NULL if it |
69 // doesn't. Calling code should always check for NULL. | 69 // doesn't. Calling code should always check for NULL. |
70 PluginDelegate* GetPluginDelegate(); | 70 PluginDelegate* GetPluginDelegate(); |
71 | 71 |
72 // Callback handlers. These mostly convert the PlatformFileError to the | 72 // Callback handlers. These mostly convert the PlatformFileError to the |
73 // PP_Error code and call the shared (non-"Platform") version. | 73 // PP_Error code and call the shared (non-"Platform") version. |
74 void ExecutePlatformGeneralCallback(base::PlatformFileError error_code); | 74 void ExecutePlatformGeneralCallback(base::PlatformFileError error_code); |
75 void ExecutePlatformOpenFileCallback(base::PlatformFileError error_code, | 75 void ExecutePlatformOpenFileCallback(base::PlatformFileError error_code, |
76 base::PassPlatformFile file); | 76 base::PassPlatformFile file); |
| 77 void ExecutePlatformOpenFileSystemURLCallback( |
| 78 base::PlatformFileError error_code, |
| 79 base::PassPlatformFile file, |
| 80 const PluginDelegate::NotifyCloseFileCallback& callback); |
77 void ExecutePlatformQueryCallback(base::PlatformFileError error_code, | 81 void ExecutePlatformQueryCallback(base::PlatformFileError error_code, |
78 const base::PlatformFileInfo& file_info); | 82 const base::PlatformFileInfo& file_info); |
79 void ExecutePlatformReadCallback(base::PlatformFileError error_code, | 83 void ExecutePlatformReadCallback(base::PlatformFileError error_code, |
80 const char* data, int bytes_read); | 84 const char* data, int bytes_read); |
81 void ExecutePlatformWriteCallback(base::PlatformFileError error_code, | 85 void ExecutePlatformWriteCallback(base::PlatformFileError error_code, |
82 int bytes_written); | 86 int bytes_written); |
83 void ExecutePlatformWillWriteCallback(base::PlatformFileError error_code, | 87 void ExecutePlatformWillWriteCallback(base::PlatformFileError error_code, |
84 int bytes_written); | 88 int bytes_written); |
85 | 89 |
86 base::PlatformFile file_; | 90 base::PlatformFile file_; |
87 | 91 |
88 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. | 92 // Valid only for PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. |
89 GURL file_system_url_; | 93 GURL file_system_url_; |
90 | 94 |
| 95 // Callback function for notifying when the file handle is closed. |
| 96 PluginDelegate::NotifyCloseFileCallback notify_close_file_callback_; |
| 97 |
91 // Pointer to a QuotaFileIO instance, which is valid only while a file | 98 // Pointer to a QuotaFileIO instance, which is valid only while a file |
92 // of type PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY} is opened. | 99 // of type PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY} is opened. |
93 scoped_ptr<QuotaFileIO> quota_file_io_; | 100 scoped_ptr<QuotaFileIO> quota_file_io_; |
94 | 101 |
95 base::WeakPtrFactory<PPB_FileIO_Impl> weak_factory_; | 102 base::WeakPtrFactory<PPB_FileIO_Impl> weak_factory_; |
96 | 103 |
97 DISALLOW_COPY_AND_ASSIGN(PPB_FileIO_Impl); | 104 DISALLOW_COPY_AND_ASSIGN(PPB_FileIO_Impl); |
98 }; | 105 }; |
99 | 106 |
100 } // namespace ppapi | 107 } // namespace ppapi |
101 } // namespace webkit | 108 } // namespace webkit |
102 | 109 |
103 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_IO_IMPL_H_ | 110 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FILE_IO_IMPL_H_ |
OLD | NEW |