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 "content/renderer/renderer_main_platform_delegate.h" | 5 #include "content/renderer/renderer_main_platform_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 parameters_.sandbox_info->target_services; | 102 parameters_.sandbox_info->target_services; |
103 | 103 |
104 if (target_services) { | 104 if (target_services) { |
105 // Cause advapi32 to load before the sandbox is turned on. | 105 // Cause advapi32 to load before the sandbox is turned on. |
106 unsigned int dummy_rand; | 106 unsigned int dummy_rand; |
107 rand_s(&dummy_rand); | 107 rand_s(&dummy_rand); |
108 // Warm up language subsystems before the sandbox is turned on. | 108 // Warm up language subsystems before the sandbox is turned on. |
109 ::GetUserDefaultLangID(); | 109 ::GetUserDefaultLangID(); |
110 ::GetUserDefaultLCID(); | 110 ::GetUserDefaultLCID(); |
111 | 111 |
| 112 #if defined(ADDRESS_SANITIZER) |
| 113 // Bind and leak dbghelp.dll before the token is lowered, otherwise |
| 114 // AddressSanitizer will crash when trying to symbolize a report. |
| 115 if (!LoadLibraryA("dbghelp.dll")) |
| 116 return false; |
| 117 #endif |
| 118 |
112 target_services->LowerToken(); | 119 target_services->LowerToken(); |
113 return true; | 120 return true; |
114 } | 121 } |
115 return false; | 122 return false; |
116 } | 123 } |
117 | 124 |
118 } // namespace content | 125 } // namespace content |
OLD | NEW |