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