1 // Copyright (c) 2013 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 "nacl_io/pepper_interface_delegate.h"
9 PepperInterfaceDelegate::PepperInterfaceDelegate(PP_Instance instance)
10 : instance_(instance) {
11 #include "nacl_io/pepper/undef_macros.h"
12 #include "nacl_io/pepper/define_empty_macros.h"
13 #undef BEGIN_INTERFACE
14 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
15 BaseClass##delegate_ = NULL;
16 #include "nacl_io/pepper/all_interfaces.h"
19 PepperInterfaceDelegate::~PepperInterfaceDelegate() {}
21 PP_Instance PepperInterfaceDelegate::GetInstance() {
26 #include "nacl_io/pepper/undef_macros.h"
27 #include "nacl_io/pepper/define_empty_macros.h"
28 #undef BEGIN_INTERFACE
29 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
30 BaseClass* PepperInterfaceDelegate::Get##BaseClass() { \
31 return BaseClass##delegate_; \
33 #include "nacl_io/pepper/all_interfaces.h"
35 // Interface delegate setters.
36 #include "nacl_io/pepper/undef_macros.h"
37 #include "nacl_io/pepper/define_empty_macros.h"
38 #undef BEGIN_INTERFACE
39 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
40 void PepperInterfaceDelegate::Set##BaseClass##Delegate( \
41 BaseClass* delegate) { \
42 BaseClass##delegate_ = delegate; \
44 #include "nacl_io/pepper/all_interfaces.h"
46 } // namespace nacl_io