| OLD | NEW |
| 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/resource_creation_impl.h" | 5 #include "webkit/plugins/ppapi/resource_creation_impl.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_size.h" | 7 #include "ppapi/c/pp_size.h" |
| 8 #include "ppapi/shared_impl/ppb_audio_config_shared.h" | 8 #include "ppapi/shared_impl/ppb_audio_config_shared.h" |
| 9 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 9 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
| 10 #include "ppapi/shared_impl/ppb_resource_array_shared.h" |
| 10 #include "ppapi/shared_impl/var.h" | 11 #include "ppapi/shared_impl/var.h" |
| 11 #include "webkit/plugins/ppapi/common.h" | 12 #include "webkit/plugins/ppapi/common.h" |
| 12 #include "webkit/plugins/ppapi/ppb_audio_impl.h" | 13 #include "webkit/plugins/ppapi/ppb_audio_impl.h" |
| 13 #include "webkit/plugins/ppapi/ppb_audio_input_impl.h" | 14 #include "webkit/plugins/ppapi/ppb_audio_input_impl.h" |
| 14 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 15 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
| 15 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" | 16 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" |
| 16 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" | 17 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" |
| 17 #include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" | 18 #include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" |
| 18 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | 19 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
| 19 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" | 20 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 30 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" | 31 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" |
| 31 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 32 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
| 32 #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" | 33 #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" |
| 33 #include "webkit/plugins/ppapi/ppb_video_capture_impl.h" | 34 #include "webkit/plugins/ppapi/ppb_video_capture_impl.h" |
| 34 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 35 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
| 35 #include "webkit/plugins/ppapi/ppb_video_layer_impl.h" | 36 #include "webkit/plugins/ppapi/ppb_video_layer_impl.h" |
| 36 #include "webkit/plugins/ppapi/ppb_websocket_impl.h" | 37 #include "webkit/plugins/ppapi/ppb_websocket_impl.h" |
| 37 | 38 |
| 38 using ppapi::InputEventData; | 39 using ppapi::InputEventData; |
| 39 using ppapi::PPB_InputEvent_Shared; | 40 using ppapi::PPB_InputEvent_Shared; |
| 41 using ppapi::PPB_ResourceArray_Shared; |
| 40 using ppapi::StringVar; | 42 using ppapi::StringVar; |
| 41 | 43 |
| 42 namespace webkit { | 44 namespace webkit { |
| 43 namespace ppapi { | 45 namespace ppapi { |
| 44 | 46 |
| 45 ResourceCreationImpl::ResourceCreationImpl(PluginInstance* instance) { | 47 ResourceCreationImpl::ResourceCreationImpl(PluginInstance* instance) { |
| 46 } | 48 } |
| 47 | 49 |
| 48 ResourceCreationImpl::~ResourceCreationImpl() { | 50 ResourceCreationImpl::~ResourceCreationImpl() { |
| 49 } | 51 } |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 229 |
| 228 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), | 230 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), |
| 229 instance, data))->GetReference(); | 231 instance, data))->GetReference(); |
| 230 } | 232 } |
| 231 | 233 |
| 232 PP_Resource ResourceCreationImpl::CreateScrollbar(PP_Instance instance, | 234 PP_Resource ResourceCreationImpl::CreateScrollbar(PP_Instance instance, |
| 233 PP_Bool vertical) { | 235 PP_Bool vertical) { |
| 234 return PPB_Scrollbar_Impl::Create(instance, PP_ToBool(vertical)); | 236 return PPB_Scrollbar_Impl::Create(instance, PP_ToBool(vertical)); |
| 235 } | 237 } |
| 236 | 238 |
| 239 PP_Resource ResourceCreationImpl::CreateResourceArray( |
| 240 PP_Instance instance, |
| 241 const PP_Resource elements[], |
| 242 uint32_t size) { |
| 243 PPB_ResourceArray_Shared* object = new PPB_ResourceArray_Shared( |
| 244 PPB_ResourceArray_Shared::InitAsImpl(), instance, elements, size); |
| 245 return object->GetReference(); |
| 246 } |
| 247 |
| 237 PP_Resource ResourceCreationImpl::CreateTCPSocketPrivate(PP_Instance instance) { | 248 PP_Resource ResourceCreationImpl::CreateTCPSocketPrivate(PP_Instance instance) { |
| 238 return PPB_TCPSocket_Private_Impl::CreateResource(instance); | 249 return PPB_TCPSocket_Private_Impl::CreateResource(instance); |
| 239 } | 250 } |
| 240 | 251 |
| 241 PP_Resource ResourceCreationImpl::CreateTransport(PP_Instance instance, | 252 PP_Resource ResourceCreationImpl::CreateTransport(PP_Instance instance, |
| 242 const char* name, | 253 const char* name, |
| 243 PP_TransportType type) { | 254 PP_TransportType type) { |
| 244 #if defined(ENABLE_P2P_APIS) | 255 #if defined(ENABLE_P2P_APIS) |
| 245 return PPB_Transport_Impl::Create(instance, name, type); | 256 return PPB_Transport_Impl::Create(instance, name, type); |
| 246 #endif | 257 #endif |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 data.wheel_delta = *wheel_delta; | 309 data.wheel_delta = *wheel_delta; |
| 299 data.wheel_ticks = *wheel_ticks; | 310 data.wheel_ticks = *wheel_ticks; |
| 300 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); | 311 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); |
| 301 | 312 |
| 302 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), | 313 return (new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), |
| 303 instance, data))->GetReference(); | 314 instance, data))->GetReference(); |
| 304 } | 315 } |
| 305 | 316 |
| 306 } // namespace ppapi | 317 } // namespace ppapi |
| 307 } // namespace webkit | 318 } // namespace webkit |
| OLD | NEW |