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/resource_creation_proxy.h" | 5 #include "ppapi/proxy/resource_creation_proxy.h" |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/pp_size.h" | 8 #include "ppapi/c/pp_size.h" |
9 #include "ppapi/proxy/audio_input_resource.h" | 9 #include "ppapi/proxy/audio_input_resource.h" |
10 #include "ppapi/proxy/browser_font_resource_trusted.h" | 10 #include "ppapi/proxy/browser_font_resource_trusted.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // of the proxy on the host side. | 247 // of the proxy on the host side. |
248 return 0; | 248 return 0; |
249 } | 249 } |
250 | 250 |
251 PP_Resource ResourceCreationProxy::CreateHostResolverPrivate( | 251 PP_Resource ResourceCreationProxy::CreateHostResolverPrivate( |
252 PP_Instance instance) { | 252 PP_Instance instance) { |
253 return (new HostResolverPrivateResource( | 253 return (new HostResolverPrivateResource( |
254 GetConnection(), instance))->GetReference(); | 254 GetConnection(), instance))->GetReference(); |
255 } | 255 } |
256 | 256 |
257 PP_Resource ResourceCreationProxy::CreateImageData(PP_Instance instance, | 257 PP_Resource ResourceCreationProxy::CreateImageData( |
258 PP_ImageDataFormat format, | |
259 const PP_Size* size, | |
260 PP_Bool init_to_zero) { | |
261 return PPB_ImageData_Proxy::CreateProxyResource(instance, format, *size, | |
262 init_to_zero); | |
263 } | |
264 | |
265 PP_Resource ResourceCreationProxy::CreateImageDataNaCl( | |
266 PP_Instance instance, | 258 PP_Instance instance, |
| 259 PPB_ImageData_Shared::ImageDataType type, |
267 PP_ImageDataFormat format, | 260 PP_ImageDataFormat format, |
268 const PP_Size* size, | 261 const PP_Size* size, |
269 PP_Bool init_to_zero) { | 262 PP_Bool init_to_zero) { |
270 // These really only are different on the host side. On the plugin side, we | 263 return PPB_ImageData_Proxy::CreateProxyResource(instance, type, |
271 // always request a "platform" ImageData if we're trusted, or a "NaCl" one | 264 format, *size, init_to_zero); |
272 // if we're untrusted (see PPB_ImageData_Proxy::CreateProxyResource()). | |
273 return CreateImageData(instance, format, size, init_to_zero); | |
274 } | 265 } |
275 | 266 |
276 PP_Resource ResourceCreationProxy::CreateNetAddressFromIPv4Address( | 267 PP_Resource ResourceCreationProxy::CreateNetAddressFromIPv4Address( |
277 PP_Instance instance, | 268 PP_Instance instance, |
278 const PP_NetAddress_IPv4_Dev* ipv4_addr) { | 269 const PP_NetAddress_IPv4_Dev* ipv4_addr) { |
279 return (new NetAddressResource(GetConnection(), instance, | 270 return (new NetAddressResource(GetConnection(), instance, |
280 *ipv4_addr))->GetReference(); | 271 *ipv4_addr))->GetReference(); |
281 } | 272 } |
282 | 273 |
283 PP_Resource ResourceCreationProxy::CreateNetAddressFromIPv6Address( | 274 PP_Resource ResourceCreationProxy::CreateNetAddressFromIPv6Address( |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { | 415 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { |
425 return false; | 416 return false; |
426 } | 417 } |
427 | 418 |
428 Connection ResourceCreationProxy::GetConnection() { | 419 Connection ResourceCreationProxy::GetConnection() { |
429 return Connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher()); | 420 return Connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher()); |
430 } | 421 } |
431 | 422 |
432 } // namespace proxy | 423 } // namespace proxy |
433 } // namespace ppapi | 424 } // namespace ppapi |
OLD | NEW |