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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 #if defined(OS_LINUX) | 52 #if defined(OS_LINUX) |
53 #include "content/public/common/sandbox_init.h" | 53 #include "content/public/common/sandbox_init.h" |
54 #endif | 54 #endif |
55 | 55 |
56 #if defined(OS_MACOSX) | 56 #if defined(OS_MACOSX) |
57 #include "base/message_loop/message_pump_mac.h" | 57 #include "base/message_loop/message_pump_mac.h" |
58 #include "content/common/sandbox_mac.h" | 58 #include "content/common/sandbox_mac.h" |
59 #endif | 59 #endif |
60 | 60 |
61 #if defined(ADDRESS_SANITIZER) | 61 #if defined(SANITIZER_COVERAGE) |
62 #include <sanitizer/asan_interface.h> | 62 #include <sanitizer/common_interface_defs.h> |
63 #endif | 63 #endif |
64 | 64 |
65 const int kGpuTimeout = 10000; | 65 const int kGpuTimeout = 10000; |
66 | 66 |
67 namespace content { | 67 namespace content { |
68 | 68 |
69 namespace { | 69 namespace { |
70 | 70 |
71 void GetGpuInfoFromCommandLine(gpu::GPUInfo& gpu_info, | 71 void GetGpuInfoFromCommandLine(gpu::GPUInfo& gpu_info, |
72 const base::CommandLine& command_line); | 72 const base::CommandLine& command_line); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 bool res = false; | 482 bool res = false; |
483 | 483 |
484 WarmUpSandboxNvidia(gpu_info, should_initialize_gl_context); | 484 WarmUpSandboxNvidia(gpu_info, should_initialize_gl_context); |
485 | 485 |
486 if (watchdog_thread) { | 486 if (watchdog_thread) { |
487 // LinuxSandbox needs to be able to ensure that the thread | 487 // LinuxSandbox needs to be able to ensure that the thread |
488 // has really been stopped. | 488 // has really been stopped. |
489 LinuxSandbox::StopThread(watchdog_thread); | 489 LinuxSandbox::StopThread(watchdog_thread); |
490 } | 490 } |
491 | 491 |
492 #if defined(ADDRESS_SANITIZER) | 492 #if defined(SANITIZER_COVERAGE) |
493 const std::string sancov_file_name = | 493 const std::string sancov_file_name = |
494 "gpu." + base::Uint64ToString(base::RandUint64()); | 494 "gpu." + base::Uint64ToString(base::RandUint64()); |
495 LinuxSandbox* linux_sandbox = LinuxSandbox::GetInstance(); | 495 LinuxSandbox* linux_sandbox = LinuxSandbox::GetInstance(); |
496 linux_sandbox->sanitizer_args()->coverage_sandboxed = 1; | 496 linux_sandbox->sanitizer_args()->coverage_sandboxed = 1; |
497 linux_sandbox->sanitizer_args()->coverage_fd = | 497 linux_sandbox->sanitizer_args()->coverage_fd = |
498 __sanitizer_maybe_open_cov_file(sancov_file_name.c_str()); | 498 __sanitizer_maybe_open_cov_file(sancov_file_name.c_str()); |
499 linux_sandbox->sanitizer_args()->coverage_max_block_size = 0; | 499 linux_sandbox->sanitizer_args()->coverage_max_block_size = 0; |
500 #endif | 500 #endif |
501 | 501 |
502 // LinuxSandbox::InitializeSandbox() must always be called | 502 // LinuxSandbox::InitializeSandbox() must always be called |
(...skipping 29 matching lines...) Expand all Loading... |
532 return true; | 532 return true; |
533 } | 533 } |
534 | 534 |
535 return false; | 535 return false; |
536 } | 536 } |
537 #endif // defined(OS_WIN) | 537 #endif // defined(OS_WIN) |
538 | 538 |
539 } // namespace. | 539 } // namespace. |
540 | 540 |
541 } // namespace content | 541 } // namespace content |
OLD | NEW |