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

Side by Side Diff: components/filesystem/directory_impl.h

Issue 2492283002: Mojo C++ bindings: switch components/filesystem mojom target to use STL types. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | components/filesystem/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
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_DIRECTORY_IMPL_H_ 5 #ifndef COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_
6 #define COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_ 6 #define COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 13 matching lines...) Expand all
24 public: 24 public:
25 // Set |temp_dir| only if there's a temporary directory that should be deleted 25 // Set |temp_dir| only if there's a temporary directory that should be deleted
26 // when this object is destroyed. 26 // when this object is destroyed.
27 DirectoryImpl(base::FilePath directory_path, 27 DirectoryImpl(base::FilePath directory_path,
28 scoped_refptr<SharedTempDir> temp_dir, 28 scoped_refptr<SharedTempDir> temp_dir,
29 scoped_refptr<LockTable> lock_table); 29 scoped_refptr<LockTable> lock_table);
30 ~DirectoryImpl() override; 30 ~DirectoryImpl() override;
31 31
32 // |Directory| implementation: 32 // |Directory| implementation:
33 void Read(const ReadCallback& callback) override; 33 void Read(const ReadCallback& callback) override;
34 void OpenFile(const mojo::String& path, 34 void OpenFile(const std::string& path,
35 mojom::FileRequest file, 35 mojom::FileRequest file,
36 uint32_t open_flags, 36 uint32_t open_flags,
37 const OpenFileCallback& callback) override; 37 const OpenFileCallback& callback) override;
38 void OpenFileHandle(const mojo::String& path, 38 void OpenFileHandle(const std::string& path,
39 uint32_t open_flags, 39 uint32_t open_flags,
40 const OpenFileHandleCallback& callback) override; 40 const OpenFileHandleCallback& callback) override;
41 void OpenFileHandles(mojo::Array<mojom::FileOpenDetailsPtr> details, 41 void OpenFileHandles(std::vector<mojom::FileOpenDetailsPtr> details,
42 const OpenFileHandlesCallback& callback) override; 42 const OpenFileHandlesCallback& callback) override;
43 void OpenDirectory(const mojo::String& path, 43 void OpenDirectory(const std::string& path,
44 mojom::DirectoryRequest directory, 44 mojom::DirectoryRequest directory,
45 uint32_t open_flags, 45 uint32_t open_flags,
46 const OpenDirectoryCallback& callback) override; 46 const OpenDirectoryCallback& callback) override;
47 void Rename(const mojo::String& path, 47 void Rename(const std::string& path,
48 const mojo::String& new_path, 48 const std::string& new_path,
49 const RenameCallback& callback) override; 49 const RenameCallback& callback) override;
50 void Delete(const mojo::String& path, 50 void Delete(const std::string& path,
51 uint32_t delete_flags, 51 uint32_t delete_flags,
52 const DeleteCallback& callback) override; 52 const DeleteCallback& callback) override;
53 void Exists(const mojo::String& path, 53 void Exists(const std::string& path, const ExistsCallback& callback) override;
54 const ExistsCallback& callback) override; 54 void IsWritable(const std::string& path,
55 void IsWritable(const mojo::String& path,
56 const IsWritableCallback& callback) override; 55 const IsWritableCallback& callback) override;
57 void Flush(const FlushCallback& callback) override; 56 void Flush(const FlushCallback& callback) override;
58 void StatFile(const mojo::String& path, 57 void StatFile(const std::string& path,
59 const StatFileCallback& callback) override; 58 const StatFileCallback& callback) override;
60 void Clone(mojom::DirectoryRequest directory) override; 59 void Clone(mojom::DirectoryRequest directory) override;
61 void ReadEntireFile(const mojo::String& path, 60 void ReadEntireFile(const std::string& path,
62 const ReadEntireFileCallback& callback) override; 61 const ReadEntireFileCallback& callback) override;
63 void WriteFile(const mojo::String& path, 62 void WriteFile(const std::string& path,
64 mojo::Array<uint8_t> data, 63 const std::vector<uint8_t>& data,
65 const WriteFileCallback& callback) override; 64 const WriteFileCallback& callback) override;
66 65
67 private: 66 private:
68 mojo::ScopedHandle OpenFileHandleImpl(const mojo::String& raw_path, 67 mojo::ScopedHandle OpenFileHandleImpl(const std::string& raw_path,
69 uint32_t open_flags, 68 uint32_t open_flags,
70 mojom::FileError* error); 69 mojom::FileError* error);
71 70
72 base::FilePath directory_path_; 71 base::FilePath directory_path_;
73 scoped_refptr<SharedTempDir> temp_dir_; 72 scoped_refptr<SharedTempDir> temp_dir_;
74 scoped_refptr<LockTable> lock_table_; 73 scoped_refptr<LockTable> lock_table_;
75 74
76 DISALLOW_COPY_AND_ASSIGN(DirectoryImpl); 75 DISALLOW_COPY_AND_ASSIGN(DirectoryImpl);
77 }; 76 };
78 77
79 } // namespace filesystem 78 } // namespace filesystem
80 79
81 #endif // COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_ 80 #endif // COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | components/filesystem/directory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698