diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 03:13:18 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 03:13:18 +0000 |
commit | 3a7e4e6b9b44ecd168a615ff6547f118602f6749 (patch) | |
tree | 37957cee47522bdd16e26a2498da27c7d92c504a /webkit/blob | |
parent | e178c0a7f5c17478a94224a949878c05fb53df3b (diff) | |
download | chromium_src-3a7e4e6b9b44ecd168a615ff6547f118602f6749.zip chromium_src-3a7e4e6b9b44ecd168a615ff6547f118602f6749.tar.gz chromium_src-3a7e4e6b9b44ecd168a615ff6547f118602f6749.tar.bz2 |
Use LocalFileReader in FileSystemURLRequestJob
- to avoid file access on IO thread
- to remove duplicated code
- for further FileSystem stream related refactoring
BUG=113300,114999
TEST=FileSystemURLRequestJobTest.*
Review URL: https://chromiumcodereview.appspot.com/10065011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132134 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/blob')
-rw-r--r-- | webkit/blob/blob_url_request_job.cc | 4 | ||||
-rw-r--r-- | webkit/blob/local_file_reader.cc | 2 | ||||
-rw-r--r-- | webkit/blob/local_file_reader.h | 4 |
3 files changed, 4 insertions, 6 deletions
diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc index 1a360f1..147753a 100644 --- a/webkit/blob/blob_url_request_job.cc +++ b/webkit/blob/blob_url_request_job.cc @@ -43,10 +43,6 @@ const char kHTTPRequestedRangeNotSatisfiableText[] = "Requested Range Not Satisfiable"; const char kHTTPInternalErrorText[] = "Internal Server Error"; -const int kFileOpenFlags = base::PLATFORM_FILE_OPEN | - base::PLATFORM_FILE_READ | - base::PLATFORM_FILE_ASYNC; - } // namespace BlobURLRequestJob::BlobURLRequestJob( diff --git a/webkit/blob/local_file_reader.cc b/webkit/blob/local_file_reader.cc index 54493c1..e21e82d 100644 --- a/webkit/blob/local_file_reader.cc +++ b/webkit/blob/local_file_reader.cc @@ -70,7 +70,7 @@ void DidSeekFile(const LocalFileReader::OpenFileStreamCallback& callback, if (new_offset < 0) result = static_cast<int>(new_offset); else if (new_offset != initial_offset) - result = net::ERR_FAILED; + result = net::ERR_REQUEST_RANGE_NOT_SATISFIABLE; callback.Run(result, stream_impl.Pass()); } diff --git a/webkit/blob/local_file_reader.h b/webkit/blob/local_file_reader.h index fd87dd4..f7d3b27 100644 --- a/webkit/blob/local_file_reader.h +++ b/webkit/blob/local_file_reader.h @@ -34,7 +34,9 @@ class BLOB_EXPORT LocalFileReader { // Creates a new FileReader for a local file |file_path|. // |initial_offset| specifies the offset in the file where the first read - // should start. + // should start. If the given offset is out of the file range any + // read operation may error out with net::ERR_REQUEST_RANGE_NOT_SATISFIABLE. + // // |expected_modification_time| specifies the expected last modification // If the value is non-null, the reader will check the underlying file's // actual modification time to see if the file has been modified, and if |