| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_PROXY_PLUGIN_GLOBALS_H_ | |
| 6 #define PPAPI_PROXY_PLUGIN_GLOBALS_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "ppapi/proxy/plugin_resource_tracker.h" | |
| 10 #include "ppapi/proxy/plugin_var_tracker.h" | |
| 11 #include "ppapi/shared_impl/ppapi_globals.h" | |
| 12 | |
| 13 namespace ppapi { | |
| 14 namespace proxy { | |
| 15 | |
| 16 class PluginGlobals : public PpapiGlobals { | |
| 17 public: | |
| 18 PluginGlobals(); | |
| 19 virtual ~PluginGlobals(); | |
| 20 | |
| 21 // Getter for the global singleton. Generally, you should use | |
| 22 // PpapiGlobals::Get() when possible. Use this only when you need some | |
| 23 // plugin-specific functionality. | |
| 24 inline static PluginGlobals* Get() { return plugin_globals_; } | |
| 25 | |
| 26 // PpapiGlobals implementation. | |
| 27 virtual ResourceTracker* GetResourceTracker() OVERRIDE; | |
| 28 virtual VarTracker* GetVarTracker() OVERRIDE; | |
| 29 | |
| 30 // Getters for the plugin-specific versions. | |
| 31 PluginResourceTracker* plugin_resource_tracker() { | |
| 32 return &plugin_resource_tracker_; | |
| 33 } | |
| 34 PluginVarTracker* plugin_var_tracker() { | |
| 35 return &plugin_var_tracker_; | |
| 36 } | |
| 37 | |
| 38 private: | |
| 39 static PluginGlobals* plugin_globals_; | |
| 40 | |
| 41 PluginResourceTracker plugin_resource_tracker_; | |
| 42 PluginVarTracker plugin_var_tracker_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); | |
| 45 }; | |
| 46 | |
| 47 } // namespace proxy | |
| 48 } // namespace ppapi | |
| 49 | |
| 50 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ | |
| OLD | NEW |