| 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 "components/arc/arc_bridge_host_impl.h" | 5 #include "components/arc/arc_bridge_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 mojom::ProcessInstancePtr process_ptr) { | 167 mojom::ProcessInstancePtr process_ptr) { |
| 168 OnInstanceReady(ArcBridgeService::Get()->process(), std::move(process_ptr)); | 168 OnInstanceReady(ArcBridgeService::Get()->process(), std::move(process_ptr)); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void ArcBridgeHostImpl::OnStorageManagerInstanceReady( | 171 void ArcBridgeHostImpl::OnStorageManagerInstanceReady( |
| 172 mojom::StorageManagerInstancePtr storage_manager_ptr) { | 172 mojom::StorageManagerInstancePtr storage_manager_ptr) { |
| 173 OnInstanceReady(ArcBridgeService::Get()->storage_manager(), | 173 OnInstanceReady(ArcBridgeService::Get()->storage_manager(), |
| 174 std::move(storage_manager_ptr)); | 174 std::move(storage_manager_ptr)); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void ArcBridgeHostImpl::OnTtsInstanceReady(mojom::TtsInstancePtr tts_ptr) { |
| 178 OnInstanceReady(ArcBridgeService::Get()->tts(), std::move(tts_ptr)); |
| 179 } |
| 180 |
| 177 void ArcBridgeHostImpl::OnVideoInstanceReady( | 181 void ArcBridgeHostImpl::OnVideoInstanceReady( |
| 178 mojom::VideoInstancePtr video_ptr) { | 182 mojom::VideoInstancePtr video_ptr) { |
| 179 OnInstanceReady(ArcBridgeService::Get()->video(), std::move(video_ptr)); | 183 OnInstanceReady(ArcBridgeService::Get()->video(), std::move(video_ptr)); |
| 180 } | 184 } |
| 181 | 185 |
| 182 void ArcBridgeHostImpl::OnClosed() { | 186 void ArcBridgeHostImpl::OnClosed() { |
| 183 DCHECK(thread_checker_.CalledOnValidThread()); | 187 DCHECK(thread_checker_.CalledOnValidThread()); |
| 184 VLOG(1) << "Mojo connection lost"; | 188 VLOG(1) << "Mojo connection lost"; |
| 185 | 189 |
| 186 // Close all mojo channels. | 190 // Close all mojo channels. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 217 void ArcBridgeHostImpl::OnChannelClosed(MojoChannel* channel) { | 221 void ArcBridgeHostImpl::OnChannelClosed(MojoChannel* channel) { |
| 218 DCHECK(thread_checker_.CalledOnValidThread()); | 222 DCHECK(thread_checker_.CalledOnValidThread()); |
| 219 mojo_channels_.erase( | 223 mojo_channels_.erase( |
| 220 std::find_if(mojo_channels_.begin(), mojo_channels_.end(), | 224 std::find_if(mojo_channels_.begin(), mojo_channels_.end(), |
| 221 [channel](std::unique_ptr<MojoChannel>& ptr) { | 225 [channel](std::unique_ptr<MojoChannel>& ptr) { |
| 222 return ptr.get() == channel; | 226 return ptr.get() == channel; |
| 223 })); | 227 })); |
| 224 } | 228 } |
| 225 | 229 |
| 226 } // namespace arc | 230 } // namespace arc |
| OLD | NEW |