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 #ifndef COMPONENTS_FILESYSTEM_FILE_IMPL_H_ | 5 #ifndef COMPONENTS_FILESYSTEM_FILE_IMPL_H_ |
6 #define COMPONENTS_FILESYSTEM_FILE_IMPL_H_ | 6 #define COMPONENTS_FILESYSTEM_FILE_IMPL_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/files/file.h" | 10 #include "base/files/file.h" |
9 #include "base/files/scoped_file.h" | 11 #include "base/files/scoped_file.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "components/filesystem/public/interfaces/directory.mojom.h" | 13 #include "components/filesystem/public/interfaces/directory.mojom.h" |
12 #include "mojo/public/cpp/bindings/interface_request.h" | 14 #include "mojo/public/cpp/bindings/interface_request.h" |
13 #include "mojo/public/cpp/bindings/strong_binding.h" | 15 #include "mojo/public/cpp/bindings/strong_binding.h" |
14 | 16 |
15 namespace base { | 17 namespace base { |
16 class FilePath; | 18 class FilePath; |
17 } | 19 } |
18 | 20 |
19 namespace filesystem { | 21 namespace filesystem { |
20 | 22 |
21 class FileImpl : public File { | 23 class FileImpl : public File { |
22 public: | 24 public: |
23 FileImpl(mojo::InterfaceRequest<File> request, | 25 FileImpl(mojo::InterfaceRequest<File> request, |
24 const base::FilePath& path, | 26 const base::FilePath& path, |
25 uint32 flags); | 27 uint32_t flags); |
26 FileImpl(mojo::InterfaceRequest<File> request, base::File file); | 28 FileImpl(mojo::InterfaceRequest<File> request, base::File file); |
27 ~FileImpl() override; | 29 ~FileImpl() override; |
28 | 30 |
29 // |File| implementation: | 31 // |File| implementation: |
30 void Close(const CloseCallback& callback) override; | 32 void Close(const CloseCallback& callback) override; |
31 void Read(uint32_t num_bytes_to_read, | 33 void Read(uint32_t num_bytes_to_read, |
32 int64_t offset, | 34 int64_t offset, |
33 Whence whence, | 35 Whence whence, |
34 const ReadCallback& callback) override; | 36 const ReadCallback& callback) override; |
35 void Write(mojo::Array<uint8_t> bytes_to_write, | 37 void Write(mojo::Array<uint8_t> bytes_to_write, |
(...skipping 17 matching lines...) Expand all Loading... |
53 private: | 55 private: |
54 mojo::StrongBinding<File> binding_; | 56 mojo::StrongBinding<File> binding_; |
55 base::File file_; | 57 base::File file_; |
56 | 58 |
57 DISALLOW_COPY_AND_ASSIGN(FileImpl); | 59 DISALLOW_COPY_AND_ASSIGN(FileImpl); |
58 }; | 60 }; |
59 | 61 |
60 } // namespace filesystem | 62 } // namespace filesystem |
61 | 63 |
62 #endif // COMPONENTS_FILESYSTEM_FILE_IMPL_H_ | 64 #endif // COMPONENTS_FILESYSTEM_FILE_IMPL_H_ |
OLD | NEW |