| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/interface_id.h" | 9 #include "ppapi/proxy/interface_id.h" |
| 10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "ppapi/proxy/ppb_video_capture_proxy.h" | 33 #include "ppapi/proxy/ppb_video_capture_proxy.h" |
| 34 #include "ppapi/proxy/ppb_video_decoder_proxy.h" | 34 #include "ppapi/proxy/ppb_video_decoder_proxy.h" |
| 35 #include "ppapi/shared_impl/font_impl.h" | 35 #include "ppapi/shared_impl/font_impl.h" |
| 36 #include "ppapi/shared_impl/function_group_base.h" | 36 #include "ppapi/shared_impl/function_group_base.h" |
| 37 #include "ppapi/shared_impl/host_resource.h" | 37 #include "ppapi/shared_impl/host_resource.h" |
| 38 #include "ppapi/shared_impl/input_event_impl.h" | 38 #include "ppapi/shared_impl/input_event_impl.h" |
| 39 #include "ppapi/shared_impl/var.h" | 39 #include "ppapi/shared_impl/var.h" |
| 40 #include "ppapi/thunk/enter.h" | 40 #include "ppapi/thunk/enter.h" |
| 41 #include "ppapi/thunk/ppb_image_data_api.h" | 41 #include "ppapi/thunk/ppb_image_data_api.h" |
| 42 | 42 |
| 43 using ppapi::HostResource; | |
| 44 using ppapi::InputEventData; | |
| 45 using ppapi::StringVar; | |
| 46 using ppapi::thunk::ResourceCreationAPI; | 43 using ppapi::thunk::ResourceCreationAPI; |
| 47 | 44 |
| 48 namespace pp { | 45 namespace ppapi { |
| 49 namespace proxy { | 46 namespace proxy { |
| 50 | 47 |
| 51 ResourceCreationProxy::ResourceCreationProxy(Dispatcher* dispatcher) | 48 ResourceCreationProxy::ResourceCreationProxy(Dispatcher* dispatcher) |
| 52 : dispatcher_(dispatcher) { | 49 : dispatcher_(dispatcher) { |
| 53 } | 50 } |
| 54 | 51 |
| 55 ResourceCreationProxy::~ResourceCreationProxy() { | 52 ResourceCreationProxy::~ResourceCreationProxy() { |
| 56 } | 53 } |
| 57 | 54 |
| 58 ResourceCreationAPI* ResourceCreationProxy::AsResourceCreationAPI() { | 55 ResourceCreationAPI* ResourceCreationProxy::AsResourceCreationAPI() { |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 387 |
| 391 // Get the shared memory handle. | 388 // Get the shared memory handle. |
| 392 const PPB_ImageDataTrusted* trusted = | 389 const PPB_ImageDataTrusted* trusted = |
| 393 reinterpret_cast<const PPB_ImageDataTrusted*>( | 390 reinterpret_cast<const PPB_ImageDataTrusted*>( |
| 394 dispatcher_->GetLocalInterface(PPB_IMAGEDATA_TRUSTED_INTERFACE)); | 391 dispatcher_->GetLocalInterface(PPB_IMAGEDATA_TRUSTED_INTERFACE)); |
| 395 uint32_t byte_count = 0; | 392 uint32_t byte_count = 0; |
| 396 if (trusted) { | 393 if (trusted) { |
| 397 int32_t handle; | 394 int32_t handle; |
| 398 if (trusted->GetSharedMemory(resource, &handle, &byte_count) == PP_OK) { | 395 if (trusted->GetSharedMemory(resource, &handle, &byte_count) == PP_OK) { |
| 399 #if defined(OS_WIN) | 396 #if defined(OS_WIN) |
| 400 pp::proxy::ImageHandle ih = ImageData::HandleFromInt(handle); | 397 ImageHandle ih = ImageData::HandleFromInt(handle); |
| 401 *result_image_handle = dispatcher_->ShareHandleWithRemote(ih, false); | 398 *result_image_handle = dispatcher_->ShareHandleWithRemote(ih, false); |
| 402 #else | 399 #else |
| 403 *result_image_handle = ImageData::HandleFromInt(handle); | 400 *result_image_handle = ImageData::HandleFromInt(handle); |
| 404 #endif | 401 #endif |
| 405 } | 402 } |
| 406 } | 403 } |
| 407 } | 404 } |
| 408 | 405 |
| 409 } // namespace proxy | 406 } // namespace proxy |
| 410 } // namespace pp | 407 } // namespace ppapi |
| OLD | NEW |