Chromium Code Reviews| Index: webkit/plugins/ppapi/ppb_file_io_impl.h |
| diff --git a/webkit/plugins/ppapi/ppb_file_io_impl.h b/webkit/plugins/ppapi/ppb_file_io_impl.h |
| index 327f713c9c508241a6e5540ca394ed3fd2211276..b5eee4018fce84ef6cc075ea1b2dc796cc0850ea 100644 |
| --- a/webkit/plugins/ppapi/ppb_file_io_impl.h |
| +++ b/webkit/plugins/ppapi/ppb_file_io_impl.h |
| @@ -8,6 +8,7 @@ |
| #include <queue> |
| #include "base/basictypes.h" |
| +#include "base/callback.h" |
| #include "base/file_path.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/scoped_callback_factory.h" |
| @@ -79,6 +80,12 @@ class PPB_FileIO_Impl : public Resource, |
| char* read_buffer; |
| }; |
| + struct PendingWrite { |
| + int64_t offset; |
| + const char* buffer; |
| + int32_t bytes_to_write; |
| + }; |
| + |
| enum OperationType { |
| // If there are pending reads, any other kind of async operation is not |
| // allowed. |
| @@ -115,18 +122,28 @@ class PPB_FileIO_Impl : public Resource, |
| void StatusCallback(base::PlatformFileError error_code); |
| void AsyncOpenFileCallback(base::PlatformFileError error_code, |
| - base::PassPlatformFile file); |
| + base::PassPlatformFile file, |
| + int64 file_size); |
|
michaeln
2011/07/19 22:01:45
Seems that this class mostly uses int64_t in place
kinuko
2011/07/20 13:39:35
Done.
|
| void QueryInfoCallback(base::PlatformFileError error_code, |
| const base::PlatformFileInfo& file_info); |
| void ReadCallback(base::PlatformFileError error_code, |
| const char* data, int bytes_read); |
| void WriteCallback(base::PlatformFileError error_code, int bytes_written); |
| + void SetLengthCallback(base::PlatformFileError error_code); |
| + |
| + void DidCheckQuotaForWrite(bool success); |
| + void DidCheckQuotaForSetLength(bool success); |
| base::ScopedCallbackFactory<PPB_FileIO_Impl> callback_factory_; |
| base::PlatformFile file_; |
| PP_FileSystemType file_system_type_; |
| + // They are valid only for files of |
| + // PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}. |
| + GURL origin_url_; |
| + int64 file_size_; |
| + |
| std::queue<CallbackEntry> callbacks_; |
| OperationType pending_op_; |
| @@ -134,6 +151,10 @@ class PPB_FileIO_Impl : public Resource, |
| // pending for it. |
| PP_FileInfo* info_; |
| + std::queue<PendingWrite> pending_writes_; |
|
yzshen1
2011/07/19 17:41:55
|pending_writes_| and |pending_write_callbacks_| l
michaeln
2011/07/19 22:01:45
Maybe...
pending_quota_checks_
pending_writes_
kinuko
2011/07/20 13:39:35
Done.
|
| + std::queue<PendingWrite> pending_write_callbacks_; |
| + int64_t pending_setlength_length_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(PPB_FileIO_Impl); |
| }; |