Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / native_client_sdk / src / libraries / nacl_io / pepper_interface_dummy.h
blob71d7b3b090efa8be3d61467c5445fd3246be04b4
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.
5 #ifndef LIBRARIES_NACL_IO_PEPPER_INTERFACE_DUMMY_H_
6 #define LIBRARIES_NACL_IO_PEPPER_INTERFACE_DUMMY_H_
8 #include "nacl_io/pepper_interface.h"
10 // This class simplifies implementing a PepperInterface-derived class where you
11 // don't care about certain interfaces. All interface-getters return NULL by
12 // default.
14 // For example:
16 // class FooPepperInterface : public PepperInterfaceDummy {
17 // public:
18 // CoreInterface* GetCoreInterface() { ... };
19 // };
21 // // FooPepperInterface is not abstract -- all pure virtual functions have
22 // been defined to return NULL.
24 namespace nacl_io {
26 class PepperInterfaceDummy : public PepperInterface {
27 public:
28 PepperInterfaceDummy() {}
29 virtual ~PepperInterfaceDummy() {}
30 virtual PP_Instance GetInstance() { return 0; }
32 // Interface getters.
33 #include "nacl_io/pepper/undef_macros.h"
34 #include "nacl_io/pepper/define_empty_macros.h"
35 #undef BEGIN_INTERFACE
36 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
37 virtual BaseClass* Get##BaseClass() { return NULL; }
38 #include "nacl_io/pepper/all_interfaces.h"
41 } // namespace nacl_io
43 #endif // LIBRARIES_NACL_IO_PEPPER_INTERFACE_DUMMY_H_