OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/callback_tracker.h" |
10 #include "ppapi/shared_impl/ppapi_globals.h" | 10 #include "ppapi/shared_impl/ppapi_globals.h" |
11 #include "ppapi/shared_impl/resource_tracker.h" | 11 #include "ppapi/shared_impl/resource_tracker.h" |
12 #include "ppapi/shared_impl/var_tracker.h" | 12 #include "ppapi/shared_impl/var_tracker.h" |
13 #include "webkit/plugins/ppapi/host_var_tracker.h" | 13 #include "webkit/plugins/ppapi/host_var_tracker.h" |
14 #include "webkit/plugins/webkit_plugins_export.h" | 14 #include "webkit/plugins/webkit_plugins_export.h" |
15 | 15 |
16 namespace webkit { | 16 namespace webkit { |
17 namespace ppapi { | 17 namespace ppapi { |
18 | 18 |
19 class PluginInstance; | 19 class PluginInstance; |
20 class PluginModule; | 20 class PluginModule; |
21 | 21 |
22 class HostGlobals : public ::ppapi::PpapiGlobals { | 22 class HostGlobals : public ::ppapi::PpapiGlobals { |
23 public: | 23 public: |
24 HostGlobals(); | 24 HostGlobals(); |
25 HostGlobals(::ppapi::PpapiGlobals::ForTest); | 25 explicit HostGlobals(::ppapi::PpapiGlobals::PerThreadForTest); |
26 virtual ~HostGlobals(); | 26 virtual ~HostGlobals(); |
27 | 27 |
28 // Getter for the global singleton. Generally, you should use | 28 // Getter for the global singleton. Generally, you should use |
29 // PpapiGlobals::Get() when possible. Use this only when you need some | 29 // PpapiGlobals::Get() when possible. Use this only when you need some |
30 // host-specific functionality. | 30 // host-specific functionality. |
31 inline static HostGlobals* Get() { | 31 inline static HostGlobals* Get() { |
32 DCHECK(PpapiGlobals::Get()->IsHostGlobals()); | 32 DCHECK(PpapiGlobals::Get()->IsHostGlobals()); |
33 return static_cast<HostGlobals*>(PpapiGlobals::Get()); | 33 return static_cast<HostGlobals*>(PpapiGlobals::Get()); |
34 } | 34 } |
35 | 35 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 typedef std::map<PP_Module, PluginModule*> ModuleMap; | 109 typedef std::map<PP_Module, PluginModule*> ModuleMap; |
110 ModuleMap module_map_; | 110 ModuleMap module_map_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(HostGlobals); | 112 DISALLOW_COPY_AND_ASSIGN(HostGlobals); |
113 }; | 113 }; |
114 | 114 |
115 } // namespace ppapi | 115 } // namespace ppapi |
116 } // namespace webkit | 116 } // namespace webkit |
117 | 117 |
118 #endif // WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ | 118 #endif // WEBKIT_PLUGINS_PPAPI_HOST_GLOBALS_H_ |
OLD | NEW |