OLD | NEW |
1 // Copyright 2014 The Chromium OS Authors. All rights reserved. | 1 // Copyright 2014 The Chromium OS 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 "volume_reader_javascript_stream.h" | 5 #include "volume_reader_javascript_stream.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "archive.h" | 10 #include "archive.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // Read next chunk only if not at the end of archive. | 265 // Read next chunk only if not at the end of archive. |
266 if (archive_size_ <= offset_) | 266 if (archive_size_ <= offset_) |
267 return; | 267 return; |
268 | 268 |
269 int64_t bytes_to_read = | 269 int64_t bytes_to_read = |
270 std::min(length, archive_size_ - offset_ /* Positive check above. */); | 270 std::min(length, archive_size_ - offset_ /* Positive check above. */); |
271 available_data_ = false; | 271 available_data_ = false; |
272 | 272 |
273 requestor_->RequestFileChunk(request_id_, offset_, bytes_to_read); | 273 requestor_->RequestFileChunk(request_id_, offset_, bytes_to_read); |
274 } | 274 } |
OLD | NEW |