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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 void RendererMainPlatformDelegate::PlatformUninitialize() { | 104 void RendererMainPlatformDelegate::PlatformUninitialize() { |
105 } | 105 } |
106 | 106 |
107 bool RendererMainPlatformDelegate::EnableSandbox() { | 107 bool RendererMainPlatformDelegate::EnableSandbox() { |
108 sandbox::TargetServices* target_services = | 108 sandbox::TargetServices* target_services = |
109 parameters_.sandbox_info->target_services; | 109 parameters_.sandbox_info->target_services; |
110 | 110 |
111 if (target_services) { | 111 if (target_services) { |
112 // Cause advapi32 to load before the sandbox is turned on. | 112 // Cause advapi32 to load before the sandbox is turned on. |
113 unsigned int dummy_rand; | 113 unsigned int dummy_rand; |
114 rand_s(&dummy_rand); | 114 rand_s(&dummy_rand); |
Timur Iskhodzhanov
2015/02/03 13:25:22
ditto
| |
115 // Warm up language subsystems before the sandbox is turned on. | 115 // Warm up language subsystems before the sandbox is turned on. |
116 ::GetUserDefaultLangID(); | 116 ::GetUserDefaultLangID(); |
117 ::GetUserDefaultLCID(); | 117 ::GetUserDefaultLCID(); |
118 | 118 |
119 #if defined(ADDRESS_SANITIZER) | |
120 // Bind and leak dbghelp.dll before the token is lowered, otherwise | |
121 // AddressSanitizer will crash when trying to symbolize a report. | |
122 if (!LoadLibraryA("dbghelp.dll")) | |
123 return false; | |
124 #endif | |
125 | |
119 target_services->LowerToken(); | 126 target_services->LowerToken(); |
120 return true; | 127 return true; |
121 } | 128 } |
122 return false; | 129 return false; |
123 } | 130 } |
124 | 131 |
125 } // namespace content | 132 } // namespace content |
OLD | NEW |