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

Unified Diff: chrome/browser/ui/hung_plugin_tab_helper.cc

Issue 14178004: Move HungPluginTabHelper::PluginState declaration from .h to .cc file. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 months 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 | « chrome/browser/ui/hung_plugin_tab_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/hung_plugin_tab_helper.cc
===================================================================
--- chrome/browser/ui/hung_plugin_tab_helper.cc (revision 194500)
+++ chrome/browser/ui/hung_plugin_tab_helper.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/hung_plugin_tab_helper.h"
#include "base/bind.h"
+#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/process.h"
#include "base/process_util.h"
@@ -207,6 +208,34 @@
// -----------------------------------------------------------------------------
+// Per-plugin state (since there could be more than one plugin hung). The
+// integer key is the child process ID of the plugin process. This maintains
+// the state for all plugins on this page that are currently hung, whether or
+// not we're currently showing the infobar.
+struct HungPluginTabHelper::PluginState {
+ // Initializes the plugin state to be a hung plugin.
+ PluginState(const base::FilePath& p, const string16& n);
+ ~PluginState();
+
+ base::FilePath path;
+ string16 name;
+
+ // Possibly-null if we're not showing an infobar right now.
+ InfoBarDelegate* info_bar;
+
+ // Time to delay before re-showing the infobar for a hung plugin. This is
+ // increased each time the user cancels it.
+ base::TimeDelta next_reshow_delay;
+
+ // Handles calling the helper when the infobar should be re-shown.
+ base::Timer timer;
+
+ private:
+ // Since the scope of the timer manages our callback, this struct should
+ // not be copied.
+ DISALLOW_COPY_AND_ASSIGN(PluginState);
+};
+
HungPluginTabHelper::PluginState::PluginState(const base::FilePath& p,
const string16& n)
: path(p),
« no previous file with comments | « chrome/browser/ui/hung_plugin_tab_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698