- add sources.
[platform/framework/web/crosswalk.git] / src / native_client_sdk / src / libraries / nacl_io / pepper_interface_delegate.cc
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
7 namespace nacl_io {
8
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"
17 }
18
19 PepperInterfaceDelegate::~PepperInterfaceDelegate() {}
20
21 PP_Instance PepperInterfaceDelegate::GetInstance() {
22   return instance_;
23 }
24
25 // Interface getters.
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_; \
32 }
33 #include "nacl_io/pepper/all_interfaces.h"
34
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; \
43 }
44 #include "nacl_io/pepper/all_interfaces.h"
45
46 }  // namespace nacl_io