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

Unified Diff: components/filesystem/directory_impl.cc

Issue 1935863002: mojo: Fix leveldb unittests by making fs::Directories cloneable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Gyp continues to exist. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/filesystem/directory_impl.h ('k') | components/filesystem/directory_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « components/filesystem/directory_impl.h ('k') | components/filesystem/directory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698