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 |
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 } |
OLD | NEW |