| 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 <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/threading/thread_local_storage.h" | 14 #include "base/threading/thread_local_storage.h" |
| 15 #include "ppapi/proxy/connection.h" | 15 #include "ppapi/proxy/connection.h" |
| 16 #include "ppapi/proxy/plugin_resource_tracker.h" | 16 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 17 #include "ppapi/proxy/plugin_var_tracker.h" | 17 #include "ppapi/proxy/plugin_var_tracker.h" |
| 18 #include "ppapi/proxy/ppapi_proxy_export.h" | 18 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 19 #include "ppapi/shared_impl/callback_tracker.h" | 19 #include "ppapi/shared_impl/callback_tracker.h" |
| 20 #include "ppapi/shared_impl/ppapi_globals.h" | 20 #include "ppapi/shared_impl/ppapi_globals.h" |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 class Thread; | 23 class Thread; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Locks the proxy lock and releases the throttle on keepalive IPC messages. | 163 // Locks the proxy lock and releases the throttle on keepalive IPC messages. |
| 164 void OnReleaseKeepaliveThrottle(); | 164 void OnReleaseKeepaliveThrottle(); |
| 165 | 165 |
| 166 static PluginGlobals* plugin_globals_; | 166 static PluginGlobals* plugin_globals_; |
| 167 | 167 |
| 168 PluginProxyDelegate* plugin_proxy_delegate_; | 168 PluginProxyDelegate* plugin_proxy_delegate_; |
| 169 PluginResourceTracker plugin_resource_tracker_; | 169 PluginResourceTracker plugin_resource_tracker_; |
| 170 PluginVarTracker plugin_var_tracker_; | 170 PluginVarTracker plugin_var_tracker_; |
| 171 scoped_refptr<CallbackTracker> callback_tracker_; | 171 scoped_refptr<CallbackTracker> callback_tracker_; |
| 172 | 172 |
| 173 scoped_ptr<base::ThreadLocalStorage::Slot> msg_loop_slot_; | 173 std::unique_ptr<base::ThreadLocalStorage::Slot> msg_loop_slot_; |
| 174 // Note that loop_for_main_thread's constructor sets msg_loop_slot_, so it | 174 // Note that loop_for_main_thread's constructor sets msg_loop_slot_, so it |
| 175 // must be initialized after msg_loop_slot_ (hence the order here). | 175 // must be initialized after msg_loop_slot_ (hence the order here). |
| 176 scoped_refptr<MessageLoopResource> loop_for_main_thread_; | 176 scoped_refptr<MessageLoopResource> loop_for_main_thread_; |
| 177 | 177 |
| 178 // Name of the plugin used for error logging. This will be empty until | 178 // Name of the plugin used for error logging. This will be empty until |
| 179 // set_plugin_name is called. | 179 // set_plugin_name is called. |
| 180 std::string plugin_name_; | 180 std::string plugin_name_; |
| 181 | 181 |
| 182 // Command line for the plugin. This will be empty until set_command_line is | 182 // Command line for the plugin. This will be empty until set_command_line is |
| 183 // called. | 183 // called. |
| 184 std::string command_line_; | 184 std::string command_line_; |
| 185 | 185 |
| 186 scoped_ptr<BrowserSender> browser_sender_; | 186 std::unique_ptr<BrowserSender> browser_sender_; |
| 187 | 187 |
| 188 scoped_refptr<base::TaskRunner> ipc_task_runner_; | 188 scoped_refptr<base::TaskRunner> ipc_task_runner_; |
| 189 | 189 |
| 190 // Thread for performing potentially blocking file operations. It's created | 190 // Thread for performing potentially blocking file operations. It's created |
| 191 // lazily, since it might not be needed. | 191 // lazily, since it might not be needed. |
| 192 scoped_ptr<base::Thread> file_thread_; | 192 std::unique_ptr<base::Thread> file_thread_; |
| 193 | 193 |
| 194 scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_; | 194 scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_; |
| 195 | 195 |
| 196 scoped_refptr<UDPSocketFilter> udp_socket_filter_; | 196 scoped_refptr<UDPSocketFilter> udp_socket_filter_; |
| 197 | 197 |
| 198 // Indicates activity by the plugin. Used to monitor when a plugin can be | 198 // Indicates activity by the plugin. Used to monitor when a plugin can be |
| 199 // shutdown due to idleness. Current needs do not require differentiating | 199 // shutdown due to idleness. Current needs do not require differentiating |
| 200 // between idle state between multiple instances, if any are active they are | 200 // between idle state between multiple instances, if any are active they are |
| 201 // all considered active. | 201 // all considered active. |
| 202 bool plugin_recently_active_; | 202 bool plugin_recently_active_; |
| 203 | 203 |
| 204 unsigned keepalive_throttle_interval_milliseconds_; | 204 unsigned keepalive_throttle_interval_milliseconds_; |
| 205 | 205 |
| 206 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. | 206 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. |
| 207 base::WeakPtrFactory<PluginGlobals> weak_factory_; | 207 base::WeakPtrFactory<PluginGlobals> weak_factory_; |
| 208 | 208 |
| 209 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); | 209 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 } // namespace proxy | 212 } // namespace proxy |
| 213 } // namespace ppapi | 213 } // namespace ppapi |
| 214 | 214 |
| 215 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 215 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
| OLD | NEW |