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

Side by Side Diff: chrome_elf/chrome_elf_main.cc

Issue 2909623002: Change DumpProcessWithoutCrash to use load-time dynamic linking (Closed)
Patch Set: rebase Created 3 years, 6 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 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 <assert.h> 7 #include <assert.h>
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include "chrome/install_static/install_details.h" 10 #include "chrome/install_static/install_details.h"
(...skipping 11 matching lines...) Expand all
22 #ifdef _DEBUG 22 #ifdef _DEBUG
23 assert(false); 23 assert(false);
24 #endif // _DEBUG 24 #endif // _DEBUG
25 } 25 }
26 } 26 }
27 27
28 void SignalChromeElf() { 28 void SignalChromeElf() {
29 blacklist::ResetBeacon(); 29 blacklist::ResetBeacon();
30 } 30 }
31 31
32 void (*GetDumpWithoutCrashingFunction())() {
33 return elf_crash::GetDumpWithoutCrashingFunction();
scottmg 2017/06/15 23:08:47 And chrome_main is calling this one right?
Will Harris 2017/06/15 23:37:24 yes, in chrome_elf via dynamic linkage.
34 }
35
32 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { 36 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
33 if (reason == DLL_PROCESS_ATTACH) { 37 if (reason == DLL_PROCESS_ATTACH) {
34 install_static::InitializeProductDetailsForPrimaryModule(); 38 install_static::InitializeProductDetailsForPrimaryModule();
35 39
36 // CRT on initialization installs an exception filter which calls 40 // CRT on initialization installs an exception filter which calls
37 // TerminateProcess. We need to hook CRT's attempt to set an exception. 41 // TerminateProcess. We need to hook CRT's attempt to set an exception.
38 elf_crash::DisableSetUnhandledExceptionFilter(); 42 elf_crash::DisableSetUnhandledExceptionFilter();
39 43
40 __try { 44 __try {
41 blacklist::Initialize(false); // Don't force, abort if beacon is present. 45 blacklist::Initialize(false); // Don't force, abort if beacon is present.
42 } __except (elf_crash::GenerateCrashDump(GetExceptionInformation())) { 46 } __except (elf_crash::GenerateCrashDump(GetExceptionInformation())) {
43 } 47 }
44 } else if (reason == DLL_PROCESS_DETACH) { 48 } else if (reason == DLL_PROCESS_DETACH) {
45 elf_crash::ShutdownCrashReporting(); 49 elf_crash::ShutdownCrashReporting();
46 } 50 }
47 return TRUE; 51 return TRUE;
48 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698