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

Side by Side Diff: media/mojo/services/service_factory_impl.cc

Issue 1249643004: media: Quit MojoMediaApplication when no ServiceFactory service is bound. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/mojo/services/service_factory_impl.h" 5 #include "media/mojo/services/service_factory_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/cdm_factory.h" 8 #include "media/base/cdm_factory.h"
9 #include "media/base/media_log.h" 9 #include "media/base/media_log.h"
10 #include "media/base/renderer_factory.h" 10 #include "media/base/renderer_factory.h"
11 #include "media/mojo/services/mojo_cdm_service.h" 11 #include "media/mojo/services/mojo_cdm_service.h"
12 #include "media/mojo/services/mojo_media_client.h" 12 #include "media/mojo/services/mojo_media_client.h"
13 #include "media/mojo/services/mojo_renderer_service.h" 13 #include "media/mojo/services/mojo_renderer_service.h"
14 #include "mojo/application/public/cpp/app_lifetime_helper.h"
14 15
15 namespace media { 16 namespace media {
16 17
17 ServiceFactoryImpl::ServiceFactoryImpl( 18 ServiceFactoryImpl::ServiceFactoryImpl(
18 mojo::InterfaceRequest<interfaces::ServiceFactory> request, 19 mojo::InterfaceRequest<interfaces::ServiceFactory> request,
19 mojo::ServiceProvider* service_provider, 20 mojo::ServiceProvider* service_provider,
20 scoped_refptr<MediaLog> media_log) 21 scoped_refptr<MediaLog> media_log,
22 scoped_ptr<mojo::AppRefCount> parent_app_refcount)
21 : binding_(this, request.Pass()), 23 : binding_(this, request.Pass()),
22 service_provider_(service_provider), 24 service_provider_(service_provider),
23 media_log_(media_log) { 25 media_log_(media_log),
26 parent_app_refcount_(parent_app_refcount.Pass()) {
24 DVLOG(1) << __FUNCTION__; 27 DVLOG(1) << __FUNCTION__;
25 } 28 }
26 29
27 ServiceFactoryImpl::~ServiceFactoryImpl() { 30 ServiceFactoryImpl::~ServiceFactoryImpl() {
28 DVLOG(1) << __FUNCTION__; 31 DVLOG(1) << __FUNCTION__;
29 } 32 }
30 33
31 // interfaces::ServiceFactory implementation. 34 // interfaces::ServiceFactory implementation.
32 void ServiceFactoryImpl::CreateRenderer( 35 void ServiceFactoryImpl::CreateRenderer(
33 mojo::InterfaceRequest<interfaces::MediaRenderer> request) { 36 mojo::InterfaceRequest<interfaces::MediaRenderer> request) {
(...skipping 16 matching lines...) Expand all
50 return renderer_factory_.get(); 53 return renderer_factory_.get();
51 } 54 }
52 55
53 CdmFactory* ServiceFactoryImpl::GetCdmFactory() { 56 CdmFactory* ServiceFactoryImpl::GetCdmFactory() {
54 if (!cdm_factory_) 57 if (!cdm_factory_)
55 cdm_factory_ = MojoMediaClient::Get()->CreateCdmFactory(); 58 cdm_factory_ = MojoMediaClient::Get()->CreateCdmFactory();
56 return cdm_factory_.get(); 59 return cdm_factory_.get();
57 } 60 }
58 61
59 } // namespace media 62 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698