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

Side by Side Diff: chrome_elf/chrome_elf_main.cc

Issue 2250263002: Fix ASAN canary crashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ananta and scottmg to owners for main_loader_dll_win.cc and chrome_crash_reporter_client_win.cc Created 4 years, 4 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
« no previous file with comments | « chrome/installer/setup/BUILD.gn ('k') | components/crash/content/app/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome_elf/chrome_elf_main.h" 5 #include "chrome_elf/chrome_elf_main.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
103 // This helper is invoked by debugging code in chrome to register the client 103 // This helper is invoked by debugging code in chrome to register the client
104 // id. 104 // id.
105 extern "C" __declspec(dllexport) void SetMetricsClientId( 105 extern "C" __declspec(dllexport) void SetMetricsClientId(
106 const char* client_id) { 106 const char* client_id) {
107 if (client_id) 107 if (client_id)
108 crash_keys::SetMetricsClientIdFromGUID(client_id); 108 crash_keys::SetMetricsClientIdFromGUID(client_id);
109 } 109 }
110 110
111 // This helper is invoked by chrome to read upload settings.
112 extern "C" __declspec(dllexport) bool GetUploadsEnabled() {
113 return crash_reporter::GetUploadsEnabled();
114 }
115
111 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { 116 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
112 if (reason == DLL_PROCESS_ATTACH) { 117 if (reason == DLL_PROCESS_ATTACH) {
113 InitializeCrashReportingForProcess(); 118 InitializeCrashReportingForProcess();
114 // CRT on initialization installs an exception filter which calls 119 // CRT on initialization installs an exception filter which calls
115 // TerminateProcess. We need to hook CRT's attempt to set an exception 120 // TerminateProcess. We need to hook CRT's attempt to set an exception
116 // handler and ignore it. Don't do this when ASan is present, or ASan will 121 // handler and ignore it. Don't do this when ASan is present, or ASan will
117 // fail to install its own unhandled exception filter. 122 // fail to install its own unhandled exception filter.
118 #if !defined(ADDRESS_SANITIZER) 123 #if !defined(ADDRESS_SANITIZER)
119 DisableSetUnhandledExceptionFilter(); 124 DisableSetUnhandledExceptionFilter();
120 #endif 125 #endif
121 126
122 install_static::InitializeProcessType(); 127 install_static::InitializeProcessType();
123 128
124 __try { 129 __try {
125 blacklist::Initialize(false); // Don't force, abort if beacon is present. 130 blacklist::Initialize(false); // Don't force, abort if beacon is present.
126 } __except(GenerateCrashDump(GetExceptionInformation())) { 131 } __except(GenerateCrashDump(GetExceptionInformation())) {
127 } 132 }
128 } 133 }
129 return TRUE; 134 return TRUE;
130 } 135 }
OLDNEW
« no previous file with comments | « chrome/installer/setup/BUILD.gn ('k') | components/crash/content/app/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698