OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ppapi/proxy/ppb_video_decoder_proxy.h" | 5 #include "ppapi/proxy/ppb_video_decoder_proxy.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "gpu/command_buffer/client/gles2_implementation.h" | 8 #include "gpu/command_buffer/client/gles2_implementation.h" |
9 #include "ppapi/proxy/enter_proxy.h" | 9 #include "ppapi/proxy/enter_proxy.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 PPB_VideoDecoder_Proxy::PPB_VideoDecoder_Proxy(Dispatcher* dispatcher) | 149 PPB_VideoDecoder_Proxy::PPB_VideoDecoder_Proxy(Dispatcher* dispatcher) |
150 : InterfaceProxy(dispatcher), | 150 : InterfaceProxy(dispatcher), |
151 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 151 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
152 } | 152 } |
153 | 153 |
154 PPB_VideoDecoder_Proxy::~PPB_VideoDecoder_Proxy() { | 154 PPB_VideoDecoder_Proxy::~PPB_VideoDecoder_Proxy() { |
155 } | 155 } |
156 | 156 |
157 bool PPB_VideoDecoder_Proxy::OnMessageReceived(const IPC::Message& msg) { | 157 bool PPB_VideoDecoder_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 158 if (!dispatcher()->permissions().HasPermission(PERMISSION_DEV)) |
| 159 return false; |
| 160 |
158 bool handled = true; | 161 bool handled = true; |
159 IPC_BEGIN_MESSAGE_MAP(PPB_VideoDecoder_Proxy, msg) | 162 IPC_BEGIN_MESSAGE_MAP(PPB_VideoDecoder_Proxy, msg) |
160 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_Create, | 163 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_Create, |
161 OnMsgCreate) | 164 OnMsgCreate) |
162 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_Decode, OnMsgDecode) | 165 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_Decode, OnMsgDecode) |
163 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_AssignPictureBuffers, | 166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_AssignPictureBuffers, |
164 OnMsgAssignPictureBuffers) | 167 OnMsgAssignPictureBuffers) |
165 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_ReusePictureBuffer, | 168 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_ReusePictureBuffer, |
166 OnMsgReusePictureBuffer) | 169 OnMsgReusePictureBuffer) |
167 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_Flush, OnMsgFlush) | 170 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoDecoder_Flush, OnMsgFlush) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 309 |
307 void PPB_VideoDecoder_Proxy::OnMsgResetACK( | 310 void PPB_VideoDecoder_Proxy::OnMsgResetACK( |
308 const HostResource& decoder, int32_t result) { | 311 const HostResource& decoder, int32_t result) { |
309 EnterPluginFromHostResource<PPB_VideoDecoder_API> enter(decoder); | 312 EnterPluginFromHostResource<PPB_VideoDecoder_API> enter(decoder); |
310 if (enter.succeeded()) | 313 if (enter.succeeded()) |
311 static_cast<VideoDecoder*>(enter.object())->ResetACK(result); | 314 static_cast<VideoDecoder*>(enter.object())->ResetACK(result); |
312 } | 315 } |
313 | 316 |
314 } // namespace proxy | 317 } // namespace proxy |
315 } // namespace ppapi | 318 } // namespace ppapi |
OLD | NEW |