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 "files/public/c/lib/file_fd_impl.h" | 5 #include "files/c/lib/file_fd_impl.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
11 | 11 |
12 #include "files/public/c/lib/errno_impl.h" | 12 #include "files/c/lib/errno_impl.h" |
13 #include "files/public/c/lib/template_util.h" | 13 #include "files/c/lib/template_util.h" |
14 #include "files/public/c/lib/util.h" | 14 #include "files/c/lib/util.h" |
15 #include "files/public/c/mojio_unistd.h" | 15 #include "files/c/mojio_unistd.h" |
16 #include "files/public/interfaces/types.mojom.h" | 16 #include "files/interfaces/types.mojom.h" |
17 #include "mojo/public/cpp/bindings/interface_request.h" | 17 #include "mojo/public/cpp/bindings/interface_request.h" |
18 #include "mojo/public/cpp/environment/logging.h" | 18 #include "mojo/public/cpp/environment/logging.h" |
19 | 19 |
20 namespace mojio { | 20 namespace mojio { |
21 | 21 |
22 FileFDImpl::FileFDImpl(ErrnoImpl* errno_impl, mojo::files::FilePtr file) | 22 FileFDImpl::FileFDImpl(ErrnoImpl* errno_impl, mojo::files::FilePtr file) |
23 : FDImpl(errno_impl), file_(file.Pass()) { | 23 : FDImpl(errno_impl), file_(file.Pass()) { |
24 MOJO_DCHECK(file_); | 24 MOJO_DCHECK(file_); |
25 } | 25 } |
26 | 26 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // Make up a value based on size. (Note: Despite the above "block size", this | 275 // Make up a value based on size. (Note: Despite the above "block size", this |
276 // block count is for 512-byte blocks!) | 276 // block count is for 512-byte blocks!) |
277 if (file_info->size > 0) | 277 if (file_info->size > 0) |
278 buf->st_blocks = (static_cast<mojio_blkcnt_t>(file_info->size) + 511) / 512; | 278 buf->st_blocks = (static_cast<mojio_blkcnt_t>(file_info->size) + 511) / 512; |
279 // Else leave |st_blocks| zero. | 279 // Else leave |st_blocks| zero. |
280 | 280 |
281 return true; | 281 return true; |
282 } | 282 } |
283 | 283 |
284 } // namespace mojio | 284 } // namespace mojio |
OLD | NEW |