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 "media/gpu/ipc/service/media_gpu_channel_manager.h" | 5 #include "media/gpu/ipc/service/media_gpu_channel_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "gpu/ipc/service/gpu_channel.h" | 10 #include "gpu/ipc/service/gpu_channel.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 : channel_manager_(channel_manager) {} | 22 : channel_manager_(channel_manager) {} |
23 | 23 |
24 MediaGpuChannelManager::~MediaGpuChannelManager() {} | 24 MediaGpuChannelManager::~MediaGpuChannelManager() {} |
25 | 25 |
26 void MediaGpuChannelManager::AddChannel(int32_t client_id) { | 26 void MediaGpuChannelManager::AddChannel(int32_t client_id) { |
27 gpu::GpuChannel* gpu_channel = channel_manager_->LookupChannel(client_id); | 27 gpu::GpuChannel* gpu_channel = channel_manager_->LookupChannel(client_id); |
28 DCHECK(gpu_channel); | 28 DCHECK(gpu_channel); |
29 std::unique_ptr<MediaGpuChannel> media_gpu_channel( | 29 std::unique_ptr<MediaGpuChannel> media_gpu_channel( |
30 new MediaGpuChannel(gpu_channel)); | 30 new MediaGpuChannel(gpu_channel)); |
31 gpu_channel->SetUnhandledMessageListener(media_gpu_channel.get()); | 31 gpu_channel->SetUnhandledMessageListener(media_gpu_channel.get()); |
32 media_gpu_channels_.set(client_id, std::move(media_gpu_channel)); | 32 media_gpu_channels_[client_id] = std::move(media_gpu_channel); |
33 } | 33 } |
34 | 34 |
35 void MediaGpuChannelManager::RemoveChannel(int32_t client_id) { | 35 void MediaGpuChannelManager::RemoveChannel(int32_t client_id) { |
36 media_gpu_channels_.erase(client_id); | 36 media_gpu_channels_.erase(client_id); |
37 } | 37 } |
38 | 38 |
39 void MediaGpuChannelManager::DestroyAllChannels() { | 39 void MediaGpuChannelManager::DestroyAllChannels() { |
40 media_gpu_channels_.clear(); | 40 media_gpu_channels_.clear(); |
41 } | 41 } |
42 | 42 |
43 } // namespace media | 43 } // namespace media |
OLD | NEW |