| 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),
|
|
|