OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/browser/fileapi/file_system_url_request_job.h" | 5 #include "webkit/browser/fileapi/file_system_url_request_job.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 NotifyHeadersComplete(); | 210 NotifyHeadersComplete(); |
211 return; | 211 return; |
212 } | 212 } |
213 | 213 |
214 remaining_bytes_ = byte_range_.last_byte_position() - | 214 remaining_bytes_ = byte_range_.last_byte_position() - |
215 byte_range_.first_byte_position() + 1; | 215 byte_range_.first_byte_position() + 1; |
216 DCHECK_GE(remaining_bytes_, 0); | 216 DCHECK_GE(remaining_bytes_, 0); |
217 | 217 |
218 DCHECK(!reader_.get()); | 218 DCHECK(!reader_.get()); |
219 reader_ = file_system_context_->CreateFileStreamReader( | 219 reader_ = file_system_context_->CreateFileStreamReader( |
220 url_, byte_range_.first_byte_position(), base::Time()); | 220 url_, |
221 byte_range_.first_byte_position(), | |
222 byte_range_.last_byte_position() - byte_range_.first_byte_position() + 1, | |
hashimoto
2014/08/22 06:53:42
You can use remaining_bytes_.
mtomasz
2014/08/25 03:32:31
Done.
| |
223 base::Time()); | |
221 | 224 |
222 set_expected_content_size(remaining_bytes_); | 225 set_expected_content_size(remaining_bytes_); |
223 response_info_.reset(new net::HttpResponseInfo()); | 226 response_info_.reset(new net::HttpResponseInfo()); |
224 response_info_->headers = CreateHttpResponseHeaders(); | 227 response_info_->headers = CreateHttpResponseHeaders(); |
225 NotifyHeadersComplete(); | 228 NotifyHeadersComplete(); |
226 } | 229 } |
227 | 230 |
228 void FileSystemURLRequestJob::DidRead(int result) { | 231 void FileSystemURLRequestJob::DidRead(int result) { |
229 if (result > 0) | 232 if (result > 0) |
230 SetStatus(URLRequestStatus()); // Clear the IO_PENDING status | 233 SetStatus(URLRequestStatus()); // Clear the IO_PENDING status |
(...skipping 23 matching lines...) Expand all Loading... | |
254 } | 257 } |
255 | 258 |
256 return false; | 259 return false; |
257 } | 260 } |
258 | 261 |
259 void FileSystemURLRequestJob::NotifyFailed(int rv) { | 262 void FileSystemURLRequestJob::NotifyFailed(int rv) { |
260 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); | 263 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); |
261 } | 264 } |
262 | 265 |
263 } // namespace fileapi | 266 } // namespace fileapi |
OLD | NEW |