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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 #if defined(OS_WIN) | 534 #if defined(OS_WIN) |
535 bool StartSandboxWindows(const sandbox::SandboxInterfaceInfo* sandbox_info) { | 535 bool StartSandboxWindows(const sandbox::SandboxInterfaceInfo* sandbox_info) { |
536 TRACE_EVENT0("gpu", "Lower token"); | 536 TRACE_EVENT0("gpu", "Lower token"); |
537 | 537 |
538 // For Windows, if the target_services interface is not zero, the process | 538 // For Windows, if the target_services interface is not zero, the process |
539 // is sandboxed and we must call LowerToken() before rendering untrusted | 539 // is sandboxed and we must call LowerToken() before rendering untrusted |
540 // content. | 540 // content. |
541 sandbox::TargetServices* target_services = sandbox_info->target_services; | 541 sandbox::TargetServices* target_services = sandbox_info->target_services; |
542 if (target_services) { | 542 if (target_services) { |
543 #if defined(ADDRESS_SANITIZER) | |
544 // Bind and leak dbghelp.dll before the token is lowered, otherwise | |
545 // AddressSanitizer will crash when trying to symbolize a report. | |
546 if (!LoadLibraryA("dbghelp.dll")) | |
547 return false; | |
548 #endif | |
549 | |
550 target_services->LowerToken(); | 543 target_services->LowerToken(); |
551 return true; | 544 return true; |
552 } | 545 } |
553 | 546 |
554 return false; | 547 return false; |
555 } | 548 } |
556 #endif // defined(OS_WIN) | 549 #endif // defined(OS_WIN) |
557 | 550 |
558 } // namespace. | 551 } // namespace. |
559 | 552 |
560 } // namespace content | 553 } // namespace content |
OLD | NEW |