OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <dwmapi.h> | 8 #include <dwmapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
11 | 11 |
12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
| 13 #include "base/environment.h" |
13 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
14 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
15 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
16 #include "base/rand_util.h" | 17 #include "base/rand_util.h" |
17 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
19 #include "base/threading/platform_thread.h" | 20 #include "base/threading/platform_thread.h" |
20 #include "build/build_config.h" | 21 #include "build/build_config.h" |
21 #include "content/child/child_process.h" | 22 #include "content/child/child_process.h" |
22 #include "content/common/content_constants_internal.h" | 23 #include "content/common/content_constants_internal.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 206 |
206 // Start the GPU watchdog only after anything that is expected to be time | 207 // Start the GPU watchdog only after anything that is expected to be time |
207 // consuming has completed, otherwise the process is liable to be aborted. | 208 // consuming has completed, otherwise the process is liable to be aborted. |
208 if (enable_watchdog && !delayed_watchdog_enable) { | 209 if (enable_watchdog && !delayed_watchdog_enable) { |
209 watchdog_thread = new GpuWatchdogThread(kGpuTimeout); | 210 watchdog_thread = new GpuWatchdogThread(kGpuTimeout); |
210 base::Thread::Options options; | 211 base::Thread::Options options; |
211 options.timer_slack = base::TIMER_SLACK_MAXIMUM; | 212 options.timer_slack = base::TIMER_SLACK_MAXIMUM; |
212 watchdog_thread->StartWithOptions(options); | 213 watchdog_thread->StartWithOptions(options); |
213 } | 214 } |
214 | 215 |
| 216 // Temporarily disable DRI3 on desktop Linux. |
| 217 // The GPU process is crashing on DRI3-enabled desktop Linux systems. |
| 218 // TODO(jorgelo): remove this when crbug.com/415681 is fixed. |
| 219 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 220 { |
| 221 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 222 env->SetVar("LIBGL_DRI3_DISABLE", "1"); |
| 223 } |
| 224 #endif |
| 225 |
215 gpu::GPUInfo gpu_info; | 226 gpu::GPUInfo gpu_info; |
216 // Get vendor_id, device_id, driver_version from browser process through | 227 // Get vendor_id, device_id, driver_version from browser process through |
217 // commandline switches. | 228 // commandline switches. |
218 GetGpuInfoFromCommandLine(gpu_info, command_line); | 229 GetGpuInfoFromCommandLine(gpu_info, command_line); |
219 | 230 |
220 base::TimeDelta collect_context_time; | 231 base::TimeDelta collect_context_time; |
221 base::TimeDelta initialize_one_off_time; | 232 base::TimeDelta initialize_one_off_time; |
222 | 233 |
223 // Warm up resources that don't need access to GPUInfo. | 234 // Warm up resources that don't need access to GPUInfo. |
224 if (WarmUpSandbox(command_line)) { | 235 if (WarmUpSandbox(command_line)) { |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 return true; | 536 return true; |
526 } | 537 } |
527 | 538 |
528 return false; | 539 return false; |
529 } | 540 } |
530 #endif // defined(OS_WIN) | 541 #endif // defined(OS_WIN) |
531 | 542 |
532 } // namespace. | 543 } // namespace. |
533 | 544 |
534 } // namespace content | 545 } // namespace content |
OLD | NEW |