| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // The embedder should call this function when the command line is known. | 130 // The embedder should call this function when the command line is known. |
| 131 void set_command_line(const std::string& c) { command_line_ = c; } | 131 void set_command_line(const std::string& c) { command_line_ = c; } |
| 132 | 132 |
| 133 ResourceReplyThreadRegistrar* resource_reply_thread_registrar() { | 133 ResourceReplyThreadRegistrar* resource_reply_thread_registrar() { |
| 134 return resource_reply_thread_registrar_.get(); | 134 return resource_reply_thread_registrar_.get(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 // Interval to limit how many IPC messages are sent indicating that the plugin | 137 // Interval to limit how many IPC messages are sent indicating that the plugin |
| 138 // is active and should be kept alive. The value must be smaller than any | 138 // is active and should be kept alive. The value must be smaller than any |
| 139 // threshold used to kill inactive plugins by the embedder host. | 139 // threshold used to kill inactive plugins by the embedder host. |
| 140 void set_keepalive_throttle_interval_milliseconds(unsigned i); | 140 int keepalive_throttle_interval_milliseconds() const; |
| 141 void set_keepalive_throttle_interval_milliseconds(int i); |
| 141 | 142 |
| 142 private: | 143 private: |
| 143 class BrowserSender; | 144 class BrowserSender; |
| 144 | 145 |
| 145 // PpapiGlobals overrides. | 146 // PpapiGlobals overrides. |
| 146 virtual bool IsPluginGlobals() const OVERRIDE; | 147 virtual bool IsPluginGlobals() const OVERRIDE; |
| 147 | 148 |
| 148 // Locks the proxy lock and releases the throttle on keepalive IPC messages. | 149 // Locks the proxy lock and releases the throttle on keepalive IPC messages. |
| 149 void OnReleaseKeepaliveThrottle(); | 150 void OnReleaseKeepaliveThrottle(); |
| 150 | 151 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 175 scoped_ptr<base::Thread> file_thread_; | 176 scoped_ptr<base::Thread> file_thread_; |
| 176 | 177 |
| 177 scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_; | 178 scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_; |
| 178 | 179 |
| 179 // Indicates activity by the plugin. Used to monitor when a plugin can be | 180 // Indicates activity by the plugin. Used to monitor when a plugin can be |
| 180 // shutdown due to idleness. Current needs do not require differentiating | 181 // shutdown due to idleness. Current needs do not require differentiating |
| 181 // between idle state between multiple instances, if any are active they are | 182 // between idle state between multiple instances, if any are active they are |
| 182 // all considered active. | 183 // all considered active. |
| 183 bool plugin_recently_active_; | 184 bool plugin_recently_active_; |
| 184 | 185 |
| 185 unsigned keepalive_throttle_interval_milliseconds_; | 186 int keepalive_throttle_interval_milliseconds_; |
| 186 | 187 |
| 187 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. | 188 // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. |
| 188 base::WeakPtrFactory<PluginGlobals> weak_factory_; | 189 base::WeakPtrFactory<PluginGlobals> weak_factory_; |
| 189 | 190 |
| 190 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); | 191 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); |
| 191 }; | 192 }; |
| 192 | 193 |
| 193 } // namespace proxy | 194 } // namespace proxy |
| 194 } // namespace ppapi | 195 } // namespace ppapi |
| 195 | 196 |
| 196 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 197 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
| OLD | NEW |