| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 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. |
| 4 |
| 5 #ifndef WEBKIT_CHROMEOS_FILEAPI_ASYNC_FILE_STREAM_H_ |
| 6 #define WEBKIT_CHROMEOS_FILEAPI_ASYNC_FILE_STREAM_H_ |
| 7 |
| 8 #include "base/platform_file.h" |
| 9 #include "base/callback.h" |
| 10 |
| 11 namespace fileapi { |
| 12 |
| 13 using base::PlatformFileError; |
| 14 |
| 15 typedef base::Callback<void(PlatformFileError, int64)> ReadWriteCallback; |
| 16 typedef base::Callback<void(PlatformFileError)> StatusCallback; |
| 17 |
| 18 // Abstract class similar to net::FileStream, but supporting only |
| 19 // the asyncronous operations and not necessarily relying on PlatformFile. |
| 20 class AsyncFileStream { |
| 21 public: |
| 22 virtual ~AsyncFileStream() {}; |
| 23 |
| 24 virtual void Read(char* buffer, |
| 25 int64 length, |
| 26 const ReadWriteCallback& callback) = 0; |
| 27 |
| 28 virtual void Write(const char* buffer, |
| 29 int64 length, |
| 30 const ReadWriteCallback& callback) = 0; |
| 31 |
| 32 virtual void Seek(int64 offset, |
| 33 const StatusCallback& callback) = 0; |
| 34 }; |
| 35 |
| 36 } // namespace fileapi |
| 37 |
| 38 #endif // WEBKIT_CHROMEOS_FILEAPI_ASYNC_FILE_STREAM_H_ |
| OLD | NEW |