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() {
22 PP_Instance
PepperInterfaceDelegate::GetInstance() {
27 #include "nacl_io/pepper/undef_macros.h"
28 #include "nacl_io/pepper/define_empty_macros.h"
29 #undef BEGIN_INTERFACE
30 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
31 BaseClass* PepperInterfaceDelegate::Get##BaseClass() { \
32 return BaseClass##delegate_; \
34 #include "nacl_io/pepper/all_interfaces.h"
36 // Interface delegate setters.
37 #include "nacl_io/pepper/undef_macros.h"
38 #include "nacl_io/pepper/define_empty_macros.h"
39 #undef BEGIN_INTERFACE
40 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
41 void PepperInterfaceDelegate::Set##BaseClass##Delegate( \
42 BaseClass* delegate) { \
43 BaseClass##delegate_ = delegate; \
45 #include "nacl_io/pepper/all_interfaces.h"
47 } // namespace nacl_io