Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "native_client/src/shared/platform/nacl_check.h" | 5 #include "native_client/src/shared/platform/nacl_check.h" |
| 6 | 6 |
| 7 #include "ppapi/c/dev/ppb_context_3d_dev.h" | 7 #include "ppapi/c/dev/ppb_context_3d_dev.h" |
| 8 #include "ppapi/c/dev/ppb_cursor_control_dev.h" | 8 #include "ppapi/c/dev/ppb_cursor_control_dev.h" |
| 9 #include "ppapi/c/dev/ppb_font_dev.h" | 9 #include "ppapi/c/dev/ppb_font_dev.h" |
| 10 #include "ppapi/c/dev/ppb_memory_dev.h" | 10 #include "ppapi/c/dev/ppb_memory_dev.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 #include "ppapi/c/ppb_graphics_3d.h" | 22 #include "ppapi/c/ppb_graphics_3d.h" |
| 23 #include "ppapi/c/ppb_image_data.h" | 23 #include "ppapi/c/ppb_image_data.h" |
| 24 #include "ppapi/c/ppb_input_event.h" | 24 #include "ppapi/c/ppb_input_event.h" |
| 25 #include "ppapi/c/ppb_instance.h" | 25 #include "ppapi/c/ppb_instance.h" |
| 26 #include "ppapi/c/ppb_messaging.h" | 26 #include "ppapi/c/ppb_messaging.h" |
| 27 #include "ppapi/c/ppb_opengles2.h" | 27 #include "ppapi/c/ppb_opengles2.h" |
| 28 #include "ppapi/c/ppb_url_loader.h" | 28 #include "ppapi/c/ppb_url_loader.h" |
| 29 #include "ppapi/c/ppb_url_request_info.h" | 29 #include "ppapi/c/ppb_url_request_info.h" |
| 30 #include "ppapi/c/ppb_url_response_info.h" | 30 #include "ppapi/c/ppb_url_response_info.h" |
| 31 #include "ppapi/c/ppb_var.h" | 31 #include "ppapi/c/ppb_var.h" |
| 32 #include "ppapi/c/private/ppb_tcp_socket_private.h" | |
| 33 #include "ppapi/c/private/ppb_udp_socket_private.h" | |
| 32 | 34 |
| 33 #include "native_client/tests/ppapi_test_lib/get_browser_interface.h" | 35 #include "native_client/tests/ppapi_test_lib/get_browser_interface.h" |
| 34 #include "native_client/tests/ppapi_test_lib/internal_utils.h" | 36 #include "native_client/tests/ppapi_test_lib/internal_utils.h" |
| 35 | 37 |
| 36 // Use for dev interfaces that might not be present. | 38 // Use for dev interfaces that might not be present. |
| 37 const void* GetBrowserInterface(const char* interface_name) { | 39 const void* GetBrowserInterface(const char* interface_name) { |
| 38 return (*ppb_get_interface())(interface_name); | 40 return (*ppb_get_interface())(interface_name); |
| 39 } | 41 } |
| 40 | 42 |
| 41 // Use for stable interfaces that must always be present. | 43 // Use for stable interfaces that must always be present. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 const PPB_OpenGLES2* PPBOpenGLES2() { | 117 const PPB_OpenGLES2* PPBOpenGLES2() { |
| 116 return reinterpret_cast<const PPB_OpenGLES2*>( | 118 return reinterpret_cast<const PPB_OpenGLES2*>( |
| 117 GetBrowserInterfaceSafe(PPB_OPENGLES2_INTERFACE)); | 119 GetBrowserInterfaceSafe(PPB_OPENGLES2_INTERFACE)); |
| 118 } | 120 } |
| 119 | 121 |
| 120 const PPB_URLLoader* PPBURLLoader() { | 122 const PPB_URLLoader* PPBURLLoader() { |
| 121 return reinterpret_cast<const PPB_URLLoader*>( | 123 return reinterpret_cast<const PPB_URLLoader*>( |
| 122 GetBrowserInterfaceSafe(PPB_URLLOADER_INTERFACE)); | 124 GetBrowserInterfaceSafe(PPB_URLLOADER_INTERFACE)); |
| 123 } | 125 } |
| 124 | 126 |
| 127 const PPB_TCPSocket_Private* PPBTCPSocketPrivate() { | |
| 128 return reinterpret_cast<const PPB_TCPSocket_Private*>( | |
| 129 GetBrowserInterfaceSafe(PPB_TCPSOCKET_PRIVATE_INTERFACE)); | |
|
polina
2011/11/18 09:52:10
Won't there be some kind of switch for these inter
Dmitry Polukhin
2011/11/18 10:20:43
I think interfaces will be always available. But C
| |
| 130 } | |
| 131 | |
| 132 const PPB_UDPSocket_Private* PPBUDPSocketPrivate() { | |
| 133 return reinterpret_cast<const PPB_UDPSocket_Private*>( | |
| 134 GetBrowserInterfaceSafe(PPB_UDPSOCKET_PRIVATE_INTERFACE)); | |
| 135 } | |
| 136 | |
| 125 const PPB_URLRequestInfo* PPBURLRequestInfo() { | 137 const PPB_URLRequestInfo* PPBURLRequestInfo() { |
| 126 return reinterpret_cast<const PPB_URLRequestInfo*>( | 138 return reinterpret_cast<const PPB_URLRequestInfo*>( |
| 127 GetBrowserInterfaceSafe(PPB_URLREQUESTINFO_INTERFACE)); | 139 GetBrowserInterfaceSafe(PPB_URLREQUESTINFO_INTERFACE)); |
| 128 } | 140 } |
| 129 | 141 |
| 130 const PPB_URLResponseInfo* PPBURLResponseInfo() { | 142 const PPB_URLResponseInfo* PPBURLResponseInfo() { |
| 131 return reinterpret_cast<const PPB_URLResponseInfo*>( | 143 return reinterpret_cast<const PPB_URLResponseInfo*>( |
| 132 GetBrowserInterfaceSafe(PPB_URLRESPONSEINFO_INTERFACE)); | 144 GetBrowserInterfaceSafe(PPB_URLRESPONSEINFO_INTERFACE)); |
| 133 } | 145 } |
| 134 | 146 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 return reinterpret_cast<const PPB_Testing_Dev*>( | 197 return reinterpret_cast<const PPB_Testing_Dev*>( |
| 186 // Change to GetBrowserInterfaceSafe when moving out of dev. | 198 // Change to GetBrowserInterfaceSafe when moving out of dev. |
| 187 GetBrowserInterface(PPB_TESTING_DEV_INTERFACE)); | 199 GetBrowserInterface(PPB_TESTING_DEV_INTERFACE)); |
| 188 } | 200 } |
| 189 | 201 |
| 190 const PPB_Widget_Dev* PPBWidgetDev() { | 202 const PPB_Widget_Dev* PPBWidgetDev() { |
| 191 return reinterpret_cast<const PPB_Widget_Dev*>( | 203 return reinterpret_cast<const PPB_Widget_Dev*>( |
| 192 // Change to GetBrowserInterfaceSafe when moving out of dev. | 204 // Change to GetBrowserInterfaceSafe when moving out of dev. |
| 193 GetBrowserInterface(PPB_WIDGET_DEV_INTERFACE)); | 205 GetBrowserInterface(PPB_WIDGET_DEV_INTERFACE)); |
| 194 } | 206 } |
| OLD | NEW |