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

Unified Diff: storage/browser/fileapi/file_system_backend.h

Issue 470323003: [fsp] Improve performance for reading small chunks of data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 3 months 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
Index: storage/browser/fileapi/file_system_backend.h
diff --git a/storage/browser/fileapi/file_system_backend.h b/storage/browser/fileapi/file_system_backend.h
index 8f455d93235416ab36a99e21c58823ccd98d3545..7b1d6b26084282c968d37effa5fefc6e10df4a56 100644
--- a/storage/browser/fileapi/file_system_backend.h
+++ b/storage/browser/fileapi/file_system_backend.h
@@ -5,6 +5,7 @@
#ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_
#define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_
+#include <limits>
#include <string>
#include <vector>
@@ -35,6 +36,11 @@ class WatcherManager;
// Callback to take GURL.
typedef base::Callback<void(const GURL& url)> URLCallback;
+// Maximum numer of bytes to be read by FileStreamReader classes. Used in
+// FileSystemBackend::CreateFileStreamReader(), when it's not known how many
+// bytes will be fetched in total.
+const int64 kMaximumLength = std::numeric_limits<int64>::max();
+
// An interface for defining a file system backend.
//
// NOTE: when you implement a new FileSystemBackend for your own
@@ -108,12 +114,12 @@ class STORAGE_EXPORT FileSystemBackend {
// if it does any succeeding read operations should fail with
// ERR_UPLOAD_FILE_CHANGED error.
// This method itself does *not* check if the given path exists and is a
- // regular file.
- // The |length| argument says how many bytes are going to be read using the
- // instance of the file stream reader. If unknown, then equal to -1.
+ // regular file. At most |max_bytes_to_read| can be fetched from the file
+ // stream reader.
virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader(
const FileSystemURL& url,
int64 offset,
+ int64 max_bytes_to_read,
const base::Time& expected_modification_time,
FileSystemContext* context) const = 0;

Powered by Google App Engine
This is Rietveld 408576698