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 && devtools_manager->IsBeingDebugged(rvh)) | |
pfeldman1
2011/08/03 16:28:50
What if the page has in fact hit the infinite loop
| |
1766 return; | |
1767 | |
1761 if (is_during_unload) { | 1768 if (is_during_unload) { |
1762 // Hang occurred while firing the beforeunload/unload handler. | 1769 // Hang occurred while firing the beforeunload/unload handler. |
1763 // Pretend the handler fired so tab closing continues as if it had. | 1770 // Pretend the handler fired so tab closing continues as if it had. |
1764 rvh->set_sudden_termination_allowed(true); | 1771 rvh->set_sudden_termination_allowed(true); |
1765 | 1772 |
1766 if (!render_manager_.ShouldCloseTabOnUnresponsiveRenderer()) | 1773 if (!render_manager_.ShouldCloseTabOnUnresponsiveRenderer()) |
1767 return; | 1774 return; |
1768 | 1775 |
1769 // If the tab hangs in the beforeunload/unload handler there's really | 1776 // If the tab hangs in the beforeunload/unload handler there's really |
1770 // nothing we can do to recover. Pretend the unload listeners have | 1777 // 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 } | 1911 } |
1905 | 1912 |
1906 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 1913 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
1907 render_manager_.SwapInRenderViewHost(rvh); | 1914 render_manager_.SwapInRenderViewHost(rvh); |
1908 } | 1915 } |
1909 | 1916 |
1910 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 1917 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
1911 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 1918 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
1912 rwh_view->SetSize(view()->GetContainerSize()); | 1919 rwh_view->SetSize(view()->GetContainerSize()); |
1913 } | 1920 } |
OLD | NEW |