OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "nacl_io/pepper_interface_delegate.h" | 5 #include "nacl_io/pepper_interface_delegate.h" |
6 | 6 |
7 namespace nacl_io { | 7 namespace nacl_io { |
8 | 8 |
9 PepperInterfaceDelegate::PepperInterfaceDelegate(PP_Instance instance) | 9 PepperInterfaceDelegate::PepperInterfaceDelegate(PP_Instance instance) |
10 : instance_(instance) { | 10 : instance_(instance) { |
11 #include "nacl_io/pepper/undef_macros.h" | 11 #include "nacl_io/pepper/undef_macros.h" |
12 #include "nacl_io/pepper/define_empty_macros.h" | 12 #include "nacl_io/pepper/define_empty_macros.h" |
13 #undef BEGIN_INTERFACE | 13 #undef BEGIN_INTERFACE |
14 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ | 14 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ |
15 BaseClass##delegate_ = NULL; | 15 BaseClass##delegate_ = NULL; |
16 #include "nacl_io/pepper/all_interfaces.h" | 16 #include "nacl_io/pepper/all_interfaces.h" |
17 } | 17 } |
18 | 18 |
19 PepperInterfaceDelegate::~PepperInterfaceDelegate() {} | 19 PepperInterfaceDelegate::~PepperInterfaceDelegate() { |
| 20 } |
20 | 21 |
21 PP_Instance PepperInterfaceDelegate::GetInstance() { | 22 PP_Instance PepperInterfaceDelegate::GetInstance() { |
22 return instance_; | 23 return instance_; |
23 } | 24 } |
24 | 25 |
25 // Interface getters. | 26 // Interface getters. |
26 #include "nacl_io/pepper/undef_macros.h" | 27 #include "nacl_io/pepper/undef_macros.h" |
27 #include "nacl_io/pepper/define_empty_macros.h" | 28 #include "nacl_io/pepper/define_empty_macros.h" |
28 #undef BEGIN_INTERFACE | 29 #undef BEGIN_INTERFACE |
29 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ | 30 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ |
30 BaseClass* PepperInterfaceDelegate::Get##BaseClass() { \ | 31 BaseClass* PepperInterfaceDelegate::Get##BaseClass() { \ |
31 return BaseClass##delegate_; \ | 32 return BaseClass##delegate_; \ |
32 } | 33 } |
33 #include "nacl_io/pepper/all_interfaces.h" | 34 #include "nacl_io/pepper/all_interfaces.h" |
34 | 35 |
35 // Interface delegate setters. | 36 // Interface delegate setters. |
36 #include "nacl_io/pepper/undef_macros.h" | 37 #include "nacl_io/pepper/undef_macros.h" |
37 #include "nacl_io/pepper/define_empty_macros.h" | 38 #include "nacl_io/pepper/define_empty_macros.h" |
38 #undef BEGIN_INTERFACE | 39 #undef BEGIN_INTERFACE |
39 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ | 40 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ |
40 void PepperInterfaceDelegate::Set##BaseClass##Delegate( \ | 41 void PepperInterfaceDelegate::Set##BaseClass##Delegate( \ |
41 BaseClass* delegate) { \ | 42 BaseClass* delegate) { \ |
42 BaseClass##delegate_ = delegate; \ | 43 BaseClass##delegate_ = delegate; \ |
43 } | 44 } |
44 #include "nacl_io/pepper/all_interfaces.h" | 45 #include "nacl_io/pepper/all_interfaces.h" |
45 | 46 |
46 } // namespace nacl_io | 47 } // namespace nacl_io |
OLD | NEW |