| 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 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 #if defined(USE_X11) | 46 #if defined(USE_X11) |
| 47 #include "ui/base/x/x11_util.h" | 47 #include "ui/base/x/x11_util.h" |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 #if defined(OS_LINUX) | 50 #if defined(OS_LINUX) |
| 51 #include "content/public/common/sandbox_init.h" | 51 #include "content/public/common/sandbox_init.h" |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 #if defined(ADDRESS_SANITIZER) |
| 55 #include <sanitizer/asan_interface.h> |
| 56 #endif |
| 57 |
| 54 const int kGpuTimeout = 10000; | 58 const int kGpuTimeout = 10000; |
| 55 | 59 |
| 56 namespace content { | 60 namespace content { |
| 57 | 61 |
| 58 namespace { | 62 namespace { |
| 59 | 63 |
| 60 bool WarmUpSandbox(const CommandLine& command_line); | 64 bool WarmUpSandbox(const CommandLine& command_line); |
| 61 #if defined(OS_LINUX) | 65 #if defined(OS_LINUX) |
| 62 bool StartSandboxLinux(const gpu::GPUInfo&, GpuWatchdogThread*, bool); | 66 bool StartSandboxLinux(const gpu::GPUInfo&, GpuWatchdogThread*, bool); |
| 63 #elif defined(OS_WIN) | 67 #elif defined(OS_WIN) |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 423 |
| 420 bool res = false; | 424 bool res = false; |
| 421 | 425 |
| 422 WarmUpSandboxNvidia(gpu_info, should_initialize_gl_context); | 426 WarmUpSandboxNvidia(gpu_info, should_initialize_gl_context); |
| 423 | 427 |
| 424 if (watchdog_thread) { | 428 if (watchdog_thread) { |
| 425 // LinuxSandbox needs to be able to ensure that the thread | 429 // LinuxSandbox needs to be able to ensure that the thread |
| 426 // has really been stopped. | 430 // has really been stopped. |
| 427 LinuxSandbox::StopThread(watchdog_thread); | 431 LinuxSandbox::StopThread(watchdog_thread); |
| 428 } | 432 } |
| 433 |
| 434 #if defined(ADDRESS_SANITIZER) |
| 435 LinuxSandbox* linux_sandbox = LinuxSandbox::GetInstance(); |
| 436 linux_sandbox->sanitizer_args()->coverage_sandboxed = 1; |
| 437 linux_sandbox->sanitizer_args()->coverage_fd = -1; |
| 438 linux_sandbox->sanitizer_args()->coverage_max_block_size = 0; |
| 439 #endif |
| 440 |
| 429 // LinuxSandbox::InitializeSandbox() must always be called | 441 // LinuxSandbox::InitializeSandbox() must always be called |
| 430 // with only one thread. | 442 // with only one thread. |
| 431 res = LinuxSandbox::InitializeSandbox(); | 443 res = LinuxSandbox::InitializeSandbox(); |
| 432 if (watchdog_thread) { | 444 if (watchdog_thread) { |
| 433 watchdog_thread->Start(); | 445 watchdog_thread->Start(); |
| 434 } | 446 } |
| 435 | 447 |
| 436 return res; | 448 return res; |
| 437 } | 449 } |
| 438 #endif // defined(OS_LINUX) | 450 #endif // defined(OS_LINUX) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 450 return true; | 462 return true; |
| 451 } | 463 } |
| 452 | 464 |
| 453 return false; | 465 return false; |
| 454 } | 466 } |
| 455 #endif // defined(OS_WIN) | 467 #endif // defined(OS_WIN) |
| 456 | 468 |
| 457 } // namespace. | 469 } // namespace. |
| 458 | 470 |
| 459 } // namespace content | 471 } // namespace content |
| OLD | NEW |