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 LIBRARIES_NACL_IO_REAL_PEPPER_INTERFACE_H_ 6 #define LIBRARIES_NACL_IO_REAL_PEPPER_INTERFACE_H_ 7 8 #include <ppapi/c/ppb.h> 9 #include <ppapi/c/ppb_core.h> 10 #include <ppapi/c/ppb_message_loop.h> 11 #include "pepper_interface.h" 12 13 namespace nacl_io { 14 15 // Forward declare interface classes. 16 #include "nacl_io/pepper/undef_macros.h" 17 #include "nacl_io/pepper/define_empty_macros.h" 18 #undef BEGIN_INTERFACE 19 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 20 class Real##BaseClass; 21 #include "nacl_io/pepper/all_interfaces.h" 22 23 class RealPepperInterface : public PepperInterface { 24 public: 25 RealPepperInterface(PP_Instance instance, 26 PPB_GetInterface get_browser_interface); 27 28 virtual PP_Instance GetInstance(); 29 virtual void AddRefResource(PP_Resource); 30 virtual void ReleaseResource(PP_Resource); 31 virtual bool IsMainThread(); 32 33 // Interface getters. 34 #include "nacl_io/pepper/undef_macros.h" 35 #include "nacl_io/pepper/define_empty_macros.h" 36 #undef BEGIN_INTERFACE 37 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 38 virtual BaseClass* Get##BaseClass(); 39 #include "nacl_io/pepper/all_interfaces.h" 40 41 int32_t InitializeMessageLoop(); 42 43 private: 44 PP_Instance instance_; 45 const PPB_Core* core_interface_; 46 const PPB_MessageLoop* message_loop_interface_; 47 48 // Interface pointers. 49 #include "nacl_io/pepper/undef_macros.h" 50 #include "nacl_io/pepper/define_empty_macros.h" 51 #undef BEGIN_INTERFACE 52 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 53 Real##BaseClass* BaseClass##interface_; 54 #include "nacl_io/pepper/all_interfaces.h" 55 }; 56 57 } // namespace nacl_io 58 59 #endif // LIBRARIES_NACL_IO_REAL_PEPPER_INTERFACE_H_ 60