Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: webkit/chromeos/fileapi/async_file_stream.h

Issue 8907014: Implement async verision of FileSystemFileUtil and in-memory file system for testing purposes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/chromeos/fileapi/file_util_async.h » ('j') | webkit/chromeos/fileapi/file_util_async.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..141f9ed3c1a7c859f0179c406f83c6874f1174f5
--- /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_CHROMEOS_FILEAPI_ASYNC_FILE_STREAM_H_
+#define WEBKIT_CHROMEOS_FILEAPI_ASYNC_FILE_STREAM_H_
+
+#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;
+
+ 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_CHROMEOS_FILEAPI_ASYNC_FILE_STREAM_H_
« no previous file with comments | « no previous file | webkit/chromeos/fileapi/file_util_async.h » ('j') | webkit/chromeos/fileapi/file_util_async.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698