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

Unified Diff: ppapi/proxy/plugin_globals.h

Issue 61063003: Keep NaCl plugins used in app background pages alive when active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: diii Created 7 years, 1 month 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
Index: ppapi/proxy/plugin_globals.h
diff --git a/ppapi/proxy/plugin_globals.h b/ppapi/proxy/plugin_globals.h
index bc55245d611a10c5dc154529a1749b595ef86134..3587bb86fef18736ec48312c9873b23b91eac3c3 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,6 +129,9 @@ 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; }
+ bool plugin_has_been_active() const { return plugin_has_been_active_; }
+ void set_plugin_has_been_active(bool b) { plugin_has_been_active_ = b; }
+
private:
class BrowserSender;
@@ -160,6 +164,12 @@ 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_has_been_active_;
+
DISALLOW_COPY_AND_ASSIGN(PluginGlobals);
};

Powered by Google App Engine
This is Rietveld 408576698