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" | |
14 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
15 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
16 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
17 #include "base/rand_util.h" | 16 #include "base/rand_util.h" |
18 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
20 #include "base/threading/platform_thread.h" | 19 #include "base/threading/platform_thread.h" |
21 #include "build/build_config.h" | 20 #include "build/build_config.h" |
22 #include "content/child/child_process.h" | 21 #include "content/child/child_process.h" |
23 #include "content/common/content_constants_internal.h" | 22 #include "content/common/content_constants_internal.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 205 |
207 // Start the GPU watchdog only after anything that is expected to be time | 206 // Start the GPU watchdog only after anything that is expected to be time |
208 // consuming has completed, otherwise the process is liable to be aborted. | 207 // consuming has completed, otherwise the process is liable to be aborted. |
209 if (enable_watchdog && !delayed_watchdog_enable) { | 208 if (enable_watchdog && !delayed_watchdog_enable) { |
210 watchdog_thread = new GpuWatchdogThread(kGpuTimeout); | 209 watchdog_thread = new GpuWatchdogThread(kGpuTimeout); |
211 base::Thread::Options options; | 210 base::Thread::Options options; |
212 options.timer_slack = base::TIMER_SLACK_MAXIMUM; | 211 options.timer_slack = base::TIMER_SLACK_MAXIMUM; |
213 watchdog_thread->StartWithOptions(options); | 212 watchdog_thread->StartWithOptions(options); |
214 } | 213 } |
215 | 214 |
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 | |
226 gpu::GPUInfo gpu_info; | 215 gpu::GPUInfo gpu_info; |
227 // Get vendor_id, device_id, driver_version from browser process through | 216 // Get vendor_id, device_id, driver_version from browser process through |
228 // commandline switches. | 217 // commandline switches. |
229 GetGpuInfoFromCommandLine(gpu_info, command_line); | 218 GetGpuInfoFromCommandLine(gpu_info, command_line); |
230 | 219 |
231 base::TimeDelta collect_context_time; | 220 base::TimeDelta collect_context_time; |
232 base::TimeDelta initialize_one_off_time; | 221 base::TimeDelta initialize_one_off_time; |
233 | 222 |
234 // Warm up resources that don't need access to GPUInfo. | 223 // Warm up resources that don't need access to GPUInfo. |
235 if (WarmUpSandbox(command_line)) { | 224 if (WarmUpSandbox(command_line)) { |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 return true; | 525 return true; |
537 } | 526 } |
538 | 527 |
539 return false; | 528 return false; |
540 } | 529 } |
541 #endif // defined(OS_WIN) | 530 #endif // defined(OS_WIN) |
542 | 531 |
543 } // namespace. | 532 } // namespace. |
544 | 533 |
545 } // namespace content | 534 } // namespace content |
OLD | NEW |