Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / components / filesystem / file_impl.h
blob32eb7302cbe046d5490867051aec74e4b689c4f7
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_FILESYSTEM_FILE_IMPL_H_
6 #define COMPONENTS_FILESYSTEM_FILE_IMPL_H_
8 #include "base/files/scoped_file.h"
9 #include "base/macros.h"
10 #include "components/filesystem/public/interfaces/directory.mojom.h"
11 #include "mojo/public/cpp/bindings/interface_request.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h"
14 namespace filesystem {
16 class FileImpl : public File {
17 public:
18 // TODO(vtl): Will need more for, e.g., |Reopen()|.
19 FileImpl(mojo::InterfaceRequest<File> request, base::ScopedFD file_fd);
20 ~FileImpl() override;
22 // |File| implementation:
23 void Close(const CloseCallback& callback) override;
24 void Read(uint32_t num_bytes_to_read,
25 int64_t offset,
26 Whence whence,
27 const ReadCallback& callback) override;
28 void Write(mojo::Array<uint8_t> bytes_to_write,
29 int64_t offset,
30 Whence whence,
31 const WriteCallback& callback) override;
32 void ReadToStream(mojo::ScopedDataPipeProducerHandle source,
33 int64_t offset,
34 Whence whence,
35 int64_t num_bytes_to_read,
36 const ReadToStreamCallback& callback) override;
37 void WriteFromStream(mojo::ScopedDataPipeConsumerHandle sink,
38 int64_t offset,
39 Whence whence,
40 const WriteFromStreamCallback& callback) override;
41 void Tell(const TellCallback& callback) override;
42 void Seek(int64_t offset,
43 Whence whence,
44 const SeekCallback& callback) override;
45 void Stat(const StatCallback& callback) override;
46 void Truncate(int64_t size, const TruncateCallback& callback) override;
47 void Touch(TimespecOrNowPtr atime,
48 TimespecOrNowPtr mtime,
49 const TouchCallback& callback) override;
50 void Dup(mojo::InterfaceRequest<File> file,
51 const DupCallback& callback) override;
52 void Reopen(mojo::InterfaceRequest<File> file,
53 uint32_t open_flags,
54 const ReopenCallback& callback) override;
55 void AsBuffer(const AsBufferCallback& callback) override;
56 void Ioctl(uint32_t request,
57 mojo::Array<uint32_t> in_values,
58 const IoctlCallback& callback) override;
60 private:
61 mojo::StrongBinding<File> binding_;
62 base::ScopedFD file_fd_;
64 DISALLOW_COPY_AND_ASSIGN(FileImpl);
67 } // namespace filesystem
69 #endif // COMPONENTS_FILESYSTEM_FILE_IMPL_H_