| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "app/app_switches.h" | 7 #include "app/app_switches.h" |
| 8 #include "app/gfx/gl/gl_context.h" | 8 #include "app/gfx/gl/gl_context.h" |
| 9 #include "app/gfx/gl/gl_implementation.h" | 9 #include "app/gfx/gl/gl_implementation.h" |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 !command_line.HasSwitch(switches::kDisableGpuWatchdog) && | 124 !command_line.HasSwitch(switches::kDisableGpuWatchdog) && |
| 125 gfx::GetGLImplementation() != gfx::kGLImplementationOSMesaGL && | 125 gfx::GetGLImplementation() != gfx::kGLImplementationOSMesaGL && |
| 126 !RunningOnValgrind(); | 126 !RunningOnValgrind(); |
| 127 | 127 |
| 128 // Disable the watchdog in debug builds because they tend to only be run by | 128 // Disable the watchdog in debug builds because they tend to only be run by |
| 129 // developers who will not appreciate the watchdog killing the GPU process. | 129 // developers who will not appreciate the watchdog killing the GPU process. |
| 130 #ifndef NDEBUG | 130 #ifndef NDEBUG |
| 131 enable_watchdog = false; | 131 enable_watchdog = false; |
| 132 #endif | 132 #endif |
| 133 | 133 |
| 134 // TODO(apatrick): Disable for this commit. I want to enable this feature with | |
| 135 // a simple single file change that can easily be reverted if need be without | |
| 136 // losing all the other features of the patch. | |
| 137 #if 1 | |
| 138 enable_watchdog = false; | |
| 139 #endif | |
| 140 | |
| 141 scoped_refptr<GpuWatchdogThread> watchdog_thread; | 134 scoped_refptr<GpuWatchdogThread> watchdog_thread; |
| 142 if (enable_watchdog) { | 135 if (enable_watchdog) { |
| 143 watchdog_thread = new GpuWatchdogThread(MessageLoop::current(), | 136 watchdog_thread = new GpuWatchdogThread(MessageLoop::current(), |
| 144 watchdog_timeout * 1000); | 137 watchdog_timeout * 1000); |
| 145 watchdog_thread->Start(); | 138 watchdog_thread->Start(); |
| 146 } | 139 } |
| 147 | 140 |
| 148 // Do this immediately before running the message loop so the correct | 141 // Do this immediately before running the message loop so the correct |
| 149 // initialization time is recorded in the GPU info. | 142 // initialization time is recorded in the GPU info. |
| 150 gpu_thread->Init(start_time); | 143 gpu_thread->Init(start_time); |
| 151 | 144 |
| 152 main_message_loop.Run(); | 145 main_message_loop.Run(); |
| 153 | 146 |
| 154 if (enable_watchdog) | 147 if (enable_watchdog) |
| 155 watchdog_thread->Stop(); | 148 watchdog_thread->Stop(); |
| 156 | 149 |
| 157 return 0; | 150 return 0; |
| 158 } | 151 } |
| OLD | NEW |