| 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_PPAPI_GLOBALS_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
| 6 #define PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ | 6 #define PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/c/pp_module.h" | 10 #include "ppapi/c/pp_module.h" |
| 11 #include "ppapi/shared_impl/api_id.h" | 11 #include "ppapi/shared_impl/api_id.h" |
| 12 #include "ppapi/shared_impl/ppapi_shared_export.h" | 12 #include "ppapi/shared_impl/ppapi_shared_export.h" |
| 13 | 13 |
| 14 namespace ppapi { | 14 namespace ppapi { |
| 15 | 15 |
| 16 class CallbackTracker; |
| 16 class FunctionGroupBase; | 17 class FunctionGroupBase; |
| 17 class ResourceTracker; | 18 class ResourceTracker; |
| 18 class VarTracker; | 19 class VarTracker; |
| 19 | 20 |
| 20 // Abstract base class | 21 // Abstract base class |
| 21 class PPAPI_SHARED_EXPORT PpapiGlobals { | 22 class PPAPI_SHARED_EXPORT PpapiGlobals { |
| 22 public: | 23 public: |
| 23 PpapiGlobals(); | 24 PpapiGlobals(); |
| 24 virtual ~PpapiGlobals(); | 25 virtual ~PpapiGlobals(); |
| 25 | 26 |
| 26 // Getter for the global singleton. | 27 // Getter for the global singleton. |
| 27 inline static PpapiGlobals* Get() { return ppapi_globals_; } | 28 inline static PpapiGlobals* Get() { return ppapi_globals_; } |
| 28 | 29 |
| 29 // Retrieves the corresponding tracker. | 30 // Retrieves the corresponding tracker. |
| 30 virtual ResourceTracker* GetResourceTracker() = 0; | 31 virtual ResourceTracker* GetResourceTracker() = 0; |
| 31 virtual VarTracker* GetVarTracker() = 0; | 32 virtual VarTracker* GetVarTracker() = 0; |
| 33 virtual CallbackTracker* GetCallbackTrackerForInstance( |
| 34 PP_Instance instance) = 0; |
| 32 | 35 |
| 33 // Returns the function object corresponding to the given ID, or NULL if | 36 // Returns the function object corresponding to the given ID, or NULL if |
| 34 // there isn't one. | 37 // there isn't one. |
| 35 virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst, ApiID id) = 0; | 38 virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst, ApiID id) = 0; |
| 36 | 39 |
| 37 // Returns the PP_Module associated with the given PP_Instance, or 0 on | 40 // Returns the PP_Module associated with the given PP_Instance, or 0 on |
| 38 // failure. | 41 // failure. |
| 39 virtual PP_Module GetModuleForInstance(PP_Instance instance) = 0; | 42 virtual PP_Module GetModuleForInstance(PP_Instance instance) = 0; |
| 40 | 43 |
| 41 private: | 44 private: |
| 42 static PpapiGlobals* ppapi_globals_; | 45 static PpapiGlobals* ppapi_globals_; |
| 43 | 46 |
| 44 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); | 47 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 } // namespace ppapi | 50 } // namespace ppapi |
| 48 | 51 |
| 49 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ | 52 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
| OLD | NEW |