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_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 "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 class LockTable; | 24 class LockTable; |
25 | 25 |
26 class DirectoryImpl : public Directory { | 26 class DirectoryImpl : public Directory { |
27 public: | 27 public: |
28 // Set |temp_dir| only if there's a temporary directory that should be deleted | 28 // Set |temp_dir| only if there's a temporary directory that should be deleted |
29 // when this object is destroyed. | 29 // when this object is destroyed. |
30 DirectoryImpl(mojo::InterfaceRequest<Directory> request, | 30 DirectoryImpl(mojo::InterfaceRequest<Directory> request, |
31 base::FilePath directory_path, | 31 base::FilePath directory_path, |
32 scoped_ptr<base::ScopedTempDir> temp_dir, | 32 scoped_ptr<base::ScopedTempDir> temp_dir, |
33 LockTable* lock_table); | 33 scoped_refptr<LockTable> lock_table); |
34 ~DirectoryImpl() override; | 34 ~DirectoryImpl() override; |
35 | 35 |
36 void set_connection_error_handler(const mojo::Closure& error_handler) { | 36 void set_connection_error_handler(const mojo::Closure& error_handler) { |
37 binding_.set_connection_error_handler(error_handler); | 37 binding_.set_connection_error_handler(error_handler); |
38 } | 38 } |
39 | 39 |
40 // |Directory| implementation: | 40 // |Directory| implementation: |
41 void Read(const ReadCallback& callback) override; | 41 void Read(const ReadCallback& callback) override; |
42 void OpenFile(const mojo::String& path, | 42 void OpenFile(const mojo::String& path, |
43 mojo::InterfaceRequest<File> file, | 43 mojo::InterfaceRequest<File> file, |
(...skipping 22 matching lines...) Expand all Loading... |
66 void ReadEntireFile(const mojo::String& path, | 66 void ReadEntireFile(const mojo::String& path, |
67 const ReadEntireFileCallback& callback) override; | 67 const ReadEntireFileCallback& callback) override; |
68 void WriteFile(const mojo::String& path, | 68 void WriteFile(const mojo::String& path, |
69 mojo::Array<uint8_t> data, | 69 mojo::Array<uint8_t> data, |
70 const WriteFileCallback& callback) override; | 70 const WriteFileCallback& callback) override; |
71 | 71 |
72 private: | 72 private: |
73 mojo::StrongBinding<Directory> binding_; | 73 mojo::StrongBinding<Directory> binding_; |
74 base::FilePath directory_path_; | 74 base::FilePath directory_path_; |
75 scoped_ptr<base::ScopedTempDir> temp_dir_; | 75 scoped_ptr<base::ScopedTempDir> temp_dir_; |
76 LockTable* lock_table_; | 76 scoped_refptr<LockTable> lock_table_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(DirectoryImpl); | 78 DISALLOW_COPY_AND_ASSIGN(DirectoryImpl); |
79 }; | 79 }; |
80 | 80 |
81 } // namespace filesystem | 81 } // namespace filesystem |
82 | 82 |
83 #endif // COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_ | 83 #endif // COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_ |
OLD | NEW |