thunk.h revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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. 4 5#ifndef PPAPI_THUNK_THUNK_H_ 6#define PPAPI_THUNK_THUNK_H_ 7 8#include "ppapi/c/private/ppb_instance_private.h" 9#include "ppapi/c/trusted/ppb_audio_trusted.h" 10#include "ppapi/c/trusted/ppb_buffer_trusted.h" 11#include "ppapi/c/trusted/ppb_graphics_3d_trusted.h" 12#include "ppapi/c/trusted/ppb_image_data_trusted.h" 13#include "ppapi/c/trusted/ppb_url_loader_trusted.h" 14#include "ppapi/thunk/ppapi_thunk_export.h" 15 16// Declares a getter for the interface thunk of the form: 17// 18// const PPB_Foo* ppapi::thunk::GetPPB_Foo_Thunk(); 19// 20#define IFACE(api_name, interface_name, InterfaceType) \ 21 struct InterfaceType; \ 22 namespace ppapi { namespace thunk { \ 23 PPAPI_THUNK_EXPORT const InterfaceType* Get##InterfaceType##_Thunk(); \ 24 } } 25#define PROXIED_IFACE IFACE 26#define UNPROXIED_IFACE IFACE 27 28#include "ppapi/thunk/interfaces_ppb_private.h" 29#include "ppapi/thunk/interfaces_ppb_private_no_permissions.h" 30#include "ppapi/thunk/interfaces_ppb_private_flash.h" 31#include "ppapi/thunk/interfaces_ppb_public_stable.h" 32#include "ppapi/thunk/interfaces_ppb_public_dev.h" 33 34#undef UNPROXIED_IFACE 35#undef PROXIED_IFACE 36#undef IFACE 37 38namespace ppapi { 39namespace thunk { 40 41// Old-style thunk getters. Only put trusted/private stuff here (it hasn't 42// yet been converted to the new system). Otherwise, add the declaration to 43// the appropriate interfaces_*.h file. 44PPAPI_THUNK_EXPORT const PPB_AudioTrusted_0_6* GetPPB_AudioTrusted_0_6_Thunk(); 45PPAPI_THUNK_EXPORT const PPB_BufferTrusted_0_1* 46 GetPPB_BufferTrusted_0_1_Thunk(); 47PPAPI_THUNK_EXPORT const PPB_Graphics3DTrusted_1_0* 48 GetPPB_Graphics3DTrusted_1_0_Thunk(); 49PPAPI_THUNK_EXPORT const PPB_ImageDataTrusted_0_4* 50 GetPPB_ImageDataTrusted_0_4_Thunk(); 51PPAPI_THUNK_EXPORT const PPB_Instance_Private_0_1* 52 GetPPB_Instance_Private_0_1_Thunk(); 53PPAPI_THUNK_EXPORT const PPB_URLLoaderTrusted_0_3* 54 GetPPB_URLLoaderTrusted_0_3_Thunk(); 55 56} // namespace thunk 57} // namespace ppapi 58 59#endif // PPAPI_THUNK_THUNK_H_ 60