Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: content/gpu/gpu_main.cc

Issue 280303002: Add sandbox support for AsanCoverage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: helper exits on 0 bytes received, zygote waits on it Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #endif 49 #endif
50 50
51 #if defined(OS_LINUX) 51 #if defined(OS_LINUX)
52 #include "content/public/common/sandbox_init.h" 52 #include "content/public/common/sandbox_init.h"
53 #endif 53 #endif
54 54
55 #if defined(OS_MACOSX) 55 #if defined(OS_MACOSX)
56 #include "base/message_loop/message_pump_mac.h" 56 #include "base/message_loop/message_pump_mac.h"
57 #endif 57 #endif
58 58
59 #if defined(ADDRESS_SANITIZER)
60 #include <sanitizer/asan_interface.h>
61 #endif
62
59 const int kGpuTimeout = 10000; 63 const int kGpuTimeout = 10000;
60 64
61 namespace content { 65 namespace content {
62 66
63 namespace { 67 namespace {
64 68
65 bool WarmUpSandbox(const CommandLine& command_line); 69 bool WarmUpSandbox(const CommandLine& command_line);
66 #if defined(OS_LINUX) 70 #if defined(OS_LINUX)
67 bool StartSandboxLinux(const gpu::GPUInfo&, GpuWatchdogThread*, bool); 71 bool StartSandboxLinux(const gpu::GPUInfo&, GpuWatchdogThread*, bool);
68 #elif defined(OS_WIN) 72 #elif defined(OS_WIN)
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 441
438 bool res = false; 442 bool res = false;
439 443
440 WarmUpSandboxNvidia(gpu_info, should_initialize_gl_context); 444 WarmUpSandboxNvidia(gpu_info, should_initialize_gl_context);
441 445
442 if (watchdog_thread) { 446 if (watchdog_thread) {
443 // LinuxSandbox needs to be able to ensure that the thread 447 // LinuxSandbox needs to be able to ensure that the thread
444 // has really been stopped. 448 // has really been stopped.
445 LinuxSandbox::StopThread(watchdog_thread); 449 LinuxSandbox::StopThread(watchdog_thread);
446 } 450 }
451
452 #if defined(ADDRESS_SANITIZER)
453 LinuxSandbox* linux_sandbox = LinuxSandbox::GetInstance();
454 linux_sandbox->sanitizer_args()->coverage_sandboxed = 1;
455 linux_sandbox->sanitizer_args()->coverage_fd = -1;
456 linux_sandbox->sanitizer_args()->coverage_max_block_size = 0;
457 #endif
458
447 // LinuxSandbox::InitializeSandbox() must always be called 459 // LinuxSandbox::InitializeSandbox() must always be called
448 // with only one thread. 460 // with only one thread.
449 res = LinuxSandbox::InitializeSandbox(); 461 res = LinuxSandbox::InitializeSandbox();
450 if (watchdog_thread) { 462 if (watchdog_thread) {
451 watchdog_thread->Start(); 463 watchdog_thread->Start();
452 } 464 }
453 465
454 return res; 466 return res;
455 } 467 }
456 #endif // defined(OS_LINUX) 468 #endif // defined(OS_LINUX)
(...skipping 11 matching lines...) Expand all
468 return true; 480 return true;
469 } 481 }
470 482
471 return false; 483 return false;
472 } 484 }
473 #endif // defined(OS_WIN) 485 #endif // defined(OS_WIN)
474 486
475 } // namespace. 487 } // namespace.
476 488
477 } // namespace content 489 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698