| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 void ArcBridgeHostImpl::OnTtsInstanceReady(mojom::TtsInstancePtr tts_ptr) { | 182 void ArcBridgeHostImpl::OnTtsInstanceReady(mojom::TtsInstancePtr tts_ptr) { |
| 183 OnInstanceReady(ArcBridgeService::Get()->tts(), std::move(tts_ptr)); | 183 OnInstanceReady(ArcBridgeService::Get()->tts(), std::move(tts_ptr)); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void ArcBridgeHostImpl::OnVideoInstanceReady( | 186 void ArcBridgeHostImpl::OnVideoInstanceReady( |
| 187 mojom::VideoInstancePtr video_ptr) { | 187 mojom::VideoInstancePtr video_ptr) { |
| 188 OnInstanceReady(ArcBridgeService::Get()->video(), std::move(video_ptr)); | 188 OnInstanceReady(ArcBridgeService::Get()->video(), std::move(video_ptr)); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void ArcBridgeHostImpl::OnWallpaperInstanceReady( | |
| 192 mojom::WallpaperInstancePtr wallpaper_ptr) { | |
| 193 OnInstanceReady(ArcBridgeService::Get()->wallpaper(), | |
| 194 std::move(wallpaper_ptr)); | |
| 195 } | |
| 196 | |
| 197 void ArcBridgeHostImpl::OnClosed() { | 191 void ArcBridgeHostImpl::OnClosed() { |
| 198 DCHECK(thread_checker_.CalledOnValidThread()); | 192 DCHECK(thread_checker_.CalledOnValidThread()); |
| 199 VLOG(1) << "Mojo connection lost"; | 193 VLOG(1) << "Mojo connection lost"; |
| 200 | 194 |
| 201 // Close all mojo channels. | 195 // Close all mojo channels. |
| 202 mojo_channels_.clear(); | 196 mojo_channels_.clear(); |
| 203 instance_.reset(); | 197 instance_.reset(); |
| 204 if (binding_.is_bound()) | 198 if (binding_.is_bound()) |
| 205 binding_.Close(); | 199 binding_.Close(); |
| 206 } | 200 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 232 void ArcBridgeHostImpl::OnChannelClosed(MojoChannel* channel) { | 226 void ArcBridgeHostImpl::OnChannelClosed(MojoChannel* channel) { |
| 233 DCHECK(thread_checker_.CalledOnValidThread()); | 227 DCHECK(thread_checker_.CalledOnValidThread()); |
| 234 mojo_channels_.erase( | 228 mojo_channels_.erase( |
| 235 std::find_if(mojo_channels_.begin(), mojo_channels_.end(), | 229 std::find_if(mojo_channels_.begin(), mojo_channels_.end(), |
| 236 [channel](std::unique_ptr<MojoChannel>& ptr) { | 230 [channel](std::unique_ptr<MojoChannel>& ptr) { |
| 237 return ptr.get() == channel; | 231 return ptr.get() == channel; |
| 238 })); | 232 })); |
| 239 } | 233 } |
| 240 | 234 |
| 241 } // namespace arc | 235 } // namespace arc |
| OLD | NEW |