OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/media_service.h" | 5 #include "media/mojo/services/media_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "media/base/media_log.h" | 10 #include "media/base/media_log.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 MediaService::~MediaService() {} | 25 MediaService::~MediaService() {} |
26 | 26 |
27 void MediaService::OnStart() { | 27 void MediaService::OnStart() { |
28 ref_factory_.reset(new service_manager::ServiceContextRefFactory( | 28 ref_factory_.reset(new service_manager::ServiceContextRefFactory( |
29 base::Bind(&service_manager::ServiceContext::RequestQuit, | 29 base::Bind(&service_manager::ServiceContext::RequestQuit, |
30 base::Unretained(context())))); | 30 base::Unretained(context())))); |
31 mojo_media_client_->Initialize(context()->connector()); | 31 mojo_media_client_->Initialize(context()->connector()); |
32 } | 32 } |
33 | 33 |
34 void MediaService::OnBindInterface( | 34 void MediaService::OnBindInterface( |
35 const service_manager::ServiceInfo& source_info, | 35 const service_manager::BindSourceInfo& source_info, |
36 const std::string& interface_name, | 36 const std::string& interface_name, |
37 mojo::ScopedMessagePipeHandle interface_pipe) { | 37 mojo::ScopedMessagePipeHandle interface_pipe) { |
38 registry_.BindInterface(source_info.identity, interface_name, | 38 registry_.BindInterface(source_info.identity, interface_name, |
39 std::move(interface_pipe)); | 39 std::move(interface_pipe)); |
40 } | 40 } |
41 | 41 |
42 bool MediaService::OnServiceManagerConnectionLost() { | 42 bool MediaService::OnServiceManagerConnectionLost() { |
43 mojo_media_client_.reset(); | 43 mojo_media_client_.reset(); |
44 return true; | 44 return true; |
45 } | 45 } |
(...skipping 11 matching lines...) Expand all Loading... |
57 return; | 57 return; |
58 | 58 |
59 mojo::MakeStrongBinding( | 59 mojo::MakeStrongBinding( |
60 base::MakeUnique<InterfaceFactoryImpl>( | 60 base::MakeUnique<InterfaceFactoryImpl>( |
61 std::move(host_interfaces), &media_log_, ref_factory_->CreateRef(), | 61 std::move(host_interfaces), &media_log_, ref_factory_->CreateRef(), |
62 mojo_media_client_.get()), | 62 mojo_media_client_.get()), |
63 std::move(request)); | 63 std::move(request)); |
64 } | 64 } |
65 | 65 |
66 } // namespace media | 66 } // namespace media |
OLD | NEW |