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
3 // found in the LICENSE file.
5 #ifndef PPAPI_THUNK_PPB_FILE_IO_API_H_
6 #define PPAPI_THUNK_PPB_FILE_IO_API_H_
8 #include "base/memory/ref_counted.h"
9 #include "ppapi/c/ppb_file_io.h"
10 #include "ppapi/thunk/ppapi_thunk_export.h"
14 class TrackedCallback
;
18 class PPAPI_THUNK_EXPORT PPB_FileIO_API
{
20 virtual ~PPB_FileIO_API() {}
22 virtual int32_t Open(PP_Resource file_ref
,
24 scoped_refptr
<TrackedCallback
> callback
) = 0;
25 virtual int32_t Query(PP_FileInfo
* info
,
26 scoped_refptr
<TrackedCallback
> callback
) = 0;
27 virtual int32_t Touch(PP_Time last_access_time
,
28 PP_Time last_modified_time
,
29 scoped_refptr
<TrackedCallback
> callback
) = 0;
30 virtual int32_t Read(int64_t offset
,
32 int32_t bytes_to_read
,
33 scoped_refptr
<TrackedCallback
> callback
) = 0;
34 virtual int32_t ReadToArray(int64_t offset
,
35 int32_t max_read_length
,
36 PP_ArrayOutput
* buffer
,
37 scoped_refptr
<TrackedCallback
> callback
) = 0;
38 virtual int32_t Write(int64_t offset
,
40 int32_t bytes_to_write
,
41 scoped_refptr
<TrackedCallback
> callback
) = 0;
42 virtual int32_t SetLength(int64_t length
,
43 scoped_refptr
<TrackedCallback
> callback
) = 0;
44 virtual int32_t Flush(scoped_refptr
<TrackedCallback
> callback
) = 0;
45 virtual void Close() = 0;
48 virtual int32_t GetOSFileDescriptor() = 0;
49 virtual int32_t WillWrite(int64_t offset
,
50 int32_t bytes_to_write
,
51 scoped_refptr
<TrackedCallback
> callback
) = 0;
52 virtual int32_t WillSetLength(int64_t length
,
53 scoped_refptr
<TrackedCallback
> callback
) = 0;
59 #endif // PPAPI_THUNK_PPB_FILE_IO_API_H_