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

Unified Diff: services/media/factory_service/media_sink_impl.cc

Issue 1945903006: Motown: Move responsibility for binding to MediaFactoryService::Product (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Change per feedback - rename Abort to UnbindAndReleaseFromOwner Created 4 years, 7 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
Index: services/media/factory_service/media_sink_impl.cc
diff --git a/services/media/factory_service/media_sink_impl.cc b/services/media/factory_service/media_sink_impl.cc
index 36aa156cc9d9ab8544047df3cfdb87c3292436d4..da4b7efd4d4fb523cc2eb2b301f276ef474f0cc8 100644
--- a/services/media/factory_service/media_sink_impl.cc
+++ b/services/media/factory_service/media_sink_impl.cc
@@ -26,16 +26,12 @@ MediaSinkImpl::MediaSinkImpl(const String& destination_url,
MediaTypePtr media_type,
InterfaceRequest<MediaSink> request,
MediaFactoryService* owner)
- : MediaFactoryService::Product(owner),
- binding_(this, request.Pass()),
+ : MediaFactoryService::Product<MediaSink>(this, request.Pass(), owner),
consumer_(MojoConsumer::Create()),
producer_(MojoProducer::Create()) {
DCHECK(destination_url);
DCHECK(media_type);
- // Go away when the client is no longer connected.
- binding_.set_connection_error_handler([this]() { ReleaseFromOwner(); });
-
status_publisher_.SetCallbackRunner(
[this](const GetStatusCallback& callback, uint64_t version) {
MediaSinkStatusPtr status = MediaSinkStatus::New();
@@ -83,13 +79,7 @@ MediaSinkImpl::MediaSinkImpl(const String& destination_url,
return;
}
- if (destination_url != "mojo:audio_server") {
- LOG(ERROR) << "mojo:audio_server is the only supported destination";
- if (binding_.is_bound()) {
- binding_.Close();
- }
- return;
- }
+ RCHECK(destination_url == "mojo:audio_server");
// TODO(dalesat): Once we have c++14, get rid of this shared pointer hack.
std::shared_ptr<StreamType> captured_stream_type(
« no previous file with comments | « services/media/factory_service/media_sink_impl.h ('k') | services/media/factory_service/media_source_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698