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

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

Issue 243703003: Removes win8_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar Created 6 years, 8 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
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc
index a7b95af0db2fbb5aadfbe5dc41c41ef81f36750e..a663391fc85d6a55629e6772bb601fe3d548b42d 100644
--- a/chrome/browser/ui/views/hung_renderer_view.cc
+++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -26,6 +26,7 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
+#include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
@@ -38,37 +39,19 @@
#include "ui/views/window/client_view.h"
#if defined(OS_WIN)
+#include "chrome/browser/hang_monitor/hang_crash_dump_win.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/shell_integration.h"
#include "ui/base/win/shell.h"
#include "ui/views/win/hwnd_util.h"
#endif
-#if defined(USE_AURA)
-#include "ui/aura/window.h"
-#endif
-
#if defined(OS_WIN)
#include "ui/base/win/shell.h"
#endif
using content::WebContents;
-// These functions allow certain chrome platforms to override the default hung
-// renderer dialog. For e.g. Chrome on Windows 8 metro
-bool PlatformShowCustomHungRendererDialog(WebContents* contents);
-bool PlatformHideCustomHungRendererDialog(WebContents* contents);
-
-#if !defined(OS_WIN)
-bool PlatformShowCustomHungRendererDialog(WebContents* contents) {
- return false;
-}
-
-bool PlatformHideCustomHungRendererDialog(WebContents* contents) {
- return false;
-}
-#endif // OS_WIN
-
HungRendererDialogView* HungRendererDialogView::g_instance_ = NULL;
///////////////////////////////////////////////////////////////////////////////
@@ -218,13 +201,16 @@ bool HungRendererDialogView::IsFrameActive(WebContents* contents) {
return platform_util::IsWindowActive(frame_view);
}
-#if !defined(OS_WIN)
// static
void HungRendererDialogView::KillRendererProcess(
base::ProcessHandle process_handle) {
+#if defined(OS_WIN)
+ // Try to generate a crash report for the hung process.
+ CrashDumpAndTerminateHungChildProcess(process_handle);
+#else
base::KillProcess(process_handle, content::RESULT_CODE_HUNG, false);
+#endif
}
-#endif // OS_WIN
HungRendererDialogView::HungRendererDialogView()
@@ -451,27 +437,22 @@ void HungRendererDialogView::InitClass() {
namespace chrome {
void ShowHungRendererDialog(WebContents* contents) {
- if (!logging::DialogsAreSuppressed() &&
- !PlatformShowCustomHungRendererDialog(contents)) {
- gfx::NativeView toplevel_view =
- platform_util::GetTopLevel(contents->GetView()->GetNativeView());
-#if defined(USE_AURA)
- // Don't show the dialog if there is no root window for the renderer,
- // because it's invisible to the user (happens when the renderer is for
- // prerendering for example).
- if (!toplevel_view->GetRootWindow())
- return;
-#endif
- HungRendererDialogView* view = HungRendererDialogView::Create(
- toplevel_view);
- view->ShowForWebContents(contents);
- }
+ if (logging::DialogsAreSuppressed())
+ return;
+
+ gfx::NativeView toplevel_view =
+ platform_util::GetTopLevel(contents->GetView()->GetNativeView());
+ // Don't show the dialog if there is no root window for the renderer, because
+ // it's invisible to the user (happens when the renderer is for prerendering
+ // for example).
+ if (!toplevel_view->GetRootWindow())
+ return;
+ HungRendererDialogView* view = HungRendererDialogView::Create(toplevel_view);
+ view->ShowForWebContents(contents);
}
void HideHungRendererDialog(WebContents* contents) {
- if (!logging::DialogsAreSuppressed() &&
- !PlatformHideCustomHungRendererDialog(contents) &&
- HungRendererDialogView::GetInstance())
+ if (!logging::DialogsAreSuppressed() && HungRendererDialogView::GetInstance())
HungRendererDialogView::GetInstance()->EndForWebContents(contents);
}
« no previous file with comments | « chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc ('k') | chrome/browser/ui/views/hung_renderer_view_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698