OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef PPAPI_SHARED_IMPL_TEST_GLOBALS_H_ | 5 #ifndef PPAPI_SHARED_IMPL_TEST_GLOBALS_H_ |
6 #define PPAPI_SHARED_IMPL_TEST_GLOBALS_H_ | 6 #define PPAPI_SHARED_IMPL_TEST_GLOBALS_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ppapi/shared_impl/callback_tracker.h" | 9 #include "ppapi/shared_impl/callback_tracker.h" |
10 #include "ppapi/shared_impl/ppapi_globals.h" | 10 #include "ppapi/shared_impl/ppapi_globals.h" |
| 11 #include "ppapi/shared_impl/ppapi_shared_export.h" |
11 #include "ppapi/shared_impl/resource_tracker.h" | 12 #include "ppapi/shared_impl/resource_tracker.h" |
12 #include "ppapi/shared_impl/var_tracker.h" | 13 #include "ppapi/shared_impl/var_tracker.h" |
13 | 14 |
14 namespace ppapi { | 15 namespace ppapi { |
15 | 16 |
16 class TestVarTracker : public VarTracker { | 17 class PPAPI_SHARED_EXPORT TestVarTracker : public VarTracker { |
17 public: | 18 public: |
18 TestVarTracker() {} | 19 TestVarTracker() {} |
19 virtual ~TestVarTracker() {} | 20 virtual ~TestVarTracker() {} |
20 virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) OVERRIDE { | 21 virtual ArrayBufferVar* CreateArrayBuffer(uint32 size_in_bytes) OVERRIDE { |
21 return NULL; | 22 return NULL; |
22 } | 23 } |
23 }; | 24 }; |
24 | 25 |
25 // Implementation of PpapiGlobals for tests that don't need either the host- or | 26 // Implementation of PpapiGlobals for tests that don't need either the host- or |
26 // plugin-specific implementations. | 27 // plugin-specific implementations. |
27 class TestGlobals : public PpapiGlobals { | 28 class PPAPI_SHARED_EXPORT TestGlobals : public PpapiGlobals { |
28 public: | 29 public: |
29 TestGlobals(); | 30 TestGlobals(); |
| 31 TestGlobals(PpapiGlobals::ForTest); |
30 virtual ~TestGlobals(); | 32 virtual ~TestGlobals(); |
31 | 33 |
32 // PpapiGlobals implementation. | 34 // PpapiGlobals implementation. |
33 virtual ResourceTracker* GetResourceTracker() OVERRIDE; | 35 virtual ResourceTracker* GetResourceTracker() OVERRIDE; |
34 virtual VarTracker* GetVarTracker() OVERRIDE; | 36 virtual VarTracker* GetVarTracker() OVERRIDE; |
35 virtual CallbackTracker* GetCallbackTrackerForInstance( | 37 virtual CallbackTracker* GetCallbackTrackerForInstance( |
36 PP_Instance instance) OVERRIDE; | 38 PP_Instance instance) OVERRIDE; |
37 virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst, | 39 virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst, |
38 ApiID id) OVERRIDE; | 40 ApiID id) OVERRIDE; |
39 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; | 41 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; |
| 42 virtual base::Lock* GetProxyLock() OVERRIDE; |
40 | 43 |
41 private: | 44 private: |
42 ResourceTracker resource_tracker_; | 45 ResourceTracker resource_tracker_; |
43 TestVarTracker var_tracker_; | 46 TestVarTracker var_tracker_; |
44 scoped_refptr<CallbackTracker> callback_tracker_; | 47 scoped_refptr<CallbackTracker> callback_tracker_; |
45 | 48 |
46 DISALLOW_COPY_AND_ASSIGN(TestGlobals); | 49 DISALLOW_COPY_AND_ASSIGN(TestGlobals); |
47 }; | 50 }; |
48 | 51 |
49 } // namespace ppapi | 52 } // namespace ppapi |
50 | 53 |
51 #endif // PPAPI_SHARED_IMPL_TEST_GLOBALS_H_ | 54 #endif // PPAPI_SHARED_IMPL_TEST_GLOBALS_H_ |
OLD | NEW |