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
CreateAudioTrusted(PP_Instance instance
) override
;
35 PP_Resource
CreateAudioConfig(PP_Instance instance
,
36 PP_AudioSampleRate sample_rate
,
37 uint32_t sample_frame_count
) override
;
38 PP_Resource
CreateAudioInput(PP_Instance instance
) override
;
39 PP_Resource
CreateCompositor(PP_Instance instance
) override
;
40 PP_Resource
CreateBroker(PP_Instance instance
) override
;
41 PP_Resource
CreateBuffer(PP_Instance instance
, uint32_t size
) override
;
42 PP_Resource
CreateCameraDevicePrivate(PP_Instance instance
) override
;
43 PP_Resource
CreateFlashDRM(PP_Instance instance
) override
;
44 PP_Resource
CreateFlashFontFile(
46 const PP_BrowserFont_Trusted_Description
* description
,
47 PP_PrivateFontCharset charset
) override
;
48 PP_Resource
CreateFlashMenu(PP_Instance instance
,
49 const PP_Flash_Menu
* menu_data
) override
;
50 PP_Resource
CreateFlashMessageLoop(PP_Instance instance
) override
;
51 PP_Resource
CreateGraphics3D(PP_Instance instance
,
52 PP_Resource share_context
,
53 const int32_t* attrib_list
) override
;
54 PP_Resource
CreateGraphics3DRaw(
56 PP_Resource share_context
,
57 const int32_t* attrib_list
,
58 gpu::Capabilities
* capabilities
,
59 base::SharedMemoryHandle
* shared_state
) override
;
60 PP_Resource
CreateHostResolver(PP_Instance instance
) override
;
61 PP_Resource
CreateHostResolverPrivate(PP_Instance instance
) override
;
62 PP_Resource
CreateImageData(PP_Instance instance
,
63 PP_ImageDataFormat format
,
65 PP_Bool init_to_zero
) override
;
66 PP_Resource
CreateImageDataSimple(PP_Instance instance
,
67 PP_ImageDataFormat format
,
69 PP_Bool init_to_zero
) override
;
70 PP_Resource
CreateIMEInputEvent(PP_Instance instance
,
71 PP_InputEvent_Type type
,
72 PP_TimeTicks time_stamp
,
74 uint32_t segment_number
,
75 const uint32_t* segment_offsets
,
76 int32_t target_segment
,
77 uint32_t selection_start
,
78 uint32_t selection_end
) override
;
79 PP_Resource
CreateKeyboardInputEvent_1_0(PP_Instance instance
,
80 PP_InputEvent_Type type
,
81 PP_TimeTicks time_stamp
,
84 PP_Var character_text
) override
;
85 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 PP_Resource
CreateMediaStreamVideoTrack(PP_Instance instance
) override
;
93 PP_Resource
CreateMouseInputEvent(PP_Instance instance
,
94 PP_InputEvent_Type type
,
95 PP_TimeTicks time_stamp
,
97 PP_InputEvent_MouseButton mouse_button
,
98 const PP_Point
* mouse_position
,
100 const PP_Point
* mouse_movement
) override
;
101 PP_Resource
CreateNetAddressFromIPv4Address(
102 PP_Instance instance
,
103 const PP_NetAddress_IPv4
* ipv4_addr
) override
;
104 PP_Resource
CreateNetAddressFromIPv6Address(
105 PP_Instance instance
,
106 const PP_NetAddress_IPv6
* ipv6_addr
) override
;
107 PP_Resource
CreateNetAddressFromNetAddressPrivate(
108 PP_Instance instance
,
109 const PP_NetAddress_Private
& private_addr
) override
;
110 PP_Resource
CreateNetworkMonitor(PP_Instance instance
) override
;
111 PP_Resource
CreatePlatformVerificationPrivate(PP_Instance instance
) override
;
112 PP_Resource
CreateOutputProtectionPrivate(PP_Instance instance
) override
;
113 PP_Resource
CreateTCPServerSocketPrivate(PP_Instance instance
) override
;
114 PP_Resource
CreateTCPSocket1_0(PP_Instance instance
) override
;
115 PP_Resource
CreateTCPSocket(PP_Instance instance
) override
;
116 PP_Resource
CreateTCPSocketPrivate(PP_Instance instance
) override
;
117 PP_Resource
CreateTouchInputEvent(PP_Instance instance
,
118 PP_InputEvent_Type type
,
119 PP_TimeTicks time_stamp
,
120 uint32_t modifiers
) override
;
121 PP_Resource
CreateUDPSocket(PP_Instance instance
) override
;
122 PP_Resource
CreateUDPSocketPrivate(PP_Instance instance
) override
;
123 PP_Resource
CreateVideoCapture(PP_Instance instance
) override
;
124 PP_Resource
CreateVideoDecoder(PP_Instance instance
) override
;
125 PP_Resource
CreateVideoDecoderDev(PP_Instance instance
,
126 PP_Resource graphics3d_id
,
127 PP_VideoDecoder_Profile profile
) override
;
128 PP_Resource
CreateVideoDestination(PP_Instance instance
) override
;
129 PP_Resource
CreateVideoEncoder(PP_Instance instance
) override
;
130 PP_Resource
CreateVideoSource(PP_Instance instance
) override
;
131 PP_Resource
CreateWheelInputEvent(PP_Instance instance
,
132 PP_TimeTicks time_stamp
,
134 const PP_FloatPoint
* wheel_delta
,
135 const PP_FloatPoint
* wheel_ticks
,
136 PP_Bool scroll_by_page
) override
;
137 PP_Resource
CreateX509CertificatePrivate(PP_Instance instance
) override
;
140 DISALLOW_COPY_AND_ASSIGN(ResourceCreationImpl
);
143 } // namespace content
145 #endif // CONTENT_RENDERER_PEPPER_RESOURCE_CREATION_IMPL_H_