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

Unified Diff: chrome/gpu/gpu_main.cc

Issue 5537006: Disabled GPU watchdog thread on Windows.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/gpu_main.cc
===================================================================
--- chrome/gpu/gpu_main.cc (revision 68358)
+++ chrome/gpu/gpu_main.cc (working copy)
@@ -9,7 +9,6 @@
#include "app/gfx/gl/gl_implementation.h"
#include "base/environment.h"
#include "base/message_loop.h"
-#include "base/metrics/field_trial.h"
#include "base/stringprintf.h"
#include "build/build_config.h"
#include "chrome/common/chrome_constants.h"
@@ -37,13 +36,8 @@
#include "gfx/gtk_util.h"
#endif
-// 1% per watchdog trial group.
-const int kFieldTrialSize = 1;
+const int kGpuTimeout = 10000;
-// 5 - 20 seconds timeout.
-const int kMinGpuTimeout = 5;
-const int kMaxGpuTimeout = 20;
-
namespace {
bool InitializeGpuSandbox() {
@@ -124,25 +118,12 @@
gpu_thread->Init(start_time);
gpu_process.set_main_thread(gpu_thread);
- // Only enable this experimental feaure for a subset of users.
- scoped_refptr<base::FieldTrial> watchdog_trial(
- new base::FieldTrial("GpuWatchdogTrial", 100));
- int watchdog_timeout = 0;
- for (int i = kMinGpuTimeout; i <= kMaxGpuTimeout; ++i) {
- int group = watchdog_trial->AppendGroup(StringPrintf("%dsecs", i),
- kFieldTrialSize);
- if (group == watchdog_trial->group()) {
- watchdog_timeout = i;
- break;
- }
- }
// In addition to disabling the watchdog if the command line switch is
// present, disable it in two other cases. OSMesa is expected to run very
// slowly. Also disable the watchdog on valgrind because the code is expected
// to run slowly in that case.
bool enable_watchdog =
- watchdog_timeout != 0 &&
!command_line.HasSwitch(switches::kDisableGpuWatchdog) &&
gfx::GetGLImplementation() != gfx::kGLImplementationOSMesaGL &&
!RunningOnValgrind();
@@ -153,11 +134,20 @@
enable_watchdog = false;
#endif
+ // Disable the watchdog for Windows. It tends to abort when the GPU process
+ // is not hung but still taking a long time to do something. Instead, the
+ // browser process displays a dialog when it notices that the child window
+ // is hung giving the user an opportunity to terminate it. This is the
+ // same mechanism used to abort hung plugins.
+#if defined(OS_WIN)
+ enable_watchdog = false;
+#endif
+
// Start the GPU watchdog only after anything that is expected to be time
// consuming has completed, otherwise the process is liable to be aborted.
scoped_refptr<GpuWatchdogThread> watchdog_thread;
if (enable_watchdog) {
- watchdog_thread = new GpuWatchdogThread(watchdog_timeout * 1000);
+ watchdog_thread = new GpuWatchdogThread(kGpuTimeout);
watchdog_thread->Start();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698