| 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/fileapi/file_system_url_request_job.h" | 5 #include "webkit/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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 } | 198 } |
| 199 | 199 |
| 200 remaining_bytes_ = byte_range_.last_byte_position() - | 200 remaining_bytes_ = byte_range_.last_byte_position() - |
| 201 byte_range_.first_byte_position() + 1; | 201 byte_range_.first_byte_position() + 1; |
| 202 DCHECK_GE(remaining_bytes_, 0); | 202 DCHECK_GE(remaining_bytes_, 0); |
| 203 | 203 |
| 204 DCHECK(!reader_.get()); | 204 DCHECK(!reader_.get()); |
| 205 reader_.reset( | 205 reader_.reset( |
| 206 file_system_context_->CreateFileStreamReader( | 206 file_system_context_->CreateFileStreamReader( |
| 207 url_, | 207 url_, |
| 208 byte_range_.first_byte_position())); | 208 byte_range_.first_byte_position(), |
| 209 base::Time())); |
| 209 | 210 |
| 210 set_expected_content_size(remaining_bytes_); | 211 set_expected_content_size(remaining_bytes_); |
| 211 response_info_.reset(new net::HttpResponseInfo()); | 212 response_info_.reset(new net::HttpResponseInfo()); |
| 212 response_info_->headers = CreateHttpResponseHeaders(); | 213 response_info_->headers = CreateHttpResponseHeaders(); |
| 213 NotifyHeadersComplete(); | 214 NotifyHeadersComplete(); |
| 214 } | 215 } |
| 215 | 216 |
| 216 void FileSystemURLRequestJob::DidRead(int result) { | 217 void FileSystemURLRequestJob::DidRead(int result) { |
| 217 if (result > 0) | 218 if (result > 0) |
| 218 SetStatus(URLRequestStatus()); // Clear the IO_PENDING status | 219 SetStatus(URLRequestStatus()); // Clear the IO_PENDING status |
| (...skipping 23 matching lines...) Expand all Loading... |
| 242 } | 243 } |
| 243 | 244 |
| 244 return false; | 245 return false; |
| 245 } | 246 } |
| 246 | 247 |
| 247 void FileSystemURLRequestJob::NotifyFailed(int rv) { | 248 void FileSystemURLRequestJob::NotifyFailed(int rv) { |
| 248 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); | 249 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); |
| 249 } | 250 } |
| 250 | 251 |
| 251 } // namespace fileapi | 252 } // namespace fileapi |
| OLD | NEW |