| 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 "content/renderer/pepper/resource_creation_impl.h" | 5 #include "content/renderer/pepper/resource_creation_impl.h" |
| 6 | 6 |
| 7 #include "content/renderer/pepper/common.h" | 7 #include "content/renderer/pepper/common.h" |
| 8 #include "content/renderer/pepper/ppb_audio_impl.h" | 8 #include "content/renderer/pepper/ppb_audio_impl.h" |
| 9 #include "content/renderer/pepper/ppb_broker_impl.h" | 9 #include "content/renderer/pepper/ppb_broker_impl.h" |
| 10 #include "content/renderer/pepper/ppb_buffer_impl.h" | 10 #include "content/renderer/pepper/ppb_buffer_impl.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 using ppapi::InputEventData; | 23 using ppapi::InputEventData; |
| 24 using ppapi::PPB_InputEvent_Shared; | 24 using ppapi::PPB_InputEvent_Shared; |
| 25 using ppapi::StringVar; | 25 using ppapi::StringVar; |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) { | 29 ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 ResourceCreationImpl::~ResourceCreationImpl() { | 32 ResourceCreationImpl::~ResourceCreationImpl() {} |
| 33 } | |
| 34 | 33 |
| 35 PP_Resource ResourceCreationImpl::CreateAudio1_0( | 34 PP_Resource ResourceCreationImpl::CreateAudio1_0( |
| 36 PP_Instance instance, | 35 PP_Instance instance, |
| 37 PP_Resource config_id, | 36 PP_Resource config_id, |
| 38 PPB_Audio_Callback_1_0 audio_callback, | 37 PPB_Audio_Callback_1_0 audio_callback, |
| 39 void* user_data) { | 38 void* user_data) { |
| 40 return 0; // Not supported in-process. | 39 return 0; // Not supported in-process. |
| 41 } | 40 } |
| 42 | 41 |
| 43 PP_Resource ResourceCreationImpl::CreateAudio( | 42 PP_Resource ResourceCreationImpl::CreateAudio(PP_Instance instance, |
| 44 PP_Instance instance, | 43 PP_Resource config_id, |
| 45 PP_Resource config_id, | 44 PPB_Audio_Callback audio_callback, |
| 46 PPB_Audio_Callback audio_callback, | 45 void* user_data) { |
| 47 void* user_data) { | |
| 48 return 0; // Not supported in-process. | 46 return 0; // Not supported in-process. |
| 49 } | 47 } |
| 50 | 48 |
| 51 PP_Resource ResourceCreationImpl::CreateAudioConfig( | 49 PP_Resource ResourceCreationImpl::CreateAudioConfig( |
| 52 PP_Instance instance, | 50 PP_Instance instance, |
| 53 PP_AudioSampleRate sample_rate, | 51 PP_AudioSampleRate sample_rate, |
| 54 uint32_t sample_frame_count) { | 52 uint32_t sample_frame_count) { |
| 55 return ppapi::PPB_AudioConfig_Shared::Create( | 53 return ppapi::PPB_AudioConfig_Shared::Create( |
| 56 ppapi::OBJECT_IS_IMPL, instance, sample_rate, sample_frame_count); | 54 ppapi::OBJECT_IS_IMPL, instance, sample_rate, sample_frame_count); |
| 57 } | 55 } |
| 58 | 56 |
| 59 PP_Resource ResourceCreationImpl::CreateAudioTrusted( | 57 PP_Resource ResourceCreationImpl::CreateAudioTrusted(PP_Instance instance) { |
| 60 PP_Instance instance) { | |
| 61 return (new PPB_Audio_Impl(instance))->GetReference(); | 58 return (new PPB_Audio_Impl(instance))->GetReference(); |
| 62 } | 59 } |
| 63 | 60 |
| 64 PP_Resource ResourceCreationImpl::CreateAudioInput(PP_Instance instance) { | 61 PP_Resource ResourceCreationImpl::CreateAudioInput(PP_Instance instance) { |
| 65 return 0; // Not supported in-process. | 62 return 0; // Not supported in-process. |
| 66 } | 63 } |
| 67 | 64 |
| 68 PP_Resource ResourceCreationImpl::CreateBroker(PP_Instance instance) { | 65 PP_Resource ResourceCreationImpl::CreateBroker(PP_Instance instance) { |
| 69 return (new PPB_Broker_Impl(instance))->GetReference(); | 66 return (new PPB_Broker_Impl(instance))->GetReference(); |
| 70 } | 67 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 88 PP_Resource ResourceCreationImpl::CreateFlashMenu( | 85 PP_Resource ResourceCreationImpl::CreateFlashMenu( |
| 89 PP_Instance instance, | 86 PP_Instance instance, |
| 90 const PP_Flash_Menu* menu_data) { | 87 const PP_Flash_Menu* menu_data) { |
| 91 return 0; // Not supported in-process. | 88 return 0; // Not supported in-process. |
| 92 } | 89 } |
| 93 | 90 |
| 94 PP_Resource ResourceCreationImpl::CreateFlashMessageLoop(PP_Instance instance) { | 91 PP_Resource ResourceCreationImpl::CreateFlashMessageLoop(PP_Instance instance) { |
| 95 return PPB_Flash_MessageLoop_Impl::Create(instance); | 92 return PPB_Flash_MessageLoop_Impl::Create(instance); |
| 96 } | 93 } |
| 97 | 94 |
| 98 PP_Resource ResourceCreationImpl::CreateGraphics3D( | 95 PP_Resource ResourceCreationImpl::CreateGraphics3D(PP_Instance instance, |
| 99 PP_Instance instance, | 96 PP_Resource share_context, |
| 100 PP_Resource share_context, | 97 const int32_t* attrib_list) { |
| 101 const int32_t* attrib_list) { | |
| 102 return PPB_Graphics3D_Impl::Create(instance, share_context, attrib_list); | 98 return PPB_Graphics3D_Impl::Create(instance, share_context, attrib_list); |
| 103 } | 99 } |
| 104 | 100 |
| 105 PP_Resource ResourceCreationImpl::CreateGraphics3DRaw( | 101 PP_Resource ResourceCreationImpl::CreateGraphics3DRaw( |
| 106 PP_Instance instance, | 102 PP_Instance instance, |
| 107 PP_Resource share_context, | 103 PP_Resource share_context, |
| 108 const int32_t* attrib_list) { | 104 const int32_t* attrib_list) { |
| 109 return PPB_Graphics3D_Impl::CreateRaw(instance, share_context, attrib_list); | 105 return PPB_Graphics3D_Impl::CreateRaw(instance, share_context, attrib_list); |
| 110 } | 106 } |
| 111 | 107 |
| 112 PP_Resource ResourceCreationImpl::CreateHostResolver(PP_Instance instance) { | 108 PP_Resource ResourceCreationImpl::CreateHostResolver(PP_Instance instance) { |
| 113 return 0; // Not supported in-process. | 109 return 0; // Not supported in-process. |
| 114 } | 110 } |
| 115 | 111 |
| 116 PP_Resource ResourceCreationImpl::CreateHostResolverPrivate( | 112 PP_Resource ResourceCreationImpl::CreateHostResolverPrivate( |
| 117 PP_Instance instance) { | 113 PP_Instance instance) { |
| 118 return 0; // Not supported in-process. | 114 return 0; // Not supported in-process. |
| 119 } | 115 } |
| 120 | 116 |
| 121 PP_Resource ResourceCreationImpl::CreateImageData( | 117 PP_Resource ResourceCreationImpl::CreateImageData(PP_Instance instance, |
| 122 PP_Instance instance, | 118 PP_ImageDataFormat format, |
| 123 PP_ImageDataFormat format, | 119 const PP_Size* size, |
| 124 const PP_Size* size, | 120 PP_Bool init_to_zero) { |
| 125 PP_Bool init_to_zero) { | |
| 126 return PPB_ImageData_Impl::Create(instance, | 121 return PPB_ImageData_Impl::Create(instance, |
| 127 ppapi::PPB_ImageData_Shared::PLATFORM, | 122 ppapi::PPB_ImageData_Shared::PLATFORM, |
| 128 format, *size, init_to_zero); | 123 format, |
| 124 *size, |
| 125 init_to_zero); |
| 129 } | 126 } |
| 130 | 127 |
| 131 PP_Resource ResourceCreationImpl::CreateImageDataSimple( | 128 PP_Resource ResourceCreationImpl::CreateImageDataSimple( |
| 132 PP_Instance instance, | 129 PP_Instance instance, |
| 133 PP_ImageDataFormat format, | 130 PP_ImageDataFormat format, |
| 134 const PP_Size* size, | 131 const PP_Size* size, |
| 135 PP_Bool init_to_zero) { | 132 PP_Bool init_to_zero) { |
| 136 return PPB_ImageData_Impl::Create(instance, | 133 return PPB_ImageData_Impl::Create(instance, |
| 137 ppapi::PPB_ImageData_Shared::SIMPLE, | 134 ppapi::PPB_ImageData_Shared::SIMPLE, |
| 138 format, *size, init_to_zero); | 135 format, |
| 136 *size, |
| 137 init_to_zero); |
| 139 } | 138 } |
| 140 | 139 |
| 141 PP_Resource ResourceCreationImpl::CreateIMEInputEvent( | 140 PP_Resource ResourceCreationImpl::CreateIMEInputEvent( |
| 142 PP_Instance instance, | 141 PP_Instance instance, |
| 143 PP_InputEvent_Type type, | 142 PP_InputEvent_Type type, |
| 144 PP_TimeTicks time_stamp, | 143 PP_TimeTicks time_stamp, |
| 145 struct PP_Var text, | 144 struct PP_Var text, |
| 146 uint32_t segment_number, | 145 uint32_t segment_number, |
| 147 const uint32_t* segment_offsets, | 146 const uint32_t* segment_offsets, |
| 148 int32_t target_segment, | 147 int32_t target_segment, |
| 149 uint32_t selection_start, | 148 uint32_t selection_start, |
| 150 uint32_t selection_end) { | 149 uint32_t selection_end) { |
| 151 return PPB_InputEvent_Shared::CreateIMEInputEvent( | 150 return PPB_InputEvent_Shared::CreateIMEInputEvent(ppapi::OBJECT_IS_IMPL, |
| 152 ppapi::OBJECT_IS_IMPL, instance, type, time_stamp, text, segment_number, | 151 instance, |
| 153 segment_offsets, target_segment, selection_start, selection_end); | 152 type, |
| 153 time_stamp, |
| 154 text, |
| 155 segment_number, |
| 156 segment_offsets, |
| 157 target_segment, |
| 158 selection_start, |
| 159 selection_end); |
| 154 } | 160 } |
| 155 | 161 |
| 156 PP_Resource ResourceCreationImpl::CreateKeyboardInputEvent_1_0( | 162 PP_Resource ResourceCreationImpl::CreateKeyboardInputEvent_1_0( |
| 157 PP_Instance instance, | 163 PP_Instance instance, |
| 158 PP_InputEvent_Type type, | 164 PP_InputEvent_Type type, |
| 159 PP_TimeTicks time_stamp, | 165 PP_TimeTicks time_stamp, |
| 160 uint32_t modifiers, | 166 uint32_t modifiers, |
| 161 uint32_t key_code, | 167 uint32_t key_code, |
| 162 struct PP_Var character_text) { | 168 struct PP_Var character_text) { |
| 163 PP_Var code = StringVar::StringToPPVar(""); | 169 PP_Var code = StringVar::StringToPPVar(""); |
| 164 return PPB_InputEvent_Shared::CreateKeyboardInputEvent( | 170 return PPB_InputEvent_Shared::CreateKeyboardInputEvent(ppapi::OBJECT_IS_IMPL, |
| 165 ppapi::OBJECT_IS_IMPL, instance, type, time_stamp, modifiers, key_code, | 171 instance, |
| 166 character_text, code); | 172 type, |
| 173 time_stamp, |
| 174 modifiers, |
| 175 key_code, |
| 176 character_text, |
| 177 code); |
| 167 } | 178 } |
| 168 | 179 |
| 169 PP_Resource ResourceCreationImpl::CreateKeyboardInputEvent_1_2( | 180 PP_Resource ResourceCreationImpl::CreateKeyboardInputEvent_1_2( |
| 170 PP_Instance instance, | 181 PP_Instance instance, |
| 171 PP_InputEvent_Type type, | 182 PP_InputEvent_Type type, |
| 172 PP_TimeTicks time_stamp, | 183 PP_TimeTicks time_stamp, |
| 173 uint32_t modifiers, | 184 uint32_t modifiers, |
| 174 uint32_t key_code, | 185 uint32_t key_code, |
| 175 struct PP_Var character_text, | 186 struct PP_Var character_text, |
| 176 struct PP_Var code) { | 187 struct PP_Var code) { |
| 177 return PPB_InputEvent_Shared::CreateKeyboardInputEvent( | 188 return PPB_InputEvent_Shared::CreateKeyboardInputEvent(ppapi::OBJECT_IS_IMPL, |
| 178 ppapi::OBJECT_IS_IMPL, instance, type, time_stamp, modifiers, key_code, | 189 instance, |
| 179 character_text, code); | 190 type, |
| 191 time_stamp, |
| 192 modifiers, |
| 193 key_code, |
| 194 character_text, |
| 195 code); |
| 180 } | 196 } |
| 181 | 197 |
| 182 PP_Resource ResourceCreationImpl::CreateMouseInputEvent( | 198 PP_Resource ResourceCreationImpl::CreateMouseInputEvent( |
| 183 PP_Instance instance, | 199 PP_Instance instance, |
| 184 PP_InputEvent_Type type, | 200 PP_InputEvent_Type type, |
| 185 PP_TimeTicks time_stamp, | 201 PP_TimeTicks time_stamp, |
| 186 uint32_t modifiers, | 202 uint32_t modifiers, |
| 187 PP_InputEvent_MouseButton mouse_button, | 203 PP_InputEvent_MouseButton mouse_button, |
| 188 const PP_Point* mouse_position, | 204 const PP_Point* mouse_position, |
| 189 int32_t click_count, | 205 int32_t click_count, |
| 190 const PP_Point* mouse_movement) { | 206 const PP_Point* mouse_movement) { |
| 191 return PPB_InputEvent_Shared::CreateMouseInputEvent( | 207 return PPB_InputEvent_Shared::CreateMouseInputEvent(ppapi::OBJECT_IS_IMPL, |
| 192 ppapi::OBJECT_IS_IMPL, instance, type, time_stamp, modifiers, | 208 instance, |
| 193 mouse_button, mouse_position, click_count, mouse_movement); | 209 type, |
| 210 time_stamp, |
| 211 modifiers, |
| 212 mouse_button, |
| 213 mouse_position, |
| 214 click_count, |
| 215 mouse_movement); |
| 194 } | 216 } |
| 195 | 217 |
| 196 PP_Resource ResourceCreationImpl::CreateNetAddressFromIPv4Address( | 218 PP_Resource ResourceCreationImpl::CreateNetAddressFromIPv4Address( |
| 197 PP_Instance instance, | 219 PP_Instance instance, |
| 198 const PP_NetAddress_IPv4* ipv4_addr) { | 220 const PP_NetAddress_IPv4* ipv4_addr) { |
| 199 return 0; // Not supported in-process. | 221 return 0; // Not supported in-process. |
| 200 } | 222 } |
| 201 | 223 |
| 202 PP_Resource ResourceCreationImpl::CreateNetAddressFromIPv6Address( | 224 PP_Resource ResourceCreationImpl::CreateNetAddressFromIPv6Address( |
| 203 PP_Instance instance, | 225 PP_Instance instance, |
| 204 const PP_NetAddress_IPv6* ipv6_addr) { | 226 const PP_NetAddress_IPv6* ipv6_addr) { |
| 205 return 0; // Not supported in-process. | 227 return 0; // Not supported in-process. |
| 206 } | 228 } |
| 207 | 229 |
| 208 PP_Resource ResourceCreationImpl::CreateNetAddressFromNetAddressPrivate( | 230 PP_Resource ResourceCreationImpl::CreateNetAddressFromNetAddressPrivate( |
| 209 PP_Instance instance, | 231 PP_Instance instance, |
| 210 const PP_NetAddress_Private& private_addr) { | 232 const PP_NetAddress_Private& private_addr) { |
| 211 return 0; // Not supported in-process. | 233 return 0; // Not supported in-process. |
| 212 } | 234 } |
| 213 | 235 |
| 214 PP_Resource ResourceCreationImpl::CreateTouchInputEvent( | 236 PP_Resource ResourceCreationImpl::CreateTouchInputEvent(PP_Instance instance, |
| 215 PP_Instance instance, | 237 PP_InputEvent_Type type, |
| 216 PP_InputEvent_Type type, | 238 PP_TimeTicks time_stamp, |
| 217 PP_TimeTicks time_stamp, | 239 uint32_t modifiers) { |
| 218 uint32_t modifiers) { | |
| 219 return PPB_InputEvent_Shared::CreateTouchInputEvent( | 240 return PPB_InputEvent_Shared::CreateTouchInputEvent( |
| 220 ppapi::OBJECT_IS_IMPL, instance, type, time_stamp, modifiers); | 241 ppapi::OBJECT_IS_IMPL, instance, type, time_stamp, modifiers); |
| 221 } | 242 } |
| 222 | 243 |
| 223 PP_Resource ResourceCreationImpl::CreateNetworkMonitor(PP_Instance instance) { | 244 PP_Resource ResourceCreationImpl::CreateNetworkMonitor(PP_Instance instance) { |
| 224 return 0; // Not supported in-process. | 245 return 0; // Not supported in-process. |
| 225 } | 246 } |
| 226 | 247 |
| 227 PP_Resource ResourceCreationImpl::CreateOutputProtectionPrivate( | 248 PP_Resource ResourceCreationImpl::CreateOutputProtectionPrivate( |
| 228 PP_Instance instance) { | 249 PP_Instance instance) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 return 0; // VideoCapture is not supported in process now. | 293 return 0; // VideoCapture is not supported in process now. |
| 273 } | 294 } |
| 274 | 295 |
| 275 PP_Resource ResourceCreationImpl::CreateVideoDecoder( | 296 PP_Resource ResourceCreationImpl::CreateVideoDecoder( |
| 276 PP_Instance instance, | 297 PP_Instance instance, |
| 277 PP_Resource graphics3d_id, | 298 PP_Resource graphics3d_id, |
| 278 PP_VideoDecoder_Profile profile) { | 299 PP_VideoDecoder_Profile profile) { |
| 279 return PPB_VideoDecoder_Impl::Create(instance, graphics3d_id, profile); | 300 return PPB_VideoDecoder_Impl::Create(instance, graphics3d_id, profile); |
| 280 } | 301 } |
| 281 | 302 |
| 282 PP_Resource ResourceCreationImpl::CreateVideoDestination( | 303 PP_Resource ResourceCreationImpl::CreateVideoDestination(PP_Instance instance) { |
| 283 PP_Instance instance) { | |
| 284 return 0; // Not supported in-process. | 304 return 0; // Not supported in-process. |
| 285 } | 305 } |
| 286 | 306 |
| 287 PP_Resource ResourceCreationImpl::CreateVideoSource( | 307 PP_Resource ResourceCreationImpl::CreateVideoSource(PP_Instance instance) { |
| 288 PP_Instance instance) { | |
| 289 return 0; // Not supported in-process. | 308 return 0; // Not supported in-process. |
| 290 } | 309 } |
| 291 | 310 |
| 292 PP_Resource ResourceCreationImpl::CreateWheelInputEvent( | 311 PP_Resource ResourceCreationImpl::CreateWheelInputEvent( |
| 293 PP_Instance instance, | 312 PP_Instance instance, |
| 294 PP_TimeTicks time_stamp, | 313 PP_TimeTicks time_stamp, |
| 295 uint32_t modifiers, | 314 uint32_t modifiers, |
| 296 const PP_FloatPoint* wheel_delta, | 315 const PP_FloatPoint* wheel_delta, |
| 297 const PP_FloatPoint* wheel_ticks, | 316 const PP_FloatPoint* wheel_ticks, |
| 298 PP_Bool scroll_by_page) { | 317 PP_Bool scroll_by_page) { |
| 299 return PPB_InputEvent_Shared::CreateWheelInputEvent( | 318 return PPB_InputEvent_Shared::CreateWheelInputEvent(ppapi::OBJECT_IS_IMPL, |
| 300 ppapi::OBJECT_IS_IMPL, instance, time_stamp, modifiers, | 319 instance, |
| 301 wheel_delta, wheel_ticks, scroll_by_page); | 320 time_stamp, |
| 321 modifiers, |
| 322 wheel_delta, |
| 323 wheel_ticks, |
| 324 scroll_by_page); |
| 302 } | 325 } |
| 303 | 326 |
| 304 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( | 327 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( |
| 305 PP_Instance instance) { | 328 PP_Instance instance) { |
| 306 return 0; // Not supported in-process. | 329 return 0; // Not supported in-process. |
| 307 } | 330 } |
| 308 | 331 |
| 309 } // namespace content | 332 } // namespace content |
| OLD | NEW |