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 PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
6 #define PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 6 #define PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 const Preferences& prefs); | 92 const Preferences& prefs); |
93 | 93 |
94 // Getters for the plugin-specific versions. | 94 // Getters for the plugin-specific versions. |
95 PluginResourceTracker* plugin_resource_tracker() { | 95 PluginResourceTracker* plugin_resource_tracker() { |
96 return &plugin_resource_tracker_; | 96 return &plugin_resource_tracker_; |
97 } | 97 } |
98 PluginVarTracker* plugin_var_tracker() { | 98 PluginVarTracker* plugin_var_tracker() { |
99 return &plugin_var_tracker_; | 99 return &plugin_var_tracker_; |
100 } | 100 } |
101 | 101 |
102 // The embedder should call set_proxy_delegate during startup. | 102 // The embedder should call SetPluginProxyDelegate during startup. |
103 void set_plugin_proxy_delegate(PluginProxyDelegate* d) { | 103 void SetPluginProxyDelegate(PluginProxyDelegate* d); |
104 plugin_proxy_delegate_ = d; | 104 // The embedder may choose to call ResetPluginProxyDelegate during shutdown. |
105 } | 105 // After that point, it's unsafe to call most members of PluginGlobals, |
| 106 // and GetBrowserSender will return NULL. |
| 107 void ResetPluginProxyDelegate(); |
106 | 108 |
107 // Returns the TLS slot that holds the message loop TLS. | 109 // Returns the TLS slot that holds the message loop TLS. |
108 // | 110 // |
109 // If we end up needing more TLS storage for more stuff, we should probably | 111 // If we end up needing more TLS storage for more stuff, we should probably |
110 // have a struct in here for the different items. | 112 // have a struct in here for the different items. |
111 base::ThreadLocalStorage::Slot* msg_loop_slot() { | 113 base::ThreadLocalStorage::Slot* msg_loop_slot() { |
112 return msg_loop_slot_.get(); | 114 return msg_loop_slot_.get(); |
113 } | 115 } |
114 | 116 |
115 // Sets the message loop slot, takes ownership of the given heap-alloated | 117 // Sets the message loop slot, takes ownership of the given heap-alloated |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. | 189 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. |
188 base::WeakPtrFactory<PluginGlobals> weak_factory_; | 190 base::WeakPtrFactory<PluginGlobals> weak_factory_; |
189 | 191 |
190 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); | 192 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); |
191 }; | 193 }; |
192 | 194 |
193 } // namespace proxy | 195 } // namespace proxy |
194 } // namespace ppapi | 196 } // namespace ppapi |
195 | 197 |
196 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 198 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
OLD | NEW |