Index: components/filesystem/directory_impl.cc |
diff --git a/components/filesystem/directory_impl.cc b/components/filesystem/directory_impl.cc |
index 986526b035f7ff6a7921f664942e141962db36ea..d6430710db0e45f73821420e5949f8a2225d8a67 100644 |
--- a/components/filesystem/directory_impl.cc |
+++ b/components/filesystem/directory_impl.cc |
@@ -24,15 +24,14 @@ namespace filesystem { |
DirectoryImpl::DirectoryImpl(mojo::InterfaceRequest<Directory> request, |
base::FilePath directory_path, |
- std::unique_ptr<base::ScopedTempDir> temp_dir, |
+ scoped_refptr<SharedTempDir> temp_dir, |
scoped_refptr<LockTable> lock_table) |
: binding_(this, std::move(request)), |
directory_path_(directory_path), |
temp_dir_(std::move(temp_dir)), |
lock_table_(std::move(lock_table)) {} |
-DirectoryImpl::~DirectoryImpl() { |
-} |
+DirectoryImpl::~DirectoryImpl() {} |
void DirectoryImpl::Read(const ReadCallback& callback) { |
mojo::Array<DirectoryEntryPtr> entries; |
@@ -83,7 +82,8 @@ void DirectoryImpl::OpenFile(const mojo::String& raw_path, |
} |
if (file.is_pending()) { |
- new FileImpl(std::move(file), path, std::move(base_file), lock_table_); |
+ new FileImpl(std::move(file), path, std::move(base_file), temp_dir_, |
+ lock_table_); |
} |
callback.Run(FileError::OK); |
} |
@@ -155,7 +155,7 @@ void DirectoryImpl::OpenDirectory(const mojo::String& raw_path, |
} |
if (directory.is_pending()) |
- new DirectoryImpl(std::move(directory), path, nullptr, lock_table_); |
+ new DirectoryImpl(std::move(directory), path, temp_dir_, lock_table_); |
callback.Run(FileError::OK); |
} |
@@ -267,6 +267,13 @@ void DirectoryImpl::StatFile(const mojo::String& raw_path, |
callback.Run(FileError::OK, MakeFileInformation(info)); |
} |
+void DirectoryImpl::Clone(mojo::InterfaceRequest<Directory> directory) { |
+ if (directory.is_pending()) { |
+ new DirectoryImpl(std::move(directory), directory_path_, |
+ temp_dir_, lock_table_); |
+ } |
+} |
+ |
void DirectoryImpl::ReadEntireFile(const mojo::String& raw_path, |
const ReadEntireFileCallback& callback) { |
base::FilePath path; |