Extract SIGPIPE ignoring code to a common place.
[chromium-blink-merge.git] / ppapi / thunk / ppb_file_io_api.h
blobb7b3d90d930ae17dd3a07887b4f9f9cf54da4468
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"
12 namespace ppapi {
14 class TrackedCallback;
16 namespace thunk {
18 class PPAPI_THUNK_EXPORT PPB_FileIO_API {
19 public:
20 virtual ~PPB_FileIO_API() {}
22 virtual int32_t Open(PP_Resource file_ref,
23 int32_t open_flags,
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,
31 char* buffer,
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,
39 const char* buffer,
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;
47 // Trusted API.
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;
56 } // namespace thunk
57 } // namespace ppapi
59 #endif // PPAPI_THUNK_PPB_FILE_IO_API_H_