| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // - Keep track of all of this for any number of plugins. | 38 // - Keep track of all of this for any number of plugins. |
| 39 class HungPluginTabHelper | 39 class HungPluginTabHelper |
| 40 : public content::WebContentsObserver, | 40 : public content::WebContentsObserver, |
| 41 public content::NotificationObserver, | 41 public content::NotificationObserver, |
| 42 public content::WebContentsUserData<HungPluginTabHelper> { | 42 public content::WebContentsUserData<HungPluginTabHelper> { |
| 43 public: | 43 public: |
| 44 virtual ~HungPluginTabHelper(); | 44 virtual ~HungPluginTabHelper(); |
| 45 | 45 |
| 46 // content::WebContentsObserver: | 46 // content::WebContentsObserver: |
| 47 virtual void PluginCrashed(const base::FilePath& plugin_path, | 47 virtual void PluginCrashed(const base::FilePath& plugin_path, |
| 48 base::ProcessId plugin_pid) OVERRIDE; | 48 base::ProcessId plugin_pid) override; |
| 49 virtual void PluginHungStatusChanged(int plugin_child_id, | 49 virtual void PluginHungStatusChanged(int plugin_child_id, |
| 50 const base::FilePath& plugin_path, | 50 const base::FilePath& plugin_path, |
| 51 bool is_hung) OVERRIDE; | 51 bool is_hung) override; |
| 52 | 52 |
| 53 // content::NotificationObserver: | 53 // content::NotificationObserver: |
| 54 virtual void Observe(int type, | 54 virtual void Observe(int type, |
| 55 const content::NotificationSource& source, | 55 const content::NotificationSource& source, |
| 56 const content::NotificationDetails& details) OVERRIDE; | 56 const content::NotificationDetails& details) override; |
| 57 | 57 |
| 58 // Called by an infobar when the user selects to kill the plugin. | 58 // Called by an infobar when the user selects to kill the plugin. |
| 59 void KillPlugin(int child_id); | 59 void KillPlugin(int child_id); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 friend class content::WebContentsUserData<HungPluginTabHelper>; | 62 friend class content::WebContentsUserData<HungPluginTabHelper>; |
| 63 | 63 |
| 64 struct PluginState; | 64 struct PluginState; |
| 65 typedef std::map<int, linked_ptr<PluginState> > PluginStateMap; | 65 typedef std::map<int, linked_ptr<PluginState> > PluginStateMap; |
| 66 | 66 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 79 | 79 |
| 80 content::NotificationRegistrar registrar_; | 80 content::NotificationRegistrar registrar_; |
| 81 | 81 |
| 82 // All currently hung plugins. | 82 // All currently hung plugins. |
| 83 PluginStateMap hung_plugins_; | 83 PluginStateMap hung_plugins_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper); | 85 DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 #endif // CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ | 88 #endif // CHROME_BROWSER_UI_HUNG_PLUGIN_TAB_HELPER_H_ |
| OLD | NEW |