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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_PEPPER_RESOURCE_CREATION_IMPL_H_
6 #define CONTENT_RENDERER_PEPPER_RESOURCE_CREATION_IMPL_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ppapi/thunk/resource_creation_api.h"
14 class PepperPluginInstanceImpl
;
16 // This is an abstract class. ResourceCreationAPI functions that implement
17 // "old-style" resources are handled here. See
18 // content/renderer/pepper/pepper_in_process_resource_creation.h for functions
19 // that implement "new-style" resources.
20 class ResourceCreationImpl
: public ppapi::thunk::ResourceCreationAPI
{
22 explicit ResourceCreationImpl(PepperPluginInstanceImpl
* instance
);
23 ~ResourceCreationImpl() override
;
25 // ResourceCreationAPI implementation.
26 PP_Resource
CreateAudio1_0(PP_Instance instance
,
27 PP_Resource config_id
,
28 PPB_Audio_Callback_1_0 audio_callback
,
29 void* user_data
) override
;
30 PP_Resource
CreateAudio(PP_Instance instance
,
31 PP_Resource config_id
,
32 PPB_Audio_Callback audio_callback
,
33 void* user_data
) override
;
34 PP_Resource
CreateAudioEncoder(PP_Instance instance
) override
;
35 PP_Resource
CreateAudioTrusted(PP_Instance instance
) override
;
36 PP_Resource
CreateAudioConfig(PP_Instance instance
,
37 PP_AudioSampleRate sample_rate
,
38 uint32_t sample_frame_count
) override
;
39 PP_Resource
CreateAudioInput(PP_Instance instance
) override
;
40 PP_Resource
CreateCompositor(PP_Instance instance
) override
;
41 PP_Resource
CreateBroker(PP_Instance instance
) override
;
42 PP_Resource
CreateBuffer(PP_Instance instance
, uint32_t size
) override
;
43 PP_Resource
CreateCameraDevicePrivate(PP_Instance instance
) override
;
44 PP_Resource
CreateFlashDRM(PP_Instance instance
) override
;
45 PP_Resource
CreateFlashFontFile(
47 const PP_BrowserFont_Trusted_Description
* description
,
48 PP_PrivateFontCharset charset
) override
;
49 PP_Resource
CreateFlashMenu(PP_Instance instance
,
50 const PP_Flash_Menu
* menu_data
) override
;
51 PP_Resource
CreateFlashMessageLoop(PP_Instance instance
) override
;
52 PP_Resource
CreateGraphics3D(PP_Instance instance
,
53 PP_Resource share_context
,
54 const int32_t* attrib_list
) override
;
55 PP_Resource
CreateGraphics3DRaw(
57 PP_Resource share_context
,
58 const int32_t* attrib_list
,
59 gpu::Capabilities
* capabilities
,
60 base::SharedMemoryHandle
* shared_state
,
61 uint64_t* command_buffer_id
) override
;
62 PP_Resource
CreateHostResolver(PP_Instance instance
) override
;
63 PP_Resource
CreateHostResolverPrivate(PP_Instance instance
) override
;
64 PP_Resource
CreateImageData(PP_Instance instance
,
65 PP_ImageDataFormat format
,
67 PP_Bool init_to_zero
) override
;
68 PP_Resource
CreateImageDataSimple(PP_Instance instance
,
69 PP_ImageDataFormat format
,
71 PP_Bool init_to_zero
) override
;
72 PP_Resource
CreateIMEInputEvent(PP_Instance instance
,
73 PP_InputEvent_Type type
,
74 PP_TimeTicks time_stamp
,
76 uint32_t segment_number
,
77 const uint32_t* segment_offsets
,
78 int32_t target_segment
,
79 uint32_t selection_start
,
80 uint32_t selection_end
) override
;
81 PP_Resource
CreateKeyboardInputEvent_1_0(PP_Instance instance
,
82 PP_InputEvent_Type type
,
83 PP_TimeTicks time_stamp
,
86 PP_Var character_text
) override
;
87 PP_Resource
CreateKeyboardInputEvent_1_2(PP_Instance instance
,
88 PP_InputEvent_Type type
,
89 PP_TimeTicks time_stamp
,
92 PP_Var character_text
,
93 PP_Var code
) override
;
94 PP_Resource
CreateMediaStreamVideoTrack(PP_Instance instance
) override
;
95 PP_Resource
CreateMouseInputEvent(PP_Instance instance
,
96 PP_InputEvent_Type type
,
97 PP_TimeTicks time_stamp
,
99 PP_InputEvent_MouseButton mouse_button
,
100 const PP_Point
* mouse_position
,
102 const PP_Point
* mouse_movement
) override
;
103 PP_Resource
CreateNetAddressFromIPv4Address(
104 PP_Instance instance
,
105 const PP_NetAddress_IPv4
* ipv4_addr
) override
;
106 PP_Resource
CreateNetAddressFromIPv6Address(
107 PP_Instance instance
,
108 const PP_NetAddress_IPv6
* ipv6_addr
) override
;
109 PP_Resource
CreateNetAddressFromNetAddressPrivate(
110 PP_Instance instance
,
111 const PP_NetAddress_Private
& private_addr
) override
;
112 PP_Resource
CreateNetworkMonitor(PP_Instance instance
) override
;
113 PP_Resource
CreatePlatformVerificationPrivate(PP_Instance instance
) override
;
114 PP_Resource
CreateOutputProtectionPrivate(PP_Instance instance
) override
;
115 PP_Resource
CreateTCPServerSocketPrivate(PP_Instance instance
) override
;
116 PP_Resource
CreateTCPSocket1_0(PP_Instance instance
) override
;
117 PP_Resource
CreateTCPSocket(PP_Instance instance
) override
;
118 PP_Resource
CreateTCPSocketPrivate(PP_Instance instance
) override
;
119 PP_Resource
CreateTouchInputEvent(PP_Instance instance
,
120 PP_InputEvent_Type type
,
121 PP_TimeTicks time_stamp
,
122 uint32_t modifiers
) override
;
123 PP_Resource
CreateUDPSocket(PP_Instance instance
) override
;
124 PP_Resource
CreateUDPSocketPrivate(PP_Instance instance
) override
;
125 PP_Resource
CreateVideoCapture(PP_Instance instance
) override
;
126 PP_Resource
CreateVideoDecoder(PP_Instance instance
) override
;
127 PP_Resource
CreateVideoDecoderDev(PP_Instance instance
,
128 PP_Resource graphics3d_id
,
129 PP_VideoDecoder_Profile profile
) override
;
130 PP_Resource
CreateVideoDestination(PP_Instance instance
) override
;
131 PP_Resource
CreateVideoEncoder(PP_Instance instance
) override
;
132 PP_Resource
CreateVideoSource(PP_Instance instance
) override
;
133 PP_Resource
CreateWheelInputEvent(PP_Instance instance
,
134 PP_TimeTicks time_stamp
,
136 const PP_FloatPoint
* wheel_delta
,
137 const PP_FloatPoint
* wheel_ticks
,
138 PP_Bool scroll_by_page
) override
;
139 PP_Resource
CreateX509CertificatePrivate(PP_Instance instance
) override
;
142 DISALLOW_COPY_AND_ASSIGN(ResourceCreationImpl
);
145 } // namespace content
147 #endif // CONTENT_RENDERER_PEPPER_RESOURCE_CREATION_IMPL_H_