Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: ppapi/proxy/plugin_globals.h

Issue 105873003: Superset of Nacl Keepalive patch & tests - NOT FOR LANDING DIRECTLY. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/process_manager.cc ('k') | ppapi/proxy/plugin_globals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_globals.h
diff --git a/ppapi/proxy/plugin_globals.h b/ppapi/proxy/plugin_globals.h
index 029e2d2e28eebae94a1d69040ea59a19d04221f7..dac33b613fe52c3e94c0627896c847cb611ddf7c 100644
--- a/ppapi/proxy/plugin_globals.h
+++ b/ppapi/proxy/plugin_globals.h
@@ -74,6 +74,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();
@@ -133,12 +134,21 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals {
return resource_reply_thread_registrar_.get();
}
+ // 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 keepalive_throttle_interval_milliseconds() const;
+ void set_keepalive_throttle_interval_milliseconds(int i);
+
private:
class BrowserSender;
// PpapiGlobals overrides.
virtual bool IsPluginGlobals() const OVERRIDE;
+ // Locks the proxy lock and releases the throttle on keepalive IPC messages.
+ void OnReleaseKeepaliveThrottle();
+
static PluginGlobals* plugin_globals_;
PluginProxyDelegate* plugin_proxy_delegate_;
@@ -167,6 +177,17 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals {
scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_;
+ // 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 keepalive_throttle_interval_milliseconds_;
+
+ // Member variables should appear before the WeakPtrFactory, see weak_ptr.h.
+ base::WeakPtrFactory<PluginGlobals> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(PluginGlobals);
};
« no previous file with comments | « extensions/browser/process_manager.cc ('k') | ppapi/proxy/plugin_globals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698