cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / ppapi / native_client / tests / ppapi_test_lib / get_browser_interface.cc
blob38ccf10851199a25a599fdcaa589f4efd112f9a4
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 #include "native_client/src/shared/platform/nacl_check.h"
7 #include "ppapi/c/dev/ppb_font_dev.h"
8 #include "ppapi/c/dev/ppb_memory_dev.h"
9 #include "ppapi/c/dev/ppb_testing_dev.h"
10 #include "ppapi/c/dev/ppb_var_deprecated.h"
11 #include "ppapi/c/ppb_audio.h"
12 #include "ppapi/c/ppb_audio_config.h"
13 #include "ppapi/c/ppb_core.h"
14 #include "ppapi/c/ppb_file_io.h"
15 #include "ppapi/c/ppb_file_ref.h"
16 #include "ppapi/c/ppb_file_system.h"
17 #include "ppapi/c/ppb_fullscreen.h"
18 #include "ppapi/c/ppb_graphics_2d.h"
19 #include "ppapi/c/ppb_graphics_3d.h"
20 #include "ppapi/c/ppb_image_data.h"
21 #include "ppapi/c/ppb_input_event.h"
22 #include "ppapi/c/ppb_instance.h"
23 #include "ppapi/c/ppb_messaging.h"
24 #include "ppapi/c/ppb_mouse_cursor.h"
25 #include "ppapi/c/ppb_opengles2.h"
26 #include "ppapi/c/ppb_url_loader.h"
27 #include "ppapi/c/ppb_url_request_info.h"
28 #include "ppapi/c/ppb_url_response_info.h"
29 #include "ppapi/c/ppb_var.h"
30 #include "ppapi/c/ppb_view.h"
32 #include "ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h"
33 #include "ppapi/native_client/tests/ppapi_test_lib/internal_utils.h"
35 // Use for dev interfaces that might not be present.
36 const void* GetBrowserInterface(const char* interface_name) {
37 return (*ppb_get_interface())(interface_name);
40 // Use for stable interfaces that must always be present.
41 const void* GetBrowserInterfaceSafe(const char* interface_name) {
42 const void* ppb_interface = (*ppb_get_interface())(interface_name);
43 CHECK(ppb_interface != NULL);
44 return ppb_interface;
47 // Stable interfaces.
49 const PPB_Audio* PPBAudio() {
50 return reinterpret_cast<const PPB_Audio*>(
51 GetBrowserInterfaceSafe(PPB_AUDIO_INTERFACE));
54 const PPB_AudioConfig* PPBAudioConfig() {
55 return reinterpret_cast<const PPB_AudioConfig*>(
56 GetBrowserInterfaceSafe(PPB_AUDIO_CONFIG_INTERFACE));
59 const PPB_Core* PPBCore() {
60 return reinterpret_cast<const PPB_Core*>(
61 GetBrowserInterfaceSafe(PPB_CORE_INTERFACE));
64 const PPB_FileIO* PPBFileIO() {
65 return reinterpret_cast<const PPB_FileIO*>(
66 GetBrowserInterfaceSafe(PPB_FILEIO_INTERFACE));
69 const PPB_FileRef* PPBFileRef() {
70 return reinterpret_cast<const PPB_FileRef*>(
71 GetBrowserInterfaceSafe(PPB_FILEREF_INTERFACE));
74 const PPB_FileSystem* PPBFileSystem() {
75 return reinterpret_cast<const PPB_FileSystem*>(
76 GetBrowserInterfaceSafe(PPB_FILESYSTEM_INTERFACE));
79 const PPB_Fullscreen* PPBFullscreen() {
80 return reinterpret_cast<const PPB_Fullscreen*>(
81 GetBrowserInterfaceSafe(PPB_FULLSCREEN_INTERFACE));
84 const PPB_Graphics2D* PPBGraphics2D() {
85 return reinterpret_cast<const PPB_Graphics2D*>(
86 GetBrowserInterfaceSafe(PPB_GRAPHICS_2D_INTERFACE));
89 const PPB_Graphics3D* PPBGraphics3D() {
90 return reinterpret_cast<const PPB_Graphics3D*>(
91 GetBrowserInterfaceSafe(PPB_GRAPHICS_3D_INTERFACE));
94 const PPB_ImageData* PPBImageData() {
95 return reinterpret_cast<const PPB_ImageData*>(
96 GetBrowserInterfaceSafe(PPB_IMAGEDATA_INTERFACE));
99 const PPB_InputEvent* PPBInputEvent() {
100 return reinterpret_cast<const PPB_InputEvent*>(
101 GetBrowserInterfaceSafe(PPB_INPUT_EVENT_INTERFACE));
104 const PPB_Instance* PPBInstance() {
105 return reinterpret_cast<const PPB_Instance*>(
106 GetBrowserInterfaceSafe(PPB_INSTANCE_INTERFACE));
109 const PPB_KeyboardInputEvent* PPBKeyboardInputEvent() {
110 return reinterpret_cast<const PPB_KeyboardInputEvent*>(
111 GetBrowserInterfaceSafe(PPB_KEYBOARD_INPUT_EVENT_INTERFACE));
114 const PPB_Messaging* PPBMessaging() {
115 return reinterpret_cast<const PPB_Messaging*>(
116 GetBrowserInterfaceSafe(PPB_MESSAGING_INTERFACE));
119 const PPB_MouseCursor_1_0* PPBMouseCursor() {
120 return reinterpret_cast<const PPB_MouseCursor_1_0*>(
121 GetBrowserInterfaceSafe(PPB_MOUSECURSOR_INTERFACE_1_0));
124 const PPB_MouseInputEvent* PPBMouseInputEvent() {
125 return reinterpret_cast<const PPB_MouseInputEvent*>(
126 GetBrowserInterfaceSafe(PPB_MOUSE_INPUT_EVENT_INTERFACE));
129 const PPB_OpenGLES2* PPBOpenGLES2() {
130 return reinterpret_cast<const PPB_OpenGLES2*>(
131 GetBrowserInterfaceSafe(PPB_OPENGLES2_INTERFACE));
134 const PPB_URLLoader* PPBURLLoader() {
135 return reinterpret_cast<const PPB_URLLoader*>(
136 GetBrowserInterfaceSafe(PPB_URLLOADER_INTERFACE));
139 const PPB_URLRequestInfo* PPBURLRequestInfo() {
140 return reinterpret_cast<const PPB_URLRequestInfo*>(
141 GetBrowserInterfaceSafe(PPB_URLREQUESTINFO_INTERFACE));
144 const PPB_URLResponseInfo* PPBURLResponseInfo() {
145 return reinterpret_cast<const PPB_URLResponseInfo*>(
146 GetBrowserInterfaceSafe(PPB_URLRESPONSEINFO_INTERFACE));
149 const PPB_Var* PPBVar() {
150 return reinterpret_cast<const PPB_Var*>(
151 GetBrowserInterfaceSafe(PPB_VAR_INTERFACE));
154 const PPB_WheelInputEvent* PPBWheelInputEvent() {
155 return reinterpret_cast<const PPB_WheelInputEvent*>(
156 GetBrowserInterfaceSafe(PPB_WHEEL_INPUT_EVENT_INTERFACE));
160 // Dev interfaces.
162 const PPB_Font_Dev* PPBFontDev() {
163 return reinterpret_cast<const PPB_Font_Dev*>(
164 // Change to GetBrowserInterfaceSafe when moving out of dev.
165 GetBrowserInterface(PPB_FONT_DEV_INTERFACE));
168 const PPB_Memory_Dev* PPBMemoryDev() {
169 return reinterpret_cast<const PPB_Memory_Dev*>(
170 // Change to GetBrowserInterfaceSafe when moving out of dev.
171 GetBrowserInterface(PPB_MEMORY_DEV_INTERFACE));
174 const PPB_Testing_Dev* PPBTestingDev() {
175 return reinterpret_cast<const PPB_Testing_Dev*>(
176 // Change to GetBrowserInterfaceSafe when moving out of dev.
177 GetBrowserInterface(PPB_TESTING_DEV_INTERFACE));
180 const PPB_View* PPBView() {
181 return reinterpret_cast<const PPB_View*>(
182 GetBrowserInterface(PPB_VIEW_INTERFACE));