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

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

Issue 2857303002: [Mojo Video Capture] Implement a VideoCaptureProvider using the Mojo service (part 2) (Closed)
Patch Set: Added back update to |state_| which was accidentally dropped in PatchSet 3 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') | no next file » | 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 17 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « services/video_capture/service_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698