| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 PPAPI_CPP_DEV_FILE_IO_DEV_H_ | 5 #ifndef PPAPI_CPP_DEV_FILE_IO_DEV_H_ |
| 6 #define PPAPI_CPP_DEV_FILE_IO_DEV_H_ | 6 #define PPAPI_CPP_DEV_FILE_IO_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_time.h" | 8 #include "ppapi/cpp/file_io.h" |
| 9 #include "ppapi/cpp/resource.h" | |
| 10 | |
| 11 struct PP_FileInfo_Dev; | |
| 12 | 9 |
| 13 namespace pp { | 10 namespace pp { |
| 14 | 11 |
| 15 class CompletionCallback; | 12 typedef FileIO FileIO_Dev; |
| 16 class FileRef_Dev; | |
| 17 class Instance; | |
| 18 | |
| 19 class FileIO_Dev : public Resource { | |
| 20 public: | |
| 21 // Constructs an is_null resource. | |
| 22 FileIO_Dev(); | |
| 23 | |
| 24 FileIO_Dev(Instance* instance); | |
| 25 FileIO_Dev(const FileIO_Dev& other); | |
| 26 | |
| 27 // PPB_FileIO methods: | |
| 28 int32_t Open(const FileRef_Dev& file_ref, | |
| 29 int32_t open_flags, | |
| 30 const CompletionCallback& cc); | |
| 31 int32_t Query(PP_FileInfo_Dev* result_buf, | |
| 32 const CompletionCallback& cc); | |
| 33 int32_t Touch(PP_Time last_access_time, | |
| 34 PP_Time last_modified_time, | |
| 35 const CompletionCallback& cc); | |
| 36 int32_t Read(int64_t offset, | |
| 37 char* buffer, | |
| 38 int32_t bytes_to_read, | |
| 39 const CompletionCallback& cc); | |
| 40 int32_t Write(int64_t offset, | |
| 41 const char* buffer, | |
| 42 int32_t bytes_to_write, | |
| 43 const CompletionCallback& cc); | |
| 44 int32_t SetLength(int64_t length, | |
| 45 const CompletionCallback& cc); | |
| 46 int32_t Flush(const CompletionCallback& cc); | |
| 47 void Close(); | |
| 48 }; | |
| 49 | 13 |
| 50 } // namespace pp | 14 } // namespace pp |
| 51 | 15 |
| 52 #endif // PPAPI_CPP_DEV_FILE_IO_DEV_H_ | 16 #endif // PPAPI_CPP_DEV_FILE_IO_DEV_H_ |
| OLD | NEW |