Chromium Code Reviews| Index: webkit/chromeos/fileapi/async_file_stream.h |
| diff --git a/webkit/chromeos/fileapi/async_file_stream.h b/webkit/chromeos/fileapi/async_file_stream.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..601576d776d4c832afac5c9914aa7da355864929 |
| --- /dev/null |
| +++ b/webkit/chromeos/fileapi/async_file_stream.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright (c) 2011 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 WEBKIT_FILEAPI_ASYNC_FILE_STREAM_H_ |
| +#define WEBKIT_FILEAPI_ASYNC_FILE_STREAM_H_ |
|
kinuko
2011/12/14 03:39:22
nit: needs to be updated as well (to add CHROMEOS_
satorux1
2011/12/14 04:43:26
Done.
|
| + |
| +#include "base/platform_file.h" |
| +#include "base/callback.h" |
| + |
| +namespace fileapi { |
| + |
| +using base::PlatformFileError; |
| + |
| +typedef base::Callback<void(PlatformFileError, int64)> ReadWriteCallback; |
| +typedef base::Callback<void(PlatformFileError)> StatusCallback; |
| + |
| +// Abstract class similar to net::FileStream, but supporting only |
| +// the asyncronous operations and not necessarily relying on PlatformFile. |
| +class AsyncFileStream { |
| + public: |
| + virtual ~AsyncFileStream() {}; |
| + |
| + virtual void Read(char* buffer, |
| + int64 length, |
| + const ReadWriteCallback& callback) = 0; |
|
satorux1
2011/12/14 05:19:55
The API looks error-prone. The caller needs to mai
satorux1
2011/12/14 06:55:17
I take it back. We could design an API that does n
|
| + |
| + virtual void Write(const char* buffer, |
| + int64 length, |
| + const ReadWriteCallback& callback) = 0; |
| + |
| + virtual void Seek(int64 offset, |
| + const StatusCallback& callback) = 0; |
| +}; |
| + |
| +} // namespace fileapi |
| + |
| +#endif // WEBKIT_FILEAPI_ASYNC_FILE_STREAM_H_ |