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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 514 |
515 #if defined(OS_WIN) | 515 #if defined(OS_WIN) |
516 bool StartSandboxWindows(const sandbox::SandboxInterfaceInfo* sandbox_info) { | 516 bool StartSandboxWindows(const sandbox::SandboxInterfaceInfo* sandbox_info) { |
517 TRACE_EVENT0("gpu", "Lower token"); | 517 TRACE_EVENT0("gpu", "Lower token"); |
518 | 518 |
519 // For Windows, if the target_services interface is not zero, the process | 519 // For Windows, if the target_services interface is not zero, the process |
520 // is sandboxed and we must call LowerToken() before rendering untrusted | 520 // is sandboxed and we must call LowerToken() before rendering untrusted |
521 // content. | 521 // content. |
522 sandbox::TargetServices* target_services = sandbox_info->target_services; | 522 sandbox::TargetServices* target_services = sandbox_info->target_services; |
523 if (target_services) { | 523 if (target_services) { |
| 524 #if defined(ADDRESS_SANITIZER) |
| 525 // Bind and leak dbghelp.dll before the token is lowered, otherwise |
| 526 // AddressSanitizer will crash when trying to symbolize a report. |
| 527 if (!LoadLibraryA("dbghelp.dll")) |
| 528 return false; |
| 529 #endif |
| 530 |
524 target_services->LowerToken(); | 531 target_services->LowerToken(); |
525 return true; | 532 return true; |
526 } | 533 } |
527 | 534 |
528 return false; | 535 return false; |
529 } | 536 } |
530 #endif // defined(OS_WIN) | 537 #endif // defined(OS_WIN) |
531 | 538 |
532 } // namespace. | 539 } // namespace. |
533 | 540 |
534 } // namespace content | 541 } // namespace content |
OLD | NEW |