1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "mojo/examples/pepper_container_app/resource_creation_impl.h"
7 #include "base/logging.h"
8 #include "mojo/examples/pepper_container_app/graphics_3d_resource.h"
13 ResourceCreationImpl::ResourceCreationImpl() {}
15 ResourceCreationImpl::~ResourceCreationImpl() {}
17 PP_Resource
ResourceCreationImpl::CreateFileIO(PP_Instance instance
) {
22 PP_Resource
ResourceCreationImpl::CreateFileRef(
24 const ppapi::FileRefCreateInfo
& create_info
) {
29 PP_Resource
ResourceCreationImpl::CreateFileSystem(
31 PP_FileSystemType type
) {
36 PP_Resource
ResourceCreationImpl::CreateIMEInputEvent(
38 PP_InputEvent_Type type
,
39 PP_TimeTicks time_stamp
,
41 uint32_t segment_number
,
42 const uint32_t* segment_offsets
,
43 int32_t target_segment
,
44 uint32_t selection_start
,
45 uint32_t selection_end
) {
50 PP_Resource
ResourceCreationImpl::CreateKeyboardInputEvent_1_0(
52 PP_InputEvent_Type type
,
53 PP_TimeTicks time_stamp
,
56 struct PP_Var character_text
) {
61 PP_Resource
ResourceCreationImpl::CreateKeyboardInputEvent_1_2(
63 PP_InputEvent_Type type
,
64 PP_TimeTicks time_stamp
,
67 struct PP_Var character_text
,
73 PP_Resource
ResourceCreationImpl::CreateMouseInputEvent(
75 PP_InputEvent_Type type
,
76 PP_TimeTicks time_stamp
,
78 PP_InputEvent_MouseButton mouse_button
,
79 const PP_Point
* mouse_position
,
81 const PP_Point
* mouse_movement
) {
86 PP_Resource
ResourceCreationImpl::CreateTouchInputEvent(
88 PP_InputEvent_Type type
,
89 PP_TimeTicks time_stamp
,
95 PP_Resource
ResourceCreationImpl::CreateTrueTypeFont(
97 const PP_TrueTypeFontDesc_Dev
* desc
) {
102 PP_Resource
ResourceCreationImpl::CreateURLLoader(PP_Instance instance
) {
107 PP_Resource
ResourceCreationImpl::CreateURLRequestInfo(
108 PP_Instance instance
) {
113 PP_Resource
ResourceCreationImpl::CreateWheelInputEvent(
114 PP_Instance instance
,
115 PP_TimeTicks time_stamp
,
117 const PP_FloatPoint
* wheel_delta
,
118 const PP_FloatPoint
* wheel_ticks
,
119 PP_Bool scroll_by_page
) {
124 PP_Resource
ResourceCreationImpl::CreateAudio1_0(
125 PP_Instance instance
,
126 PP_Resource config_id
,
127 PPB_Audio_Callback_1_0 audio_callback
,
133 PP_Resource
ResourceCreationImpl::CreateAudio(
134 PP_Instance instance
,
135 PP_Resource config_id
,
136 PPB_Audio_Callback audio_callback
,
142 PP_Resource
ResourceCreationImpl::CreateAudioTrusted(PP_Instance instance
) {
147 PP_Resource
ResourceCreationImpl::CreateAudioConfig(
148 PP_Instance instance
,
149 PP_AudioSampleRate sample_rate
,
150 uint32_t sample_frame_count
) {
155 PP_Resource
ResourceCreationImpl::CreateCompositor(PP_Instance instance
) {
160 PP_Resource
ResourceCreationImpl::CreateFileChooser(
161 PP_Instance instance
,
162 PP_FileChooserMode_Dev mode
,
163 const PP_Var
& accept_types
) {
168 PP_Resource
ResourceCreationImpl::CreateGraphics2D(PP_Instance instance
,
170 PP_Bool is_always_opaque
) {
175 PP_Resource
ResourceCreationImpl::CreateGraphics3D(
176 PP_Instance instance
,
177 PP_Resource share_context
,
178 const int32_t* attrib_list
) {
179 return (new Graphics3DResource(instance
))->GetReference();
182 PP_Resource
ResourceCreationImpl::CreateGraphics3DRaw(
183 PP_Instance instance
,
184 PP_Resource share_context
,
185 const int32_t* attrib_list
) {
190 PP_Resource
ResourceCreationImpl::CreateHostResolver(PP_Instance instance
) {
195 PP_Resource
ResourceCreationImpl::CreateHostResolverPrivate(
196 PP_Instance instance
) {
201 PP_Resource
ResourceCreationImpl::CreateImageData(
202 PP_Instance instance
,
203 PP_ImageDataFormat format
,
205 PP_Bool init_to_zero
) {
210 PP_Resource
ResourceCreationImpl::CreateImageDataSimple(
211 PP_Instance instance
,
212 PP_ImageDataFormat format
,
214 PP_Bool init_to_zero
) {
219 PP_Resource
ResourceCreationImpl::CreateMediaStreamVideoTrack(
220 PP_Instance instance
) {
225 PP_Resource
ResourceCreationImpl::CreateNetAddressFromIPv4Address(
226 PP_Instance instance
,
227 const PP_NetAddress_IPv4
* ipv4_addr
) {
232 PP_Resource
ResourceCreationImpl::CreateNetAddressFromIPv6Address(
233 PP_Instance instance
,
234 const PP_NetAddress_IPv6
* ipv6_addr
) {
239 PP_Resource
ResourceCreationImpl::CreateNetAddressFromNetAddressPrivate(
240 PP_Instance instance
,
241 const PP_NetAddress_Private
& private_addr
) {
246 PP_Resource
ResourceCreationImpl::CreateNetworkMonitor(
247 PP_Instance instance
) {
252 PP_Resource
ResourceCreationImpl::CreateOutputProtectionPrivate(
253 PP_Instance instance
) {
258 PP_Resource
ResourceCreationImpl::CreatePrinting(PP_Instance instance
) {
263 PP_Resource
ResourceCreationImpl::CreateTCPServerSocketPrivate(
264 PP_Instance instance
) {
269 PP_Resource
ResourceCreationImpl::CreateTCPSocket1_0(
270 PP_Instance instance
) {
275 PP_Resource
ResourceCreationImpl::CreateTCPSocket(
276 PP_Instance instance
) {
281 PP_Resource
ResourceCreationImpl::CreateTCPSocketPrivate(
282 PP_Instance instance
) {
287 PP_Resource
ResourceCreationImpl::CreateUDPSocket(PP_Instance instance
) {
292 PP_Resource
ResourceCreationImpl::CreateUDPSocketPrivate(
293 PP_Instance instance
) {
298 PP_Resource
ResourceCreationImpl::CreateVideoDecoder(PP_Instance instance
) {
303 PP_Resource
ResourceCreationImpl::CreateVideoDestination(
304 PP_Instance instance
) {
309 PP_Resource
ResourceCreationImpl::CreateVideoSource(
310 PP_Instance instance
) {
315 PP_Resource
ResourceCreationImpl::CreateWebSocket(PP_Instance instance
) {
320 PP_Resource
ResourceCreationImpl::CreateX509CertificatePrivate(
321 PP_Instance instance
) {
326 #if !defined(OS_NACL)
327 PP_Resource
ResourceCreationImpl::CreateAudioInput(
328 PP_Instance instance
) {
333 PP_Resource
ResourceCreationImpl::CreateBroker(PP_Instance instance
) {
338 PP_Resource
ResourceCreationImpl::CreateBrowserFont(
339 PP_Instance instance
,
340 const PP_BrowserFont_Trusted_Description
* description
) {
345 PP_Resource
ResourceCreationImpl::CreateBuffer(PP_Instance instance
,
351 PP_Resource
ResourceCreationImpl::CreateFlashDRM(PP_Instance instance
) {
356 PP_Resource
ResourceCreationImpl::CreateFlashFontFile(
357 PP_Instance instance
,
358 const PP_BrowserFont_Trusted_Description
* description
,
359 PP_PrivateFontCharset charset
) {
364 PP_Resource
ResourceCreationImpl::CreateFlashMenu(
365 PP_Instance instance
,
366 const PP_Flash_Menu
* menu_data
) {
371 PP_Resource
ResourceCreationImpl::CreateFlashMessageLoop(
372 PP_Instance instance
) {
377 PP_Resource
ResourceCreationImpl::CreatePlatformVerificationPrivate(
378 PP_Instance instance
) {
383 PP_Resource
ResourceCreationImpl::CreateScrollbar(PP_Instance instance
,
389 PP_Resource
ResourceCreationImpl::CreateTalk(PP_Instance instance
) {
394 PP_Resource
ResourceCreationImpl::CreateVideoCapture(PP_Instance instance
) {
399 PP_Resource
ResourceCreationImpl::CreateVideoDecoderDev(
400 PP_Instance instance
,
401 PP_Resource context3d_id
,
402 PP_VideoDecoder_Profile profile
) {
406 #endif // !defined(OS_NACL)
408 } // namespace examples