Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2727253005: Move beforeunload hang timer duties to its own timer. (Closed)
Patch Set: timeout values Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
4871 if (!GetRenderViewHost() || !GetRenderViewHost()->IsRenderViewLive()) 4861 if (!GetRenderViewHost() || !GetRenderViewHost()->IsRenderViewLive())
4872 return; 4862 return;
4873 4863
4874 if (delegate_) { 4864 if (delegate_) {
4875 WebContentsUnresponsiveState unresponsive_state; 4865 WebContentsUnresponsiveState unresponsive_state;
4876 unresponsive_state.reason = type; 4866 unresponsive_state.reason = type;
4877 unresponsive_state.outstanding_ack_count = 4867 unresponsive_state.outstanding_ack_count =
4878 render_widget_host->in_flight_event_count(); 4868 render_widget_host->in_flight_event_count();
4879 unresponsive_state.outstanding_event_type = 4869 unresponsive_state.outstanding_event_type =
4880 render_widget_host->hang_monitor_event_type(); 4870 render_widget_host->hang_monitor_event_type();
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
5419 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5409 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5420 if (!render_view_host) 5410 if (!render_view_host)
5421 continue; 5411 continue;
5422 render_view_host_set.insert(render_view_host); 5412 render_view_host_set.insert(render_view_host);
5423 } 5413 }
5424 for (RenderViewHost* render_view_host : render_view_host_set) 5414 for (RenderViewHost* render_view_host : render_view_host_set)
5425 render_view_host->OnWebkitPreferencesChanged(); 5415 render_view_host->OnWebkitPreferencesChanged();
5426 } 5416 }
5427 5417
5428 } // namespace content 5418 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698