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 scoped_ptr<base::Environment> env(base::Environment::Create()); | |
mdempsky
2014/11/07 06:40:33
nit: Since GpuMain() doesn't return, it might be w
Jorge Lucangeli Obes
2014/11/07 15:53:48
Done.
| |
221 env->SetVar("LIBGL_DRI3_DISABLE", "1"); | |
222 #endif | |
223 | |
215 gpu::GPUInfo gpu_info; | 224 gpu::GPUInfo gpu_info; |
216 // Get vendor_id, device_id, driver_version from browser process through | 225 // Get vendor_id, device_id, driver_version from browser process through |
217 // commandline switches. | 226 // commandline switches. |
218 GetGpuInfoFromCommandLine(gpu_info, command_line); | 227 GetGpuInfoFromCommandLine(gpu_info, command_line); |
219 | 228 |
220 base::TimeDelta collect_context_time; | 229 base::TimeDelta collect_context_time; |
221 base::TimeDelta initialize_one_off_time; | 230 base::TimeDelta initialize_one_off_time; |
222 | 231 |
223 // Warm up resources that don't need access to GPUInfo. | 232 // Warm up resources that don't need access to GPUInfo. |
224 if (WarmUpSandbox(command_line)) { | 233 if (WarmUpSandbox(command_line)) { |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
525 return true; | 534 return true; |
526 } | 535 } |
527 | 536 |
528 return false; | 537 return false; |
529 } | 538 } |
530 #endif // defined(OS_WIN) | 539 #endif // defined(OS_WIN) |
531 | 540 |
532 } // namespace. | 541 } // namespace. |
533 | 542 |
534 } // namespace content | 543 } // namespace content |
OLD | NEW |