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.
4
5#include "nacl_io/pepper_interface_delegate.h"
6
7namespace nacl_io {
8
9PepperInterfaceDelegate::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"
17}
18
19PepperInterfaceDelegate::~PepperInterfaceDelegate() {
20}
21
22PP_Instance PepperInterfaceDelegate::GetInstance() {
23  return instance_;
24}
25
26// Interface getters.
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) \
31BaseClass* PepperInterfaceDelegate::Get##BaseClass() { \
32  return BaseClass##delegate_; \
33}
34#include "nacl_io/pepper/all_interfaces.h"
35
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) \
41void PepperInterfaceDelegate::Set##BaseClass##Delegate( \
42    BaseClass* delegate) { \
43  BaseClass##delegate_ = delegate; \
44}
45#include "nacl_io/pepper/all_interfaces.h"
46
47}  // namespace nacl_io
48