OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mojo/services/files/public/cpp/input_stream_file.h" | 5 #include "mojo/services/files/cpp/input_stream_file.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "mojo/public/cpp/environment/logging.h" | 9 #include "mojo/public/cpp/environment/logging.h" |
10 | 10 |
11 namespace files_impl { | 11 namespace files_impl { |
12 | 12 |
13 InputStreamFile::PendingRead::PendingRead(uint32_t num_bytes, | 13 InputStreamFile::PendingRead::PendingRead(uint32_t num_bytes, |
14 const ReadCallback& callback) | 14 const ReadCallback& callback) |
15 : num_bytes(num_bytes), callback(callback) {} | 15 : num_bytes(num_bytes), callback(callback) {} |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 return; | 293 return; |
294 } | 294 } |
295 | 295 |
296 MOJO_CHECK(!data.is_null()); | 296 MOJO_CHECK(!data.is_null()); |
297 MOJO_CHECK(data.size() <= pending_read_queue_.front().num_bytes); | 297 MOJO_CHECK(data.size() <= pending_read_queue_.front().num_bytes); |
298 pending_read_queue_.front().callback.Run(mojo::files::Error::OK, data.Pass()); | 298 pending_read_queue_.front().callback.Run(mojo::files::Error::OK, data.Pass()); |
299 pending_read_queue_.pop_front(); | 299 pending_read_queue_.pop_front(); |
300 } | 300 } |
301 | 301 |
302 } // namespace files_impl | 302 } // namespace files_impl |
OLD | NEW |