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 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 4840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4851 return; | 4851 return; |
4852 | 4852 |
4853 if (ShouldIgnoreUnresponsiveRenderer()) | 4853 if (ShouldIgnoreUnresponsiveRenderer()) |
4854 return; | 4854 return; |
4855 | 4855 |
4856 // Record histograms about the type of renderer hang. | 4856 // Record histograms about the type of renderer hang. |
4857 UMA_HISTOGRAM_ENUMERATION( | 4857 UMA_HISTOGRAM_ENUMERATION( |
4858 "ChildProcess.HangRendererType", type, | 4858 "ChildProcess.HangRendererType", type, |
4859 RendererUnresponsiveType::RENDERER_UNRESPONSIVE_MAX); | 4859 RendererUnresponsiveType::RENDERER_UNRESPONSIVE_MAX); |
4860 | 4860 |
| 4861 RenderFrameHostImpl* rfhi = |
| 4862 static_cast<RenderFrameHostImpl*>(GetRenderViewHost()->GetMainFrame()); |
| 4863 if (rfhi->is_waiting_for_beforeunload_ack()) { |
| 4864 // If the hang is in the beforeunload handler, pretend the beforeunload |
| 4865 // listeners have all fired and allow the delegate to continue closing; |
| 4866 // the user will not have the option of cancelling the close. |
| 4867 rfhi->SimulateBeforeUnloadAck(); |
| 4868 return; |
| 4869 } |
| 4870 |
4861 if (!GetRenderViewHost() || !GetRenderViewHost()->IsRenderViewLive()) | 4871 if (!GetRenderViewHost() || !GetRenderViewHost()->IsRenderViewLive()) |
4862 return; | 4872 return; |
4863 | 4873 |
4864 if (delegate_) { | 4874 if (delegate_) { |
4865 WebContentsUnresponsiveState unresponsive_state; | 4875 WebContentsUnresponsiveState unresponsive_state; |
4866 unresponsive_state.reason = type; | 4876 unresponsive_state.reason = type; |
4867 unresponsive_state.outstanding_ack_count = | 4877 unresponsive_state.outstanding_ack_count = |
4868 render_widget_host->in_flight_event_count(); | 4878 render_widget_host->in_flight_event_count(); |
4869 unresponsive_state.outstanding_event_type = | 4879 unresponsive_state.outstanding_event_type = |
4870 render_widget_host->hang_monitor_event_type(); | 4880 render_widget_host->hang_monitor_event_type(); |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5409 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5419 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
5410 if (!render_view_host) | 5420 if (!render_view_host) |
5411 continue; | 5421 continue; |
5412 render_view_host_set.insert(render_view_host); | 5422 render_view_host_set.insert(render_view_host); |
5413 } | 5423 } |
5414 for (RenderViewHost* render_view_host : render_view_host_set) | 5424 for (RenderViewHost* render_view_host : render_view_host_set) |
5415 render_view_host->OnWebkitPreferencesChanged(); | 5425 render_view_host->OnWebkitPreferencesChanged(); |
5416 } | 5426 } |
5417 | 5427 |
5418 } // namespace content | 5428 } // namespace content |
OLD | NEW |