Index: services/file/file_system.cc |
diff --git a/services/file/file_system.cc b/services/file/file_system.cc |
index 17e5f805628b97de50c5787f818827b086fbabb9..72d42c42c46413804d4df33f646518f50c652881 100644 |
--- a/services/file/file_system.cc |
+++ b/services/file/file_system.cc |
@@ -12,6 +12,7 @@ |
#include "components/filesystem/directory_impl.h" |
#include "components/filesystem/lock_table.h" |
#include "components/filesystem/public/interfaces/types.mojom.h" |
+#include "mojo/public/cpp/bindings/strong_binding.h" |
#include "services/shell/public/cpp/connection.h" |
namespace file { |
@@ -26,9 +27,10 @@ FileSystem::~FileSystem() {} |
void FileSystem::GetDirectory(filesystem::mojom::DirectoryRequest request, |
const GetDirectoryCallback& callback) { |
- new filesystem::DirectoryImpl(std::move(request), path_, |
- scoped_refptr<filesystem::SharedTempDir>(), |
- lock_table_); |
+ mojo::MakeStrongBinding( |
+ base::MakeUnique<filesystem::DirectoryImpl>( |
+ path_, scoped_refptr<filesystem::SharedTempDir>(), lock_table_), |
+ std::move(request)); |
callback.Run(); |
} |
@@ -48,9 +50,10 @@ void FileSystem::GetSubDirectory(const std::string& sub_directory_path, |
return; |
} |
- new filesystem::DirectoryImpl(std::move(request), subdir, |
- scoped_refptr<filesystem::SharedTempDir>(), |
- lock_table_); |
+ mojo::MakeStrongBinding( |
+ base::MakeUnique<filesystem::DirectoryImpl>( |
+ subdir, scoped_refptr<filesystem::SharedTempDir>(), lock_table_), |
+ std::move(request)); |
callback.Run(filesystem::mojom::FileError::OK); |
} |