| OLD | NEW |
| 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 Loading... |
| 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 | |
| 116 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { | 111 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { |
| 117 if (reason == DLL_PROCESS_ATTACH) { | 112 if (reason == DLL_PROCESS_ATTACH) { |
| 118 InitializeCrashReportingForProcess(); | 113 InitializeCrashReportingForProcess(); |
| 119 // CRT on initialization installs an exception filter which calls | 114 // CRT on initialization installs an exception filter which calls |
| 120 // TerminateProcess. We need to hook CRT's attempt to set an exception | 115 // TerminateProcess. We need to hook CRT's attempt to set an exception |
| 121 // handler and ignore it. Don't do this when ASan is present, or ASan will | 116 // handler and ignore it. Don't do this when ASan is present, or ASan will |
| 122 // fail to install its own unhandled exception filter. | 117 // fail to install its own unhandled exception filter. |
| 123 #if !defined(ADDRESS_SANITIZER) | 118 #if !defined(ADDRESS_SANITIZER) |
| 124 DisableSetUnhandledExceptionFilter(); | 119 DisableSetUnhandledExceptionFilter(); |
| 125 #endif | 120 #endif |
| 126 | 121 |
| 127 install_static::InitializeProcessType(); | 122 install_static::InitializeProcessType(); |
| 128 | 123 |
| 129 __try { | 124 __try { |
| 130 blacklist::Initialize(false); // Don't force, abort if beacon is present. | 125 blacklist::Initialize(false); // Don't force, abort if beacon is present. |
| 131 } __except(GenerateCrashDump(GetExceptionInformation())) { | 126 } __except(GenerateCrashDump(GetExceptionInformation())) { |
| 132 } | 127 } |
| 133 } | 128 } |
| 134 return TRUE; | 129 return TRUE; |
| 135 } | 130 } |
| OLD | NEW |