| 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 WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_HOST_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/ppapi_globals.h" | 10 #include "ppapi/shared_impl/ppapi_globals.h" |
| 10 #include "ppapi/shared_impl/var_tracker.h" | 11 #include "ppapi/shared_impl/var_tracker.h" |
| 11 #include "webkit/plugins/ppapi/host_resource_tracker.h" | 12 #include "webkit/plugins/ppapi/host_resource_tracker.h" |
| 12 #include "webkit/plugins/ppapi/host_var_tracker.h" | 13 #include "webkit/plugins/ppapi/host_var_tracker.h" |
| 13 #include "webkit/plugins/webkit_plugins_export.h" | 14 #include "webkit/plugins/webkit_plugins_export.h" |
| 14 | 15 |
| 15 namespace webkit { | 16 namespace webkit { |
| 16 namespace ppapi { | 17 namespace ppapi { |
| 17 | 18 |
| 18 class PluginInstance; | 19 class PluginInstance; |
| 19 class PluginModule; | 20 class PluginModule; |
| 20 | 21 |
| 21 class HostGlobals : public ::ppapi::PpapiGlobals { | 22 class HostGlobals : public ::ppapi::PpapiGlobals { |
| 22 public: | 23 public: |
| 23 HostGlobals(); | 24 HostGlobals(); |
| 24 virtual ~HostGlobals(); | 25 virtual ~HostGlobals(); |
| 25 | 26 |
| 26 // Getter for the global singleton. Generally, you should use | 27 // Getter for the global singleton. Generally, you should use |
| 27 // PpapiGlobals::Get() when possible. Use this only when you need some | 28 // PpapiGlobals::Get() when possible. Use this only when you need some |
| 28 // host-specific functionality. | 29 // host-specific functionality. |
| 29 inline static HostGlobals* Get() { return host_globals_; } | 30 inline static HostGlobals* Get() { return host_globals_; } |
| 30 | 31 |
| 31 // PpapiGlobals implementation. | 32 // PpapiGlobals implementation. |
| 32 virtual ::ppapi::ResourceTracker* GetResourceTracker() OVERRIDE; | 33 virtual ::ppapi::ResourceTracker* GetResourceTracker() OVERRIDE; |
| 33 virtual ::ppapi::VarTracker* GetVarTracker() OVERRIDE; | 34 virtual ::ppapi::VarTracker* GetVarTracker() OVERRIDE; |
| 35 virtual ::ppapi::CallbackTracker* GetCallbackTrackerForInstance( |
| 36 PP_Instance instance) OVERRIDE; |
| 34 virtual ::ppapi::FunctionGroupBase* GetFunctionAPI( | 37 virtual ::ppapi::FunctionGroupBase* GetFunctionAPI( |
| 35 PP_Instance inst, | 38 PP_Instance inst, |
| 36 ::ppapi::ApiID id) OVERRIDE; | 39 ::ppapi::ApiID id) OVERRIDE; |
| 37 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; | 40 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; |
| 38 | 41 |
| 39 HostResourceTracker* host_resource_tracker() { | 42 HostResourceTracker* host_resource_tracker() { |
| 40 return &host_resource_tracker_; | 43 return &host_resource_tracker_; |
| 41 } | 44 } |
| 42 HostVarTracker* host_var_tracker() { | 45 HostVarTracker* host_var_tracker() { |
| 43 return &host_var_tracker_; | 46 return &host_var_tracker_; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 typedef std::map<PP_Module, PluginModule*> ModuleMap; | 95 typedef std::map<PP_Module, PluginModule*> ModuleMap; |
| 93 ModuleMap module_map_; | 96 ModuleMap module_map_; |
| 94 | 97 |
| 95 DISALLOW_COPY_AND_ASSIGN(HostGlobals); | 98 DISALLOW_COPY_AND_ASSIGN(HostGlobals); |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 } // namespace ppapi | 101 } // namespace ppapi |
| 99 } // namespace webkit | 102 } // namespace webkit |
| 100 | 103 |
| 101 #endif // WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ | 104 #endif // WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ |
| OLD | NEW |