| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/synchronization/lock.h" | |
| 13 #include "base/threading/thread_local_storage.h" | 12 #include "base/threading/thread_local_storage.h" |
| 14 #include "ppapi/proxy/connection.h" | 13 #include "ppapi/proxy/connection.h" |
| 15 #include "ppapi/proxy/plugin_resource_tracker.h" | 14 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 16 #include "ppapi/proxy/plugin_var_tracker.h" | 15 #include "ppapi/proxy/plugin_var_tracker.h" |
| 17 #include "ppapi/proxy/ppapi_proxy_export.h" | 16 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 18 #include "ppapi/shared_impl/callback_tracker.h" | 17 #include "ppapi/shared_impl/callback_tracker.h" |
| 19 #include "ppapi/shared_impl/ppapi_globals.h" | 18 #include "ppapi/shared_impl/ppapi_globals.h" |
| 20 | 19 |
| 21 namespace base { | 20 namespace base { |
| 22 class Thread; | 21 class Thread; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 virtual VarTracker* GetVarTracker() OVERRIDE; | 56 virtual VarTracker* GetVarTracker() OVERRIDE; |
| 58 virtual CallbackTracker* GetCallbackTrackerForInstance( | 57 virtual CallbackTracker* GetCallbackTrackerForInstance( |
| 59 PP_Instance instance) OVERRIDE; | 58 PP_Instance instance) OVERRIDE; |
| 60 virtual thunk::PPB_Instance_API* GetInstanceAPI( | 59 virtual thunk::PPB_Instance_API* GetInstanceAPI( |
| 61 PP_Instance instance) OVERRIDE; | 60 PP_Instance instance) OVERRIDE; |
| 62 virtual thunk::ResourceCreationAPI* GetResourceCreationAPI( | 61 virtual thunk::ResourceCreationAPI* GetResourceCreationAPI( |
| 63 PP_Instance instance) OVERRIDE; | 62 PP_Instance instance) OVERRIDE; |
| 64 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; | 63 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; |
| 65 virtual std::string GetCmdLine() OVERRIDE; | 64 virtual std::string GetCmdLine() OVERRIDE; |
| 66 virtual void PreCacheFontForFlash(const void* logfontw) OVERRIDE; | 65 virtual void PreCacheFontForFlash(const void* logfontw) OVERRIDE; |
| 67 virtual base::Lock* GetProxyLock() OVERRIDE; | |
| 68 virtual void LogWithSource(PP_Instance instance, | 66 virtual void LogWithSource(PP_Instance instance, |
| 69 PP_LogLevel level, | 67 PP_LogLevel level, |
| 70 const std::string& source, | 68 const std::string& source, |
| 71 const std::string& value) OVERRIDE; | 69 const std::string& value) OVERRIDE; |
| 72 virtual void BroadcastLogWithSource(PP_Module module, | 70 virtual void BroadcastLogWithSource(PP_Module module, |
| 73 PP_LogLevel level, | 71 PP_LogLevel level, |
| 74 const std::string& source, | 72 const std::string& source, |
| 75 const std::string& value) OVERRIDE; | 73 const std::string& value) OVERRIDE; |
| 76 virtual MessageLoopShared* GetCurrentMessageLoop() OVERRIDE; | 74 virtual MessageLoopShared* GetCurrentMessageLoop() OVERRIDE; |
| 77 base::TaskRunner* GetFileTaskRunner(PP_Instance instance) OVERRIDE; | 75 base::TaskRunner* GetFileTaskRunner(PP_Instance instance) OVERRIDE; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // PpapiGlobals overrides. | 134 // PpapiGlobals overrides. |
| 137 virtual bool IsPluginGlobals() const OVERRIDE; | 135 virtual bool IsPluginGlobals() const OVERRIDE; |
| 138 | 136 |
| 139 static PluginGlobals* plugin_globals_; | 137 static PluginGlobals* plugin_globals_; |
| 140 | 138 |
| 141 PluginProxyDelegate* plugin_proxy_delegate_; | 139 PluginProxyDelegate* plugin_proxy_delegate_; |
| 142 PluginResourceTracker plugin_resource_tracker_; | 140 PluginResourceTracker plugin_resource_tracker_; |
| 143 PluginVarTracker plugin_var_tracker_; | 141 PluginVarTracker plugin_var_tracker_; |
| 144 scoped_refptr<CallbackTracker> callback_tracker_; | 142 scoped_refptr<CallbackTracker> callback_tracker_; |
| 145 | 143 |
| 146 base::Lock proxy_lock_; | |
| 147 | |
| 148 scoped_ptr<base::ThreadLocalStorage::Slot> msg_loop_slot_; | 144 scoped_ptr<base::ThreadLocalStorage::Slot> msg_loop_slot_; |
| 149 // Note that loop_for_main_thread's constructor sets msg_loop_slot_, so it | 145 // Note that loop_for_main_thread's constructor sets msg_loop_slot_, so it |
| 150 // must be initialized after msg_loop_slot_ (hence the order here). | 146 // must be initialized after msg_loop_slot_ (hence the order here). |
| 151 scoped_refptr<MessageLoopResource> loop_for_main_thread_; | 147 scoped_refptr<MessageLoopResource> loop_for_main_thread_; |
| 152 | 148 |
| 153 // Name of the plugin used for error logging. This will be empty until | 149 // Name of the plugin used for error logging. This will be empty until |
| 154 // set_plugin_name is called. | 150 // set_plugin_name is called. |
| 155 std::string plugin_name_; | 151 std::string plugin_name_; |
| 156 | 152 |
| 157 // Command line for the plugin. This will be empty until set_command_line is | 153 // Command line for the plugin. This will be empty until set_command_line is |
| 158 // called. | 154 // called. |
| 159 std::string command_line_; | 155 std::string command_line_; |
| 160 | 156 |
| 161 scoped_ptr<BrowserSender> browser_sender_; | 157 scoped_ptr<BrowserSender> browser_sender_; |
| 162 | 158 |
| 163 // Thread for performing potentially blocking file operations. It's created | 159 // Thread for performing potentially blocking file operations. It's created |
| 164 // lazily, since it might not be needed. | 160 // lazily, since it might not be needed. |
| 165 scoped_ptr<base::Thread> file_thread_; | 161 scoped_ptr<base::Thread> file_thread_; |
| 166 | 162 |
| 167 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); | 163 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); |
| 168 }; | 164 }; |
| 169 | 165 |
| 170 } // namespace proxy | 166 } // namespace proxy |
| 171 } // namespace ppapi | 167 } // namespace ppapi |
| 172 | 168 |
| 173 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 169 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
| OLD | NEW |