| 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/proxy/interface_id.h" | 11 #include "ppapi/proxy/interface_id.h" |
| 12 #include "ppapi/shared_impl/api_id.h" |
| 12 #include "ppapi/shared_impl/ppapi_shared_export.h" | 13 #include "ppapi/shared_impl/ppapi_shared_export.h" |
| 13 | 14 |
| 14 namespace ppapi { | 15 namespace ppapi { |
| 15 | 16 |
| 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; |
| 32 | 33 |
| 33 // Returns the function object corresponding to the given ID, or NULL if | 34 // Returns the function object corresponding to the given ID, or NULL if |
| 34 // there isn't one. | 35 // there isn't one. |
| 35 virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst, | 36 virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst, ApiID id) = 0; |
| 36 proxy::InterfaceID id) = 0; | |
| 37 | 37 |
| 38 // Returns the PP_Module associated with the given PP_Instance, or 0 on | 38 // Returns the PP_Module associated with the given PP_Instance, or 0 on |
| 39 // failure. | 39 // failure. |
| 40 virtual PP_Module GetModuleForInstance(PP_Instance instance) = 0; | 40 virtual PP_Module GetModuleForInstance(PP_Instance instance) = 0; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 static PpapiGlobals* ppapi_globals_; | 43 static PpapiGlobals* ppapi_globals_; |
| 44 | 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); | 45 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace ppapi | 48 } // namespace ppapi |
| 49 | 49 |
| 50 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ | 50 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
| OLD | NEW |