Index: native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_file_io_interface.h |
diff --git a/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_file_io_interface.h b/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_file_io_interface.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cc5beda373c3e321c0fb4940d40d662a85edc0bd |
--- /dev/null |
+++ b/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_file_io_interface.h |
@@ -0,0 +1,45 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef LIBRARIES_NACL_IO_TEST_FAKE_FILE_IO_INTERFACE_H_ |
+#define LIBRARIES_NACL_IO_TEST_FAKE_FILE_IO_INTERFACE_H_ |
+ |
+#include "fake_ppapi/fake_core_interface.h" |
+#include "sdk_util/macros.h" |
+ |
+class FakeFileIoInterface : public nacl_io::FileIoInterface { |
+ public: |
+ explicit FakeFileIoInterface(FakeCoreInterface* core_interface); |
+ |
+ virtual PP_Resource Create(PP_Resource instance); |
+ virtual int32_t Open(PP_Resource file_io, |
+ PP_Resource file_ref, |
+ int32_t open_flags, |
+ PP_CompletionCallback callback); |
+ virtual int32_t Query(PP_Resource file_io, |
+ PP_FileInfo* info, |
+ PP_CompletionCallback callback); |
+ virtual int32_t Read(PP_Resource file_io, |
+ int64_t offset, |
+ char* buffer, |
+ int32_t bytes_to_read, |
+ PP_CompletionCallback callback); |
+ virtual int32_t Write(PP_Resource file_io, |
+ int64_t offset, |
+ const char* buffer, |
+ int32_t bytes_to_write, |
+ PP_CompletionCallback callback); |
+ virtual int32_t SetLength(PP_Resource file_io, |
+ int64_t length, |
+ PP_CompletionCallback callback); |
+ virtual int32_t Flush(PP_Resource file_io, PP_CompletionCallback callback); |
+ virtual void Close(PP_Resource file_io); |
+ |
+ private: |
+ FakeCoreInterface* core_interface_; // Weak reference. |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FakeFileIoInterface); |
+}; |
+ |
+#endif // LIBRARIES_NACL_IO_TEST_FAKE_FILE_IO_INTERFACE_H_ |