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

Unified Diff: media/mojo/services/media_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 | « media/mojo/services/media_service.h ('k') | mojo/public/cpp/bindings/tests/versioning_test_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/media_service.cc
diff --git a/media/mojo/services/media_service.cc b/media/mojo/services/media_service.cc
index 43eace82e7c49002aa41e42222dfa81587edd73a..242040e653e0a97d6f9fa5800237c7f31aa91d33 100644
--- a/media/mojo/services/media_service.cc
+++ b/media/mojo/services/media_service.cc
@@ -13,7 +13,6 @@
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/service_manager/public/cpp/connection.h"
#include "services/service_manager/public/cpp/connector.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
namespace media {
@@ -22,6 +21,7 @@ MediaService::MediaService(std::unique_ptr<MojoMediaClient> mojo_media_client)
: mojo_media_client_(std::move(mojo_media_client)),
media_log_(new MediaLog()) {
DCHECK(mojo_media_client_);
+ registry_.AddInterface<mojom::MediaService>(this);
}
MediaService::~MediaService() {}
@@ -33,10 +33,12 @@ void MediaService::OnStart() {
mojo_media_client_->Initialize(context()->connector());
}
-bool MediaService::OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) {
- registry->AddInterface<mojom::MediaService>(this);
- return true;
+void MediaService::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));
}
bool MediaService::OnServiceManagerConnectionLost() {
« no previous file with comments | « media/mojo/services/media_service.h ('k') | mojo/public/cpp/bindings/tests/versioning_test_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698