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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Disable the watchdog in debug builds because they tend to only be run by | 123 // Disable the watchdog in debug builds because they tend to only be run by |
124 // developers who will not appreciate the watchdog killing the GPU process. | 124 // developers who will not appreciate the watchdog killing the GPU process. |
125 #ifndef NDEBUG | 125 #ifndef NDEBUG |
126 enable_watchdog = false; | 126 enable_watchdog = false; |
127 #endif | 127 #endif |
128 | 128 |
129 // Start the GPU watchdog only after anything that is expected to be time | 129 // Start the GPU watchdog only after anything that is expected to be time |
130 // consuming has completed, otherwise the process is liable to be aborted. | 130 // consuming has completed, otherwise the process is liable to be aborted. |
131 scoped_refptr<GpuWatchdogThread> watchdog_thread; | 131 scoped_refptr<GpuWatchdogThread> watchdog_thread; |
132 if (enable_watchdog) { | 132 if (enable_watchdog) { |
133 watchdog_thread = new GpuWatchdogThread(MessageLoop::current(), | 133 watchdog_thread = new GpuWatchdogThread(watchdog_timeout * 1000); |
134 watchdog_timeout * 1000); | |
135 watchdog_thread->Start(); | 134 watchdog_thread->Start(); |
136 } | 135 } |
137 | 136 |
138 main_message_loop.Run(); | 137 main_message_loop.Run(); |
139 | 138 |
140 if (enable_watchdog) | 139 if (enable_watchdog) |
141 watchdog_thread->Stop(); | 140 watchdog_thread->Stop(); |
142 | 141 |
143 return 0; | 142 return 0; |
144 } | 143 } |
OLD | NEW |