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

Unified Diff: chrome/browser/ui/views/hung_renderer_view.cc

Issue 10806079: Add support for invoking the Windows 8 metro style hung renderer dialog box. The dialog box (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/hung_renderer_view.cc
===================================================================
--- chrome/browser/ui/views/hung_renderer_view.cc (revision 147919)
+++ chrome/browser/ui/views/hung_renderer_view.cc (working copy)
@@ -39,10 +39,6 @@
#include "ui/aura/window.h"
#endif
-#if defined(OS_WIN)
-#include "chrome/browser/hang_monitor/hang_crash_dump_win.h"
-#endif
-
HungRendererDialogView* HungRendererDialogView::g_instance_ = NULL;
///////////////////////////////////////////////////////////////////////////////
@@ -208,7 +204,8 @@
// Don't show the warning unless the foreground window is the frame, or this
// window (but still invisible). If the user has another window or
// application selected, activating ourselves is rude.
- if (!IsFrameActive(contents))
+ if (!IsFrameActive(contents) &&
+ !platform_util::IsWindowActive(GetWidget()->GetNativeWindow()))
return;
if (!GetWidget()->IsActive()) {
@@ -306,13 +303,7 @@
base::ProcessHandle process_handle =
hung_pages_table_model_->GetRenderProcessHost()->GetHandle();
-#if defined(OS_WIN)
- // Try to generate a crash report for the hung process.
- CrashDumpAndTerminateHungChildProcess(process_handle);
-#else
- // Kill the process.
- base::KillProcess(process_handle, content::RESULT_CODE_HUNG, false);
-#endif
+ KillRendererProcess(process_handle);
}
}
@@ -336,11 +327,7 @@
bool HungRendererDialogView::IsFrameActive(WebContents* contents) {
gfx::NativeView frame_view =
platform_util::GetTopLevel(contents->GetNativeView());
- if (!platform_util::IsWindowActive(frame_view) &&
- !platform_util::IsWindowActive(GetWidget()->GetNativeWindow())) {
- return false;
- }
- return true;
+ return platform_util::IsWindowActive(frame_view);
}
///////////////////////////////////////////////////////////////////////////////
@@ -449,6 +436,14 @@
}
}
+#if !defined(OS_WIN)
+// static
+void HungRendererDialogView::KillRendererProcess(
+ base::ProcessHandle process_handle) {
+ base::KillProcess(process_handle, content::RESULT_CODE_HUNG, false);
+}
+#endif // OS_WIN
+
namespace chrome {
void ShowHungRendererDialog(WebContents* contents) {

Powered by Google App Engine
This is Rietveld 408576698