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.h" | 5 #include "media/gpu/ipc/service/media_gpu_channel.h" |
6 | 6 |
7 #include "base/unguessable_token.h" | 7 #include "base/unguessable_token.h" |
8 #include "gpu/ipc/service/gpu_channel.h" | 8 #include "gpu/ipc/service/gpu_channel.h" |
9 #include "ipc/message_filter.h" | 9 #include "ipc/message_filter.h" |
10 #include "media/gpu/ipc/common/media_messages.h" | 10 #include "media/gpu/ipc/common/media_messages.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 Send(reply_message); | 82 Send(reply_message); |
83 } | 83 } |
84 | 84 |
85 private: | 85 private: |
86 ~MediaGpuChannelFilter() override {} | 86 ~MediaGpuChannelFilter() override {} |
87 | 87 |
88 IPC::Channel* channel_; | 88 IPC::Channel* channel_; |
89 base::UnguessableToken channel_token_; | 89 base::UnguessableToken channel_token_; |
90 }; | 90 }; |
91 | 91 |
92 MediaGpuChannel::MediaGpuChannel(gpu::GpuChannel* channel) : channel_(channel) { | 92 MediaGpuChannel::MediaGpuChannel(gpu::GpuChannel* channel, |
93 channel_->AddFilter( | 93 const base::UnguessableToken& channel_token) |
94 new MediaGpuChannelFilter(base::UnguessableToken::Create())); | 94 : channel_(channel) { |
| 95 channel_->AddFilter(new MediaGpuChannelFilter(channel_token)); |
95 } | 96 } |
96 | 97 |
97 MediaGpuChannel::~MediaGpuChannel() {} | 98 MediaGpuChannel::~MediaGpuChannel() {} |
98 | 99 |
99 bool MediaGpuChannel::Send(IPC::Message* msg) { | 100 bool MediaGpuChannel::Send(IPC::Message* msg) { |
100 return channel_->Send(msg); | 101 return channel_->Send(msg); |
101 } | 102 } |
102 | 103 |
103 bool MediaGpuChannel::OnMessageReceived(const IPC::Message& message) { | 104 bool MediaGpuChannel::OnMessageReceived(const IPC::Message& message) { |
104 MediaGpuChannelDispatchHelper helper(this, message.routing_id()); | 105 MediaGpuChannelDispatchHelper helper(this, message.routing_id()); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 params.output_profile, params.initial_bitrate); | 174 params.output_profile, params.initial_bitrate); |
174 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(reply_message, | 175 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(reply_message, |
175 succeeded); | 176 succeeded); |
176 Send(reply_message); | 177 Send(reply_message); |
177 | 178 |
178 // encoder is registered as a DestructionObserver of this stub and will | 179 // encoder is registered as a DestructionObserver of this stub and will |
179 // self-delete during destruction of this stub. | 180 // self-delete during destruction of this stub. |
180 } | 181 } |
181 | 182 |
182 } // namespace media | 183 } // namespace media |
OLD | NEW |