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

Unified Diff: services/file/file_system.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 | « services/catalog/catalog.cc ('k') | services/navigation/navigation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « services/catalog/catalog.cc ('k') | services/navigation/navigation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698