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

Side by Side Diff: services/video_capture/service_impl.cc

Issue 2850743004: Replace ServiceInfo with BindSourceInfo. (Closed)
Patch Set: . Created 3 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 unified diff | Download patch
« no previous file with comments | « services/video_capture/service_impl.h ('k') | ui/views/mus/views_mus_test_suite.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 ref_factory_ = 24 ref_factory_ =
25 base::MakeUnique<service_manager::ServiceContextRefFactory>(base::Bind( 25 base::MakeUnique<service_manager::ServiceContextRefFactory>(base::Bind(
26 &ServiceImpl::MaybeRequestQuitDelayed, base::Unretained(this))); 26 &ServiceImpl::MaybeRequestQuitDelayed, base::Unretained(this)));
27 registry_.AddInterface<mojom::DeviceFactoryProvider>( 27 registry_.AddInterface<mojom::DeviceFactoryProvider>(
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::ServiceInfo& 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 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 ServiceImpl::OnServiceManagerConnectionLost() { 42 bool ServiceImpl::OnServiceManagerConnectionLost() {
43 DCHECK(thread_checker_.CalledOnValidThread()); 43 DCHECK(thread_checker_.CalledOnValidThread());
44 return true; 44 return true;
(...skipping 28 matching lines...) Expand all
73 73
74 void ServiceImpl::MaybeRequestQuit() { 74 void ServiceImpl::MaybeRequestQuit() {
75 DCHECK(thread_checker_.CalledOnValidThread()); 75 DCHECK(thread_checker_.CalledOnValidThread());
76 DCHECK(ref_factory_); 76 DCHECK(ref_factory_);
77 if (ref_factory_->HasNoRefs()) { 77 if (ref_factory_->HasNoRefs()) {
78 context()->RequestQuit(); 78 context()->RequestQuit();
79 } 79 }
80 } 80 }
81 81
82 } // namespace video_capture 82 } // namespace video_capture
OLDNEW
« no previous file with comments | « services/video_capture/service_impl.h ('k') | ui/views/mus/views_mus_test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698