| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // PpapiGlobals::Get() when possible. Use this only when you need some | 46 // PpapiGlobals::Get() when possible. Use this only when you need some |
| 47 // plugin-specific functionality. | 47 // plugin-specific functionality. |
| 48 inline static PluginGlobals* Get() { | 48 inline static PluginGlobals* Get() { |
| 49 // Explicitly crash if this is the wrong process type, we want to get | 49 // Explicitly crash if this is the wrong process type, we want to get |
| 50 // crash reports. | 50 // crash reports. |
| 51 CHECK(PpapiGlobals::Get()->IsPluginGlobals()); | 51 CHECK(PpapiGlobals::Get()->IsPluginGlobals()); |
| 52 return static_cast<PluginGlobals*>(PpapiGlobals::Get()); | 52 return static_cast<PluginGlobals*>(PpapiGlobals::Get()); |
| 53 } | 53 } |
| 54 | 54 |
| 55 // PpapiGlobals implementation. | 55 // PpapiGlobals implementation. |
| 56 virtual ResourceTracker* GetResourceTracker() OVERRIDE; | 56 virtual ResourceTracker* GetResourceTracker() override; |
| 57 virtual VarTracker* GetVarTracker() OVERRIDE; | 57 virtual VarTracker* GetVarTracker() override; |
| 58 virtual CallbackTracker* GetCallbackTrackerForInstance( | 58 virtual CallbackTracker* GetCallbackTrackerForInstance( |
| 59 PP_Instance instance) OVERRIDE; | 59 PP_Instance instance) override; |
| 60 virtual thunk::PPB_Instance_API* GetInstanceAPI( | 60 virtual thunk::PPB_Instance_API* GetInstanceAPI( |
| 61 PP_Instance instance) OVERRIDE; | 61 PP_Instance instance) override; |
| 62 virtual thunk::ResourceCreationAPI* GetResourceCreationAPI( | 62 virtual thunk::ResourceCreationAPI* GetResourceCreationAPI( |
| 63 PP_Instance instance) OVERRIDE; | 63 PP_Instance instance) override; |
| 64 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; | 64 virtual PP_Module GetModuleForInstance(PP_Instance instance) override; |
| 65 virtual std::string GetCmdLine() OVERRIDE; | 65 virtual std::string GetCmdLine() override; |
| 66 virtual void PreCacheFontForFlash(const void* logfontw) OVERRIDE; | 66 virtual void PreCacheFontForFlash(const void* logfontw) override; |
| 67 virtual void LogWithSource(PP_Instance instance, | 67 virtual void LogWithSource(PP_Instance instance, |
| 68 PP_LogLevel level, | 68 PP_LogLevel level, |
| 69 const std::string& source, | 69 const std::string& source, |
| 70 const std::string& value) OVERRIDE; | 70 const std::string& value) override; |
| 71 virtual void BroadcastLogWithSource(PP_Module module, | 71 virtual void BroadcastLogWithSource(PP_Module module, |
| 72 PP_LogLevel level, | 72 PP_LogLevel level, |
| 73 const std::string& source, | 73 const std::string& source, |
| 74 const std::string& value) OVERRIDE; | 74 const std::string& value) override; |
| 75 virtual MessageLoopShared* GetCurrentMessageLoop() OVERRIDE; | 75 virtual MessageLoopShared* GetCurrentMessageLoop() override; |
| 76 base::TaskRunner* GetFileTaskRunner() OVERRIDE; | 76 base::TaskRunner* GetFileTaskRunner() override; |
| 77 virtual void MarkPluginIsActive() OVERRIDE; | 77 virtual void MarkPluginIsActive() override; |
| 78 | 78 |
| 79 // Returns the channel for sending to the browser. | 79 // Returns the channel for sending to the browser. |
| 80 IPC::Sender* GetBrowserSender(); | 80 IPC::Sender* GetBrowserSender(); |
| 81 | 81 |
| 82 // Returns the language code of the current UI language. | 82 // Returns the language code of the current UI language. |
| 83 std::string GetUILanguage(); | 83 std::string GetUILanguage(); |
| 84 | 84 |
| 85 // Sets the active url which is reported by breakpad. | 85 // Sets the active url which is reported by breakpad. |
| 86 void SetActiveURL(const std::string& url); | 86 void SetActiveURL(const std::string& url); |
| 87 | 87 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 // Interval to limit how many IPC messages are sent indicating that the plugin | 139 // Interval to limit how many IPC messages are sent indicating that the plugin |
| 140 // is active and should be kept alive. The value must be smaller than any | 140 // is active and should be kept alive. The value must be smaller than any |
| 141 // threshold used to kill inactive plugins by the embedder host. | 141 // threshold used to kill inactive plugins by the embedder host. |
| 142 void set_keepalive_throttle_interval_milliseconds(unsigned i); | 142 void set_keepalive_throttle_interval_milliseconds(unsigned i); |
| 143 | 143 |
| 144 private: | 144 private: |
| 145 class BrowserSender; | 145 class BrowserSender; |
| 146 | 146 |
| 147 // PpapiGlobals overrides. | 147 // PpapiGlobals overrides. |
| 148 virtual bool IsPluginGlobals() const OVERRIDE; | 148 virtual bool IsPluginGlobals() const override; |
| 149 | 149 |
| 150 // Locks the proxy lock and releases the throttle on keepalive IPC messages. | 150 // Locks the proxy lock and releases the throttle on keepalive IPC messages. |
| 151 void OnReleaseKeepaliveThrottle(); | 151 void OnReleaseKeepaliveThrottle(); |
| 152 | 152 |
| 153 static PluginGlobals* plugin_globals_; | 153 static PluginGlobals* plugin_globals_; |
| 154 | 154 |
| 155 PluginProxyDelegate* plugin_proxy_delegate_; | 155 PluginProxyDelegate* plugin_proxy_delegate_; |
| 156 PluginResourceTracker plugin_resource_tracker_; | 156 PluginResourceTracker plugin_resource_tracker_; |
| 157 PluginVarTracker plugin_var_tracker_; | 157 PluginVarTracker plugin_var_tracker_; |
| 158 scoped_refptr<CallbackTracker> callback_tracker_; | 158 scoped_refptr<CallbackTracker> callback_tracker_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 189 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. | 189 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. |
| 190 base::WeakPtrFactory<PluginGlobals> weak_factory_; | 190 base::WeakPtrFactory<PluginGlobals> weak_factory_; |
| 191 | 191 |
| 192 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); | 192 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 } // namespace proxy | 195 } // namespace proxy |
| 196 } // namespace ppapi | 196 } // namespace ppapi |
| 197 | 197 |
| 198 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 198 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
| OLD | NEW |