OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
6 #include "pepper_interface_mock.h" | 6 #include "pepper_interface_mock.h" |
7 | 7 |
8 PepperInterfaceMock::PepperInterfaceMock(PP_Instance instance) | 8 PepperInterfaceMock::PepperInterfaceMock(PP_Instance instance) |
9 : instance_(instance), | 9 : instance_(instance), |
10 | 10 |
11 // Initialize interfaces. | 11 // Initialize interfaces. |
| 12 #include "nacl_io/pepper/undef_macros.h" |
12 #include "nacl_io/pepper/define_empty_macros.h" | 13 #include "nacl_io/pepper/define_empty_macros.h" |
13 #undef BEGIN_INTERFACE | 14 #undef BEGIN_INTERFACE |
14 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ | 15 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ |
15 BaseClass##interface_(new BaseClass##Mock), | 16 BaseClass##interface_(new BaseClass##Mock), |
16 #include "nacl_io/pepper/all_interfaces.h" | 17 #include "nacl_io/pepper/all_interfaces.h" |
17 #include "nacl_io/pepper/undef_macros.h" | |
18 | 18 |
19 // Dummy value so we can ensure that no interface ends the initializer list. | 19 // Dummy value so we can ensure that no interface ends the initializer list. |
20 dummy_(0) { | 20 dummy_(0) { |
21 } | 21 } |
22 | 22 |
23 PepperInterfaceMock::~PepperInterfaceMock() { | 23 PepperInterfaceMock::~PepperInterfaceMock() { |
24 | 24 |
25 // Delete interfaces. | 25 // Delete interfaces. |
| 26 #include "nacl_io/pepper/undef_macros.h" |
26 #include "nacl_io/pepper/define_empty_macros.h" | 27 #include "nacl_io/pepper/define_empty_macros.h" |
27 #undef BEGIN_INTERFACE | 28 #undef BEGIN_INTERFACE |
28 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ | 29 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ |
29 delete BaseClass##interface_; | 30 delete BaseClass##interface_; |
30 #include "nacl_io/pepper/all_interfaces.h" | 31 #include "nacl_io/pepper/all_interfaces.h" |
31 #include "nacl_io/pepper/undef_macros.h" | |
32 | 32 |
33 } | 33 } |
34 | 34 |
35 PP_Instance PepperInterfaceMock::GetInstance() { | 35 PP_Instance PepperInterfaceMock::GetInstance() { |
36 return instance_; | 36 return instance_; |
37 } | 37 } |
38 | 38 |
39 // Define Getter functions, constructors, destructors. | 39 // Define Getter functions, constructors, destructors. |
| 40 #include "nacl_io/pepper/undef_macros.h" |
40 #include "nacl_io/pepper/define_empty_macros.h" | 41 #include "nacl_io/pepper/define_empty_macros.h" |
41 #undef BEGIN_INTERFACE | 42 #undef BEGIN_INTERFACE |
42 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ | 43 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ |
43 BaseClass##Mock* PepperInterfaceMock::Get##BaseClass() { \ | 44 BaseClass##Mock* PepperInterfaceMock::Get##BaseClass() { \ |
44 return BaseClass##interface_; \ | 45 return BaseClass##interface_; \ |
45 } \ | 46 } \ |
46 BaseClass##Mock::BaseClass##Mock() { \ | 47 BaseClass##Mock::BaseClass##Mock() { \ |
47 } \ | 48 } \ |
48 BaseClass##Mock::~BaseClass##Mock() { \ | 49 BaseClass##Mock::~BaseClass##Mock() { \ |
49 } | 50 } |
50 #include "nacl_io/pepper/all_interfaces.h" | 51 #include "nacl_io/pepper/all_interfaces.h" |
51 #include "nacl_io/pepper/undef_macros.h" | |
OLD | NEW |