| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 window->FocusConstrainedWindow(); | 1751 window->FocusConstrainedWindow(); |
| 1752 } | 1752 } |
| 1753 } | 1753 } |
| 1754 | 1754 |
| 1755 void TabContents::RendererUnresponsive(RenderViewHost* rvh, | 1755 void TabContents::RendererUnresponsive(RenderViewHost* rvh, |
| 1756 bool is_during_unload) { | 1756 bool is_during_unload) { |
| 1757 // Don't show hung renderer dialog for a swapped out RVH. | 1757 // Don't show hung renderer dialog for a swapped out RVH. |
| 1758 if (rvh != render_view_host()) | 1758 if (rvh != render_view_host()) |
| 1759 return; | 1759 return; |
| 1760 | 1760 |
| 1761 // Ignore renderer unresponsive event if debugger is attached to the tab |
| 1762 // since the event may be a result of the renderer sitting on a breakpoint. |
| 1763 // See http://crbug.com/65458 |
| 1764 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); |
| 1765 if (devtools_manager && |
| 1766 devtools_manager->GetDevToolsClientHostFor(rvh) != NULL) |
| 1767 return; |
| 1768 |
| 1761 if (is_during_unload) { | 1769 if (is_during_unload) { |
| 1762 // Hang occurred while firing the beforeunload/unload handler. | 1770 // Hang occurred while firing the beforeunload/unload handler. |
| 1763 // Pretend the handler fired so tab closing continues as if it had. | 1771 // Pretend the handler fired so tab closing continues as if it had. |
| 1764 rvh->set_sudden_termination_allowed(true); | 1772 rvh->set_sudden_termination_allowed(true); |
| 1765 | 1773 |
| 1766 if (!render_manager_.ShouldCloseTabOnUnresponsiveRenderer()) | 1774 if (!render_manager_.ShouldCloseTabOnUnresponsiveRenderer()) |
| 1767 return; | 1775 return; |
| 1768 | 1776 |
| 1769 // If the tab hangs in the beforeunload/unload handler there's really | 1777 // If the tab hangs in the beforeunload/unload handler there's really |
| 1770 // nothing we can do to recover. Pretend the unload listeners have | 1778 // nothing we can do to recover. Pretend the unload listeners have |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1904 } | 1912 } |
| 1905 | 1913 |
| 1906 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 1914 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
| 1907 render_manager_.SwapInRenderViewHost(rvh); | 1915 render_manager_.SwapInRenderViewHost(rvh); |
| 1908 } | 1916 } |
| 1909 | 1917 |
| 1910 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 1918 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 1911 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 1919 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 1912 rwh_view->SetSize(view()->GetContainerSize()); | 1920 rwh_view->SetSize(view()->GetContainerSize()); |
| 1913 } | 1921 } |
| OLD | NEW |