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

Unified Diff: services/file/file_service.cc

Issue 2795883002: Eliminate OnConnect usage (Closed)
Patch Set: . Created 3 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 | « services/file/file_service.h ('k') | services/identity/identity_service.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 a8b7eee71289cd6a13b25c105b116a71110a82a2..d10ed4dcd750e368bc1b49fbf9705fb85a130bf5 100644
--- a/services/file/file_service.cc
+++ b/services/file/file_service.cc
@@ -13,7 +13,6 @@
#include "services/file/file_system.h"
#include "services/file/user_id_map.h"
#include "services/service_manager/public/cpp/connection.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
#include "services/service_manager/public/cpp/service_context.h"
namespace file {
@@ -85,7 +84,10 @@ FileService::FileService(
scoped_refptr<base::SingleThreadTaskRunner> file_service_runner,
scoped_refptr<base::SingleThreadTaskRunner> leveldb_service_runner)
: file_service_runner_(std::move(file_service_runner)),
- leveldb_service_runner_(std::move(leveldb_service_runner)) {}
+ leveldb_service_runner_(std::move(leveldb_service_runner)) {
+ registry_.AddInterface<leveldb::mojom::LevelDBService>(this);
+ registry_.AddInterface<mojom::FileSystem>(this);
+}
FileService::~FileService() {
file_service_runner_->DeleteSoon(FROM_HERE, file_system_objects_.release());
@@ -99,11 +101,12 @@ void FileService::OnStart() {
new FileService::LevelDBServiceObjects(file_service_runner_));
}
-bool FileService::OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) {
- registry->AddInterface<leveldb::mojom::LevelDBService>(this);
- registry->AddInterface<mojom::FileSystem>(this);
- return true;
+void FileService::OnBindInterface(
+ const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) {
+ registry_.BindInterface(source_info.identity, interface_name,
+ std::move(interface_pipe));
}
void FileService::Create(const service_manager::Identity& remote_identity,
« no previous file with comments | « services/file/file_service.h ('k') | services/identity/identity_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698