1ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch// Copyright (c) 2012 The Chromium Authors. All rights reserved. 2ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch// Use of this source code is governed by a BSD-style license that can be 3ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch// found in the LICENSE file. 4ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch 52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#ifndef LIBRARIES_NACL_IO_REAL_PEPPER_INTERFACE_H_ 62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define LIBRARIES_NACL_IO_REAL_PEPPER_INTERFACE_H_ 72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include <ppapi/c/ppb.h> 92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include <ppapi/c/ppb_core.h> 102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include <ppapi/c/ppb_message_loop.h> 112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "pepper_interface.h" 122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 13ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdochnamespace nacl_io { 14ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Forward declare interface classes. 16c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "nacl_io/pepper/undef_macros.h" 172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "nacl_io/pepper/define_empty_macros.h" 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#undef BEGIN_INTERFACE 192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) class Real##BaseClass; 212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "nacl_io/pepper/all_interfaces.h" 222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class RealPepperInterface : public PepperInterface { 242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public: 252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) RealPepperInterface(PP_Instance instance, 262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) PPB_GetInterface get_browser_interface); 272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual PP_Instance GetInstance(); 292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void AddRefResource(PP_Resource); 302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void ReleaseResource(PP_Resource); 31c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) virtual bool IsMainThread(); 322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Interface getters. 34c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "nacl_io/pepper/undef_macros.h" 352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "nacl_io/pepper/define_empty_macros.h" 362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#undef BEGIN_INTERFACE 372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual BaseClass* Get##BaseClass(); 392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "nacl_io/pepper/all_interfaces.h" 402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int32_t InitializeMessageLoop(); 422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private: 442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) PP_Instance instance_; 452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const PPB_Core* core_interface_; 462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const PPB_MessageLoop* message_loop_interface_; 472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Interface pointers. 49c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "nacl_io/pepper/undef_macros.h" 502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "nacl_io/pepper/define_empty_macros.h" 512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#undef BEGIN_INTERFACE 522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) Real##BaseClass* BaseClass##interface_; 542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "nacl_io/pepper/all_interfaces.h" 552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}; 562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 57ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch} // namespace nacl_io 58ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch 592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif // LIBRARIES_NACL_IO_REAL_PEPPER_INTERFACE_H_ 60