Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: services/files/directory_impl.h

Issue 875643004: Prototype of Files service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: already ignored EINTR Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/files/directory.mojom ('k') | services/files/directory_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef SERVICES_FILES_DIRECTORY_IMPL_H_
6 #define SERVICES_FILES_DIRECTORY_IMPL_H_
7
8 #include "base/files/scoped_file.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "mojo/public/cpp/bindings/interface_request.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h"
13 #include "services/files/directory.mojom.h"
14
15 namespace base {
16 class ScopedTempDir;
17 } // namespace base
18
19 namespace mojo {
20 namespace files {
21
22 class DirectoryImpl : public Directory {
23 public:
24 // Set |temp_dir| only if there's a temporary directory that should be deleted
25 // when this object is destroyed.
26 DirectoryImpl(InterfaceRequest<Directory> request,
27 base::ScopedFD dir_fd,
28 scoped_ptr<base::ScopedTempDir> temp_dir);
29 ~DirectoryImpl() override;
30
31 // |Directory| implementation:
32 void Read(
33 const Callback<void(Error, Array<DirectoryEntryPtr>)>& callback) override;
34 void Stat(const Callback<void(Error, FileInformationPtr)>& callback) override;
35 void Touch(TimespecOrNowPtr atime,
36 TimespecOrNowPtr mtime,
37 const Callback<void(Error)>& callback) override;
38 void OpenFile(const String& path,
39 InterfaceRequest<File> file,
40 uint32_t open_flags,
41 const Callback<void(Error)>& callback) override;
42 void OpenDirectory(const String& path,
43 InterfaceRequest<Directory> directory,
44 uint32_t open_flags,
45 const Callback<void(Error)>& callback) override;
46 void Rename(const String& path,
47 const String& new_path,
48 const Callback<void(Error)>& callback) override;
49 void Delete(const String& path,
50 uint32_t delete_flags,
51 const Callback<void(Error)>& callback) override;
52
53 private:
54 StrongBinding<Directory> binding_;
55 base::ScopedFD dir_fd_;
56 scoped_ptr<base::ScopedTempDir> temp_dir_;
57
58 DISALLOW_COPY_AND_ASSIGN(DirectoryImpl);
59 };
60
61 } // namespace files
62 } // namespace mojo
63
64 #endif // SERVICES_FILES_DIRECTORY_IMPL_H_
OLDNEW
« no previous file with comments | « services/files/directory.mojom ('k') | services/files/directory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698