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 WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "ppapi/shared_impl/ppapi_globals.h" |
| 10 #include "ppapi/shared_impl/var_tracker.h" |
| 11 #include "webkit/plugins/ppapi/resource_tracker.h" |
| 12 |
| 13 namespace webkit { |
| 14 namespace ppapi { |
| 15 |
| 16 class HostGlobals : public ::ppapi::PpapiGlobals { |
| 17 public: |
| 18 HostGlobals(); |
| 19 virtual ~HostGlobals(); |
| 20 |
| 21 // Getter for the global singleton. Generally, you should use |
| 22 // PpapiGlobals::Get() when possible. Use this only when you need some |
| 23 // host-specific functionality. |
| 24 inline static HostGlobals* Get() { return host_globals_; } |
| 25 |
| 26 // PpapiGlobals implementation. |
| 27 virtual ::ppapi::ResourceTracker* GetResourceTracker() OVERRIDE; |
| 28 virtual ::ppapi::VarTracker* GetVarTracker() OVERRIDE; |
| 29 |
| 30 ResourceTracker* host_resource_tracker() { return &host_resource_tracker_; } |
| 31 |
| 32 private: |
| 33 static HostGlobals* host_globals_; |
| 34 |
| 35 ResourceTracker host_resource_tracker_; |
| 36 ::ppapi::VarTracker host_var_tracker_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(HostGlobals); |
| 39 }; |
| 40 |
| 41 } // namespace ppapi |
| 42 } // namespace webkit |
| 43 |
| 44 #endif // WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ |
OLD | NEW |