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

Side by Side Diff: content/utility/utility_main.cc

Issue 868253011: Make chrome.exe built with ASan/Win work with sandbox enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the LoadLibrary calls to client code Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/debug/leak_annotations.h" 6 #include "base/debug/leak_annotations.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "base/timer/hi_res_timer_manager.h" 9 #include "base/timer/hi_res_timer_manager.h"
10 #include "content/child/child_process.h" 10 #include "content/child/child_process.h"
(...skipping 28 matching lines...) Expand all
39 39
40 base::HighResolutionTimerManager hi_res_timer_manager; 40 base::HighResolutionTimerManager hi_res_timer_manager;
41 41
42 #if defined(OS_WIN) 42 #if defined(OS_WIN)
43 bool no_sandbox = parameters.command_line.HasSwitch(switches::kNoSandbox); 43 bool no_sandbox = parameters.command_line.HasSwitch(switches::kNoSandbox);
44 if (!no_sandbox) { 44 if (!no_sandbox) {
45 sandbox::TargetServices* target_services = 45 sandbox::TargetServices* target_services =
46 parameters.sandbox_info->target_services; 46 parameters.sandbox_info->target_services;
47 if (!target_services) 47 if (!target_services)
48 return false; 48 return false;
49 #if defined(ADDRESS_SANITIZER)
50 // Bind and leak dbghelp.dll before the token is lowered, otherwise
51 // AddressSanitizer will crash when trying to symbolize a report.
52 if (!LoadLibraryA("dbghelp.dll"))
53 return false;
54 #endif
49 target_services->LowerToken(); 55 target_services->LowerToken();
50 } 56 }
51 #endif 57 #endif
52 58
53 base::MessageLoop::current()->Run(); 59 base::MessageLoop::current()->Run();
54 60
55 #if defined(LEAK_SANITIZER) 61 #if defined(LEAK_SANITIZER)
56 // Invoke LeakSanitizer before shutting down the utility thread, to avoid 62 // Invoke LeakSanitizer before shutting down the utility thread, to avoid
57 // reporting shutdown-only leaks. 63 // reporting shutdown-only leaks.
58 __lsan_do_leak_check(); 64 __lsan_do_leak_check();
59 #endif 65 #endif
60 66
61 return 0; 67 return 0;
62 } 68 }
63 69
64 } // namespace content 70 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698