| 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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 // PpapiGlobals implementation. | 37 // PpapiGlobals implementation. |
| 38 virtual ResourceTracker* GetResourceTracker() OVERRIDE; | 38 virtual ResourceTracker* GetResourceTracker() OVERRIDE; |
| 39 virtual VarTracker* GetVarTracker() OVERRIDE; | 39 virtual VarTracker* GetVarTracker() OVERRIDE; |
| 40 virtual CallbackTracker* GetCallbackTrackerForInstance( | 40 virtual CallbackTracker* GetCallbackTrackerForInstance( |
| 41 PP_Instance instance) OVERRIDE; | 41 PP_Instance instance) OVERRIDE; |
| 42 virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst, | 42 virtual FunctionGroupBase* GetFunctionAPI(PP_Instance inst, |
| 43 ApiID id) OVERRIDE; | 43 ApiID id) OVERRIDE; |
| 44 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; | 44 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; |
| 45 virtual std::string GetCmdLine() OVERRIDE; |
| 46 virtual void PreCacheFontForFlash(const void* logfontw) OVERRIDE; |
| 45 virtual base::Lock* GetProxyLock() OVERRIDE; | 47 virtual base::Lock* GetProxyLock() OVERRIDE; |
| 46 virtual void LogWithSource(PP_Instance instance, | 48 virtual void LogWithSource(PP_Instance instance, |
| 47 PP_LogLevel_Dev level, | 49 PP_LogLevel_Dev level, |
| 48 const std::string& source, | 50 const std::string& source, |
| 49 const std::string& value) OVERRIDE; | 51 const std::string& value) OVERRIDE; |
| 50 virtual void BroadcastLogWithSource(PP_Module module, | 52 virtual void BroadcastLogWithSource(PP_Module module, |
| 51 PP_LogLevel_Dev level, | 53 PP_LogLevel_Dev level, |
| 52 const std::string& source, | 54 const std::string& source, |
| 53 const std::string& value) OVERRIDE; | 55 const std::string& value) OVERRIDE; |
| 54 | 56 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 79 // Sets the message loop slot, takes ownership of the given heap-alloated | 81 // Sets the message loop slot, takes ownership of the given heap-alloated |
| 80 // pointer. | 82 // pointer. |
| 81 void set_msg_loop_slot(base::ThreadLocalStorage::Slot* slot) { | 83 void set_msg_loop_slot(base::ThreadLocalStorage::Slot* slot) { |
| 82 msg_loop_slot_.reset(slot); | 84 msg_loop_slot_.reset(slot); |
| 83 } | 85 } |
| 84 | 86 |
| 85 // The embedder should call this function when the name of the plugin module | 87 // The embedder should call this function when the name of the plugin module |
| 86 // is known. This will be used for error logging. | 88 // is known. This will be used for error logging. |
| 87 void set_plugin_name(const std::string& name) { plugin_name_ = name; } | 89 void set_plugin_name(const std::string& name) { plugin_name_ = name; } |
| 88 | 90 |
| 91 // The embedder should call this function when the command line is known. |
| 92 void set_command_line(const std::string& c) { command_line_ = c; } |
| 93 |
| 89 private: | 94 private: |
| 90 // PpapiGlobals overrides. | 95 // PpapiGlobals overrides. |
| 91 virtual bool IsPluginGlobals() const OVERRIDE; | 96 virtual bool IsPluginGlobals() const OVERRIDE; |
| 92 | 97 |
| 93 static PluginGlobals* plugin_globals_; | 98 static PluginGlobals* plugin_globals_; |
| 94 | 99 |
| 95 PluginProxyDelegate* plugin_proxy_delegate_; | 100 PluginProxyDelegate* plugin_proxy_delegate_; |
| 96 PluginResourceTracker plugin_resource_tracker_; | 101 PluginResourceTracker plugin_resource_tracker_; |
| 97 PluginVarTracker plugin_var_tracker_; | 102 PluginVarTracker plugin_var_tracker_; |
| 98 scoped_refptr<CallbackTracker> callback_tracker_; | 103 scoped_refptr<CallbackTracker> callback_tracker_; |
| 99 base::Lock proxy_lock_; | 104 base::Lock proxy_lock_; |
| 100 | 105 |
| 101 scoped_ptr<base::ThreadLocalStorage::Slot> msg_loop_slot_; | 106 scoped_ptr<base::ThreadLocalStorage::Slot> msg_loop_slot_; |
| 102 | 107 |
| 103 // Name of the plugin used for error logging. This will be empty until | 108 // Name of the plugin used for error logging. This will be empty until |
| 104 // SetPluginName is called. | 109 // set_plugin_name is called. |
| 105 std::string plugin_name_; | 110 std::string plugin_name_; |
| 106 | 111 |
| 112 // Command line for the plugin. This will be empty until set_command_line is |
| 113 // called. |
| 114 std::string command_line_; |
| 115 |
| 107 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); | 116 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); |
| 108 }; | 117 }; |
| 109 | 118 |
| 110 } // namespace proxy | 119 } // namespace proxy |
| 111 } // namespace ppapi | 120 } // namespace ppapi |
| 112 | 121 |
| 113 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 122 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
| OLD | NEW |