Chromium Code Reviews| Index: ppapi/proxy/plugin_globals.h |
| diff --git a/ppapi/proxy/plugin_globals.h b/ppapi/proxy/plugin_globals.h |
| index bc55245d611a10c5dc154529a1749b595ef86134..918839cda12ffef44e5749767bbbe88b3a3aee0f 100644 |
| --- a/ppapi/proxy/plugin_globals.h |
| +++ b/ppapi/proxy/plugin_globals.h |
| @@ -73,6 +73,7 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals { |
| const std::string& value) OVERRIDE; |
| virtual MessageLoopShared* GetCurrentMessageLoop() OVERRIDE; |
| base::TaskRunner* GetFileTaskRunner() OVERRIDE; |
| + virtual void MarkPluginIsActive() OVERRIDE; |
| // Returns the channel for sending to the browser. |
| IPC::Sender* GetBrowserSender(); |
| @@ -128,12 +129,21 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals { |
| // The embedder should call this function when the command line is known. |
| void set_command_line(const std::string& c) { command_line_ = c; } |
| + // Interval to limit how many IPC messages are sent indicating that the plugin |
| + // is active and should be kept alive. The value must be smaller than any |
| + // threshold used to kill inactive plugins by the embedder host. |
| + int keep_aliave_throttle_interval_milliseconds(); |
|
yzshen1
2013/12/13 21:23:15
alive, please. And it seems you use keepalive with
yzshen1
2013/12/13 21:23:15
const for the method, please.
scheib
2013/12/14 00:07:41
Done.
scheib
2013/12/14 00:07:41
Done.
|
| + void set_keep_aliave_throttle_interval_milliseconds(int i); |
| + |
| private: |
| class BrowserSender; |
| // PpapiGlobals overrides. |
| virtual bool IsPluginGlobals() const OVERRIDE; |
| + // Releases the throttle on sending keepalive IPC messages. |
| + void OnReleaseKeepaliveThrottle(); |
|
yzshen1
2013/12/13 21:23:15
It seems better to comment that "Locks the proxy l
scheib
2013/12/14 00:07:41
Done.
|
| + |
| static PluginGlobals* plugin_globals_; |
| PluginProxyDelegate* plugin_proxy_delegate_; |
| @@ -160,6 +170,17 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals { |
| // lazily, since it might not be needed. |
| scoped_ptr<base::Thread> file_thread_; |
| + // Indicates activity by the plugin. Used to monitor when a plugin can be |
| + // shutdown due to idleness. Current needs do not require differentiating |
| + // between idle state between multiple instances, if any are active they are |
| + // all considered active. |
| + bool plugin_recently_active_; |
| + |
| + int keep_aliave_throttle_interval_milliseconds_; |
|
yzshen1
2013/12/13 21:23:15
alive, please.
(You are using auto-completion for
scheib
2013/12/14 00:07:41
Done.
|
| + |
| + // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. |
| + base::WeakPtrFactory<PluginGlobals> weak_factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(PluginGlobals); |
| }; |