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

Unified Diff: components/filesystem/file_system_impl.cc

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 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/file_system_impl.h ('k') | components/leveldb/leveldb_database_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/filesystem/file_system_impl.cc
diff --git a/components/filesystem/file_system_impl.cc b/components/filesystem/file_system_impl.cc
index 5fa0e6366c345cc629464b814683cdbff19d1dd8..5338909dd1cabc81893082a2f5fcf97ed1efe4ec 100644
--- a/components/filesystem/file_system_impl.cc
+++ b/components/filesystem/file_system_impl.cc
@@ -17,17 +17,16 @@
#include "build/build_config.h"
#include "components/filesystem/directory_impl.h"
#include "components/filesystem/lock_table.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/shell/public/cpp/identity.h"
#include "url/gurl.h"
namespace filesystem {
FileSystemImpl::FileSystemImpl(const shell::Identity& remote_identity,
- mojom::FileSystemRequest request,
base::FilePath persistent_dir,
scoped_refptr<LockTable> lock_table)
: remote_application_name_(remote_identity.name()),
- binding_(this, std::move(request)),
lock_table_(std::move(lock_table)),
persistent_dir_(persistent_dir) {}
@@ -35,7 +34,7 @@ FileSystemImpl::~FileSystemImpl() {
}
void FileSystemImpl::OpenTempDirectory(
- mojo::InterfaceRequest<mojom::Directory> directory,
+ mojom::DirectoryRequest directory,
const OpenTempDirectoryCallback& callback) {
// Set only if the |DirectoryImpl| will own a temporary directory.
std::unique_ptr<base::ScopedTempDir> temp_dir(new base::ScopedTempDir);
@@ -44,8 +43,9 @@ void FileSystemImpl::OpenTempDirectory(
base::FilePath path = temp_dir->path();
scoped_refptr<SharedTempDir> shared_temp_dir =
new SharedTempDir(std::move(temp_dir));
- new DirectoryImpl(
- std::move(directory), path, std::move(shared_temp_dir), lock_table_);
+ mojo::MakeStrongBinding(base::MakeUnique<DirectoryImpl>(
+ path, std::move(shared_temp_dir), lock_table_),
+ std::move(directory));
callback.Run(mojom::FileError::OK);
}
@@ -60,8 +60,9 @@ void FileSystemImpl::OpenPersistentFileSystem(
scoped_refptr<SharedTempDir> shared_temp_dir =
new SharedTempDir(std::move(temp_dir));
- new DirectoryImpl(
- std::move(directory), path, std::move(shared_temp_dir), lock_table_);
+ mojo::MakeStrongBinding(base::MakeUnique<DirectoryImpl>(
+ path, std::move(shared_temp_dir), lock_table_),
+ std::move(directory));
callback.Run(mojom::FileError::OK);
}
« no previous file with comments | « components/filesystem/file_system_impl.h ('k') | components/leveldb/leveldb_database_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698