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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(OS_MACOSX) | 54 #if defined(OS_MACOSX) |
55 #include "base/message_loop/message_pump_mac.h" | 55 #include "base/message_loop/message_pump_mac.h" |
56 #endif | 56 #endif |
57 | 57 |
| 58 #if defined(ADDRESS_SANITIZER) |
| 59 #include <sanitizer/asan_interface.h> |
| 60 #endif |
| 61 |
58 const int kGpuTimeout = 10000; | 62 const int kGpuTimeout = 10000; |
59 | 63 |
60 namespace content { | 64 namespace content { |
61 | 65 |
62 namespace { | 66 namespace { |
63 | 67 |
64 bool WarmUpSandbox(const CommandLine& command_line); | 68 bool WarmUpSandbox(const CommandLine& command_line); |
65 #if defined(OS_LINUX) | 69 #if defined(OS_LINUX) |
66 bool StartSandboxLinux(const gpu::GPUInfo&, GpuWatchdogThread*, bool); | 70 bool StartSandboxLinux(const gpu::GPUInfo&, GpuWatchdogThread*, bool); |
67 #elif defined(OS_WIN) | 71 #elif defined(OS_WIN) |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 434 |
431 bool res = false; | 435 bool res = false; |
432 | 436 |
433 WarmUpSandboxNvidia(gpu_info, should_initialize_gl_context); | 437 WarmUpSandboxNvidia(gpu_info, should_initialize_gl_context); |
434 | 438 |
435 if (watchdog_thread) { | 439 if (watchdog_thread) { |
436 // LinuxSandbox needs to be able to ensure that the thread | 440 // LinuxSandbox needs to be able to ensure that the thread |
437 // has really been stopped. | 441 // has really been stopped. |
438 LinuxSandbox::StopThread(watchdog_thread); | 442 LinuxSandbox::StopThread(watchdog_thread); |
439 } | 443 } |
| 444 |
| 445 #if defined(ADDRESS_SANITIZER) |
| 446 LinuxSandbox* linux_sandbox = LinuxSandbox::GetInstance(); |
| 447 linux_sandbox->sanitizer_args()->coverage_sandboxed = 1; |
| 448 linux_sandbox->sanitizer_args()->coverage_fd = -1; |
| 449 linux_sandbox->sanitizer_args()->coverage_max_block_size = 0; |
| 450 #endif |
| 451 |
440 // LinuxSandbox::InitializeSandbox() must always be called | 452 // LinuxSandbox::InitializeSandbox() must always be called |
441 // with only one thread. | 453 // with only one thread. |
442 res = LinuxSandbox::InitializeSandbox(); | 454 res = LinuxSandbox::InitializeSandbox(); |
443 if (watchdog_thread) { | 455 if (watchdog_thread) { |
444 watchdog_thread->Start(); | 456 watchdog_thread->Start(); |
445 } | 457 } |
446 | 458 |
447 return res; | 459 return res; |
448 } | 460 } |
449 #endif // defined(OS_LINUX) | 461 #endif // defined(OS_LINUX) |
(...skipping 11 matching lines...) Expand all Loading... |
461 return true; | 473 return true; |
462 } | 474 } |
463 | 475 |
464 return false; | 476 return false; |
465 } | 477 } |
466 #endif // defined(OS_WIN) | 478 #endif // defined(OS_WIN) |
467 | 479 |
468 } // namespace. | 480 } // namespace. |
469 | 481 |
470 } // namespace content | 482 } // namespace content |
OLD | NEW |