| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/video_capture/service_impl.h" | 5 #include "services/video_capture/service_impl.h" |
| 6 | 6 |
| 7 #include "mojo/public/cpp/bindings/strong_binding.h" | 7 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 8 #include "services/service_manager/public/cpp/service_context.h" | 8 #include "services/service_manager/public/cpp/service_context.h" |
| 9 #include "services/video_capture/device_factory_provider_impl.h" | 9 #include "services/video_capture/device_factory_provider_impl.h" |
| 10 #include "services/video_capture/public/interfaces/constants.mojom.h" | 10 #include "services/video_capture/public/interfaces/constants.mojom.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // Unretained |this| is safe because |registry_| is owned by |this|. | 28 // Unretained |this| is safe because |registry_| is owned by |this|. |
| 29 base::Bind(&ServiceImpl::OnDeviceFactoryProviderRequest, | 29 base::Bind(&ServiceImpl::OnDeviceFactoryProviderRequest, |
| 30 base::Unretained(this))); | 30 base::Unretained(this))); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void ServiceImpl::OnBindInterface( | 33 void ServiceImpl::OnBindInterface( |
| 34 const service_manager::BindSourceInfo& source_info, | 34 const service_manager::BindSourceInfo& source_info, |
| 35 const std::string& interface_name, | 35 const std::string& interface_name, |
| 36 mojo::ScopedMessagePipeHandle interface_pipe) { | 36 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 37 DCHECK(thread_checker_.CalledOnValidThread()); | 37 DCHECK(thread_checker_.CalledOnValidThread()); |
| 38 DCHECK(thread_checker_.CalledOnValidThread()); |
| 38 registry_.BindInterface(source_info, interface_name, | 39 registry_.BindInterface(source_info, interface_name, |
| 39 std::move(interface_pipe)); | 40 std::move(interface_pipe)); |
| 40 } | 41 } |
| 41 | 42 |
| 42 bool ServiceImpl::OnServiceManagerConnectionLost() { | 43 bool ServiceImpl::OnServiceManagerConnectionLost() { |
| 43 DCHECK(thread_checker_.CalledOnValidThread()); | 44 DCHECK(thread_checker_.CalledOnValidThread()); |
| 44 return true; | 45 return true; |
| 45 } | 46 } |
| 46 | 47 |
| 47 void ServiceImpl::OnDeviceFactoryProviderRequest( | 48 void ServiceImpl::OnDeviceFactoryProviderRequest( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 74 | 75 |
| 75 void ServiceImpl::MaybeRequestQuit() { | 76 void ServiceImpl::MaybeRequestQuit() { |
| 76 DCHECK(thread_checker_.CalledOnValidThread()); | 77 DCHECK(thread_checker_.CalledOnValidThread()); |
| 77 DCHECK(ref_factory_); | 78 DCHECK(ref_factory_); |
| 78 if (ref_factory_->HasNoRefs()) { | 79 if (ref_factory_->HasNoRefs()) { |
| 79 context()->RequestQuit(); | 80 context()->RequestQuit(); |
| 80 } | 81 } |
| 81 } | 82 } |
| 82 | 83 |
| 83 } // namespace video_capture | 84 } // namespace video_capture |
| OLD | NEW |