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

Unified Diff: services/file/file_service.cc

Issue 2600153003: Fix memory leak in file service. (Closed)
Patch Set: Created 4 years 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 | « no previous file | services/file/file_system.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/file/file_service.cc
diff --git a/services/file/file_service.cc b/services/file/file_service.cc
index c469fac960480e112da7bb6f68d90c7ba3672ac5..2e4bd509835d2de7802640cbdd14ef78c3357a85 100644
--- a/services/file/file_service.cc
+++ b/services/file/file_service.cc
@@ -9,6 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "components/filesystem/lock_table.h"
#include "components/leveldb/leveldb_service_impl.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/file/file_system.h"
#include "services/file/user_id_map.h"
#include "services/service_manager/public/cpp/connection.h"
@@ -31,12 +32,12 @@ class FileService::FileSystemObjects
mojom::FileSystemRequest request) {
if (!lock_table_)
lock_table_ = new filesystem::LockTable;
- file_system_bindings_.AddBinding(new FileSystem(user_dir_, lock_table_),
- std::move(request));
+ mojo::MakeStrongBinding(
+ base::MakeUnique<FileSystem>(user_dir_, lock_table_),
+ std::move(request));
}
private:
- mojo::BindingSet<mojom::FileSystem> file_system_bindings_;
scoped_refptr<filesystem::LockTable> lock_table_;
base::FilePath user_dir_;
« no previous file with comments | « no previous file | services/file/file_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698