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 virtual ~ResourceCreationImpl();
25 // ResourceCreationAPI implementation.
26 virtual 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 virtual PP_Resource
CreateAudio(PP_Instance instance
,
31 PP_Resource config_id
,
32 PPB_Audio_Callback audio_callback
,
33 void* user_data
) override
;
34 virtual PP_Resource
CreateAudioTrusted(PP_Instance instance
) override
;
35 virtual PP_Resource
CreateAudioConfig(PP_Instance instance
,
36 PP_AudioSampleRate sample_rate
,
37 uint32_t sample_frame_count
) override
;
38 virtual PP_Resource
CreateAudioInput(PP_Instance instance
) override
;
39 virtual PP_Resource
CreateCompositor(PP_Instance instance
) override
;
40 virtual PP_Resource
CreateBroker(PP_Instance instance
) override
;
41 virtual PP_Resource
CreateBuffer(PP_Instance instance
,
42 uint32_t size
) override
;
43 virtual PP_Resource
CreateFlashDRM(PP_Instance instance
) override
;
44 virtual PP_Resource
CreateFlashFontFile(
46 const PP_BrowserFont_Trusted_Description
* description
,
47 PP_PrivateFontCharset charset
) override
;
48 virtual PP_Resource
CreateFlashMenu(PP_Instance instance
,
49 const PP_Flash_Menu
* menu_data
) override
;
50 virtual PP_Resource
CreateFlashMessageLoop(PP_Instance instance
) override
;
51 virtual PP_Resource
CreateGraphics3D(PP_Instance instance
,
52 PP_Resource share_context
,
53 const int32_t* attrib_list
) override
;
54 virtual PP_Resource
CreateGraphics3DRaw(
56 PP_Resource share_context
,
57 const int32_t* attrib_list
,
58 base::SharedMemoryHandle
* shared_state
) override
;
59 virtual PP_Resource
CreateHostResolver(PP_Instance instance
) override
;
60 virtual PP_Resource
CreateHostResolverPrivate(PP_Instance instance
) override
;
61 virtual PP_Resource
CreateImageData(PP_Instance instance
,
62 PP_ImageDataFormat format
,
64 PP_Bool init_to_zero
) override
;
65 virtual PP_Resource
CreateImageDataSimple(PP_Instance instance
,
66 PP_ImageDataFormat format
,
68 PP_Bool init_to_zero
) override
;
69 virtual PP_Resource
CreateIMEInputEvent(PP_Instance instance
,
70 PP_InputEvent_Type type
,
71 PP_TimeTicks time_stamp
,
73 uint32_t segment_number
,
74 const uint32_t* segment_offsets
,
75 int32_t target_segment
,
76 uint32_t selection_start
,
77 uint32_t selection_end
) override
;
78 virtual PP_Resource
CreateKeyboardInputEvent_1_0(PP_Instance instance
,
79 PP_InputEvent_Type type
,
80 PP_TimeTicks time_stamp
,
83 PP_Var character_text
)
85 virtual PP_Resource
CreateKeyboardInputEvent_1_2(PP_Instance instance
,
86 PP_InputEvent_Type type
,
87 PP_TimeTicks time_stamp
,
90 PP_Var character_text
,
91 PP_Var code
) override
;
92 virtual PP_Resource
CreateMediaStreamVideoTrack(
93 PP_Instance instance
) override
;
94 virtual PP_Resource
CreateMouseInputEvent(
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 virtual PP_Resource
CreateNetAddressFromIPv4Address(
104 PP_Instance instance
,
105 const PP_NetAddress_IPv4
* ipv4_addr
) override
;
106 virtual PP_Resource
CreateNetAddressFromIPv6Address(
107 PP_Instance instance
,
108 const PP_NetAddress_IPv6
* ipv6_addr
) override
;
109 virtual PP_Resource
CreateNetAddressFromNetAddressPrivate(
110 PP_Instance instance
,
111 const PP_NetAddress_Private
& private_addr
) override
;
112 virtual PP_Resource
CreateNetworkMonitor(PP_Instance instance
) override
;
113 virtual PP_Resource
CreatePlatformVerificationPrivate(PP_Instance instance
)
115 virtual PP_Resource
CreateScrollbar(PP_Instance instance
,
116 PP_Bool vertical
) override
;
117 virtual PP_Resource
CreateOutputProtectionPrivate(PP_Instance instance
)
119 virtual PP_Resource
CreateTalk(PP_Instance instance
) override
;
120 virtual PP_Resource
CreateTCPServerSocketPrivate(PP_Instance instance
)
122 virtual PP_Resource
CreateTCPSocket1_0(PP_Instance instance
) override
;
123 virtual PP_Resource
CreateTCPSocket(PP_Instance instance
) override
;
124 virtual PP_Resource
CreateTCPSocketPrivate(PP_Instance instance
) override
;
125 virtual PP_Resource
CreateTouchInputEvent(PP_Instance instance
,
126 PP_InputEvent_Type type
,
127 PP_TimeTicks time_stamp
,
128 uint32_t modifiers
) override
;
129 virtual PP_Resource
CreateUDPSocket(PP_Instance instance
) override
;
130 virtual PP_Resource
CreateUDPSocketPrivate(PP_Instance instance
) override
;
131 virtual PP_Resource
CreateVideoCapture(PP_Instance instance
) override
;
132 virtual PP_Resource
CreateVideoDecoder(PP_Instance instance
) override
;
133 virtual PP_Resource
CreateVideoDecoderDev(PP_Instance instance
,
134 PP_Resource graphics3d_id
,
135 PP_VideoDecoder_Profile profile
)
137 virtual PP_Resource
CreateVideoDestination(PP_Instance instance
) override
;
138 virtual PP_Resource
CreateVideoSource(PP_Instance instance
) override
;
139 virtual PP_Resource
CreateWheelInputEvent(PP_Instance instance
,
140 PP_TimeTicks time_stamp
,
142 const PP_FloatPoint
* wheel_delta
,
143 const PP_FloatPoint
* wheel_ticks
,
144 PP_Bool scroll_by_page
) override
;
145 virtual PP_Resource
CreateX509CertificatePrivate(PP_Instance instance
)
149 DISALLOW_COPY_AND_ASSIGN(ResourceCreationImpl
);
152 } // namespace content
154 #endif // CONTENT_RENDERER_PEPPER_RESOURCE_CREATION_IMPL_H_