Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: ppapi/thunk/resource_creation_api.h

Issue 10116003: Add #ifdefs to separate NaCl and non-NaCl PPAPI Proxy code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/thunk/interfaces_ppb_public_stable.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef PPAPI_THUNK_RESOURCE_CREATION_API_H_ 5 #ifndef PPAPI_THUNK_RESOURCE_CREATION_API_H_
6 #define PPAPI_THUNK_RESOURCE_CREATION_API_H_ 6 #define PPAPI_THUNK_RESOURCE_CREATION_API_H_
7 7
8 #include "ppapi/c/dev/ppb_audio_input_dev.h" 8 #include "ppapi/c/dev/ppb_audio_input_dev.h"
9 #include "ppapi/c/dev/ppb_file_chooser_dev.h" 9 #include "ppapi/c/dev/ppb_file_chooser_dev.h"
10 #include "ppapi/c/dev/ppb_video_layer_dev.h" 10 #include "ppapi/c/dev/ppb_video_layer_dev.h"
(...skipping 24 matching lines...) Expand all
35 35
36 // A functional API for creating resource types. Separating out the creation 36 // A functional API for creating resource types. Separating out the creation
37 // functions here allows us to implement most resources as a pure "resource 37 // functions here allows us to implement most resources as a pure "resource
38 // API", meaning all calls are routed on a per-resource-object basis. The 38 // API", meaning all calls are routed on a per-resource-object basis. The
39 // creation functions are not per-object (since there's no object during 39 // creation functions are not per-object (since there's no object during
40 // creation) so need functional routing based on the instance ID. 40 // creation) so need functional routing based on the instance ID.
41 class ResourceCreationAPI { 41 class ResourceCreationAPI {
42 public: 42 public:
43 virtual ~ResourceCreationAPI() {} 43 virtual ~ResourceCreationAPI() {}
44 44
45 virtual PP_Resource CreateFileIO(PP_Instance instance) = 0;
46 virtual PP_Resource CreateFileRef(PP_Resource file_system,
47 const char* path) = 0;
48 virtual PP_Resource CreateFileSystem(PP_Instance instance,
49 PP_FileSystemType type) = 0;
50 virtual PP_Resource CreateKeyboardInputEvent(
51 PP_Instance instance,
52 PP_InputEvent_Type type,
53 PP_TimeTicks time_stamp,
54 uint32_t modifiers,
55 uint32_t key_code,
56 struct PP_Var character_text) = 0;
57 virtual PP_Resource CreateMouseInputEvent(
58 PP_Instance instance,
59 PP_InputEvent_Type type,
60 PP_TimeTicks time_stamp,
61 uint32_t modifiers,
62 PP_InputEvent_MouseButton mouse_button,
63 const PP_Point* mouse_position,
64 int32_t click_count,
65 const PP_Point* mouse_movement) = 0;
66 virtual PP_Resource CreateResourceArray(PP_Instance instance,
67 const PP_Resource elements[],
68 uint32_t size) = 0;
69 virtual PP_Resource CreateURLLoader(PP_Instance instance) = 0;
70 virtual PP_Resource CreateURLRequestInfo(
71 PP_Instance instance,
72 const PPB_URLRequestInfo_Data& data) = 0;
73 virtual PP_Resource CreateWheelInputEvent(
74 PP_Instance instance,
75 PP_TimeTicks time_stamp,
76 uint32_t modifiers,
77 const PP_FloatPoint* wheel_delta,
78 const PP_FloatPoint* wheel_ticks,
79 PP_Bool scroll_by_page) = 0;
80
81 #if !defined(OS_NACL)
45 virtual PP_Resource CreateAudio(PP_Instance instance, 82 virtual PP_Resource CreateAudio(PP_Instance instance,
46 PP_Resource config_id, 83 PP_Resource config_id,
47 PPB_Audio_Callback audio_callback, 84 PPB_Audio_Callback audio_callback,
48 void* user_data) = 0; 85 void* user_data) = 0;
49 virtual PP_Resource CreateAudioTrusted(PP_Instance instance) = 0; 86 virtual PP_Resource CreateAudioTrusted(PP_Instance instance) = 0;
50 virtual PP_Resource CreateAudioConfig(PP_Instance instance, 87 virtual PP_Resource CreateAudioConfig(PP_Instance instance,
51 PP_AudioSampleRate sample_rate, 88 PP_AudioSampleRate sample_rate,
52 uint32_t sample_frame_count) = 0; 89 uint32_t sample_frame_count) = 0;
53 virtual PP_Resource CreateAudioInput0_1( 90 virtual PP_Resource CreateAudioInput0_1(
54 PP_Instance instance, 91 PP_Instance instance,
55 PP_Resource config_id, 92 PP_Resource config_id,
56 PPB_AudioInput_Callback audio_input_callback, 93 PPB_AudioInput_Callback audio_input_callback,
57 void* user_data) = 0; 94 void* user_data) = 0;
58 virtual PP_Resource CreateAudioInput(PP_Instance instance) = 0; 95 virtual PP_Resource CreateAudioInput(PP_Instance instance) = 0;
59 virtual PP_Resource CreateBroker(PP_Instance instance) = 0; 96 virtual PP_Resource CreateBroker(PP_Instance instance) = 0;
60 virtual PP_Resource CreateBrowserFont( 97 virtual PP_Resource CreateBrowserFont(
61 PP_Instance instance, 98 PP_Instance instance,
62 const PP_BrowserFont_Trusted_Description* description) = 0; 99 const PP_BrowserFont_Trusted_Description* description) = 0;
63 virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) = 0; 100 virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) = 0;
64 virtual PP_Resource CreateDirectoryReader(PP_Resource directory_ref) = 0; 101 virtual PP_Resource CreateDirectoryReader(PP_Resource directory_ref) = 0;
65 virtual PP_Resource CreateFileChooser( 102 virtual PP_Resource CreateFileChooser(
66 PP_Instance instance, 103 PP_Instance instance,
67 PP_FileChooserMode_Dev mode, 104 PP_FileChooserMode_Dev mode,
68 const char* accept_mime_types) = 0; 105 const char* accept_mime_types) = 0;
69 virtual PP_Resource CreateFileIO(PP_Instance instance) = 0;
70 virtual PP_Resource CreateFileRef(PP_Resource file_system,
71 const char* path) = 0;
72 virtual PP_Resource CreateFileSystem(PP_Instance instance,
73 PP_FileSystemType type) = 0;
74 virtual PP_Resource CreateFlashMenu(PP_Instance instance, 106 virtual PP_Resource CreateFlashMenu(PP_Instance instance,
75 const PP_Flash_Menu* menu_data) = 0; 107 const PP_Flash_Menu* menu_data) = 0;
76 virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) = 0; 108 virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) = 0;
77 virtual PP_Resource CreateGraphics2D(PP_Instance instance, 109 virtual PP_Resource CreateGraphics2D(PP_Instance instance,
78 const PP_Size& size, 110 const PP_Size& size,
79 PP_Bool is_always_opaque) = 0; 111 PP_Bool is_always_opaque) = 0;
80 virtual PP_Resource CreateGraphics3D(PP_Instance instance, 112 virtual PP_Resource CreateGraphics3D(PP_Instance instance,
81 PP_Resource share_context, 113 PP_Resource share_context,
82 const int32_t* attrib_list) = 0; 114 const int32_t* attrib_list) = 0;
83 virtual PP_Resource CreateGraphics3DRaw(PP_Instance instance, 115 virtual PP_Resource CreateGraphics3DRaw(PP_Instance instance,
84 PP_Resource share_context, 116 PP_Resource share_context,
85 const int32_t* attrib_list) = 0; 117 const int32_t* attrib_list) = 0;
86 virtual PP_Resource CreateHostResolverPrivate(PP_Instance instance) = 0; 118 virtual PP_Resource CreateHostResolverPrivate(PP_Instance instance) = 0;
87 virtual PP_Resource CreateImageData(PP_Instance instance, 119 virtual PP_Resource CreateImageData(PP_Instance instance,
88 PP_ImageDataFormat format, 120 PP_ImageDataFormat format,
89 const PP_Size& size, 121 const PP_Size& size,
90 PP_Bool init_to_zero) = 0; 122 PP_Bool init_to_zero) = 0;
91 virtual PP_Resource CreateKeyboardInputEvent(
92 PP_Instance instance,
93 PP_InputEvent_Type type,
94 PP_TimeTicks time_stamp,
95 uint32_t modifiers,
96 uint32_t key_code,
97 struct PP_Var character_text) = 0;
98 virtual PP_Resource CreateMouseInputEvent(
99 PP_Instance instance,
100 PP_InputEvent_Type type,
101 PP_TimeTicks time_stamp,
102 uint32_t modifiers,
103 PP_InputEvent_MouseButton mouse_button,
104 const PP_Point* mouse_position,
105 int32_t click_count,
106 const PP_Point* mouse_movement) = 0;
107 virtual PP_Resource CreateNetworkMonitor( 123 virtual PP_Resource CreateNetworkMonitor(
108 PP_Instance instance, 124 PP_Instance instance,
109 PPB_NetworkMonitor_Callback callback, 125 PPB_NetworkMonitor_Callback callback,
110 void* user_data) = 0; 126 void* user_data) = 0;
111 virtual PP_Resource CreateResourceArray(PP_Instance instance,
112 const PP_Resource elements[],
113 uint32_t size) = 0;
114 virtual PP_Resource CreateScrollbar(PP_Instance instance, 127 virtual PP_Resource CreateScrollbar(PP_Instance instance,
115 PP_Bool vertical) = 0; 128 PP_Bool vertical) = 0;
116 virtual PP_Resource CreateTalk(PP_Instance instance) = 0; 129 virtual PP_Resource CreateTalk(PP_Instance instance) = 0;
117 virtual PP_Resource CreateTCPServerSocketPrivate(PP_Instance instance) = 0; 130 virtual PP_Resource CreateTCPServerSocketPrivate(PP_Instance instance) = 0;
118 virtual PP_Resource CreateTCPSocketPrivate(PP_Instance instace) = 0; 131 virtual PP_Resource CreateTCPSocketPrivate(PP_Instance instace) = 0;
119 virtual PP_Resource CreateTransport(PP_Instance instance, 132 virtual PP_Resource CreateTransport(PP_Instance instance,
120 const char* name, 133 const char* name,
121 PP_TransportType type) = 0; 134 PP_TransportType type) = 0;
122 virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instace) = 0; 135 virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instace) = 0;
123 virtual PP_Resource CreateURLLoader(PP_Instance instance) = 0;
124 virtual PP_Resource CreateURLRequestInfo(
125 PP_Instance instance,
126 const PPB_URLRequestInfo_Data& data) = 0;
127 virtual PP_Resource CreateVideoCapture(PP_Instance instance) = 0; 136 virtual PP_Resource CreateVideoCapture(PP_Instance instance) = 0;
128 virtual PP_Resource CreateVideoDecoder( 137 virtual PP_Resource CreateVideoDecoder(
129 PP_Instance instance, 138 PP_Instance instance,
130 PP_Resource context3d_id, 139 PP_Resource context3d_id,
131 PP_VideoDecoder_Profile profile) = 0; 140 PP_VideoDecoder_Profile profile) = 0;
132 virtual PP_Resource CreateVideoLayer(PP_Instance instance, 141 virtual PP_Resource CreateVideoLayer(PP_Instance instance,
133 PP_VideoLayerMode_Dev mode) = 0; 142 PP_VideoLayerMode_Dev mode) = 0;
134 virtual PP_Resource CreateWebSocket(PP_Instance instance) = 0; 143 virtual PP_Resource CreateWebSocket(PP_Instance instance) = 0;
135 virtual PP_Resource CreateWheelInputEvent(
136 PP_Instance instance,
137 PP_TimeTicks time_stamp,
138 uint32_t modifiers,
139 const PP_FloatPoint* wheel_delta,
140 const PP_FloatPoint* wheel_ticks,
141 PP_Bool scroll_by_page) = 0;
142 virtual PP_Resource CreateX509CertificatePrivate(PP_Instance instance) = 0; 144 virtual PP_Resource CreateX509CertificatePrivate(PP_Instance instance) = 0;
145 #endif // !defined(OS_NACL)
143 146
144 static const ApiID kApiID = API_ID_RESOURCE_CREATION; 147 static const ApiID kApiID = API_ID_RESOURCE_CREATION;
145 }; 148 };
146 149
147 } // namespace thunk 150 } // namespace thunk
148 } // namespace ppapi 151 } // namespace ppapi
149 152
150 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ 153 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_
OLDNEW
« no previous file with comments | « ppapi/thunk/interfaces_ppb_public_stable.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698