| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/crash/content/app/crashpad.h" | 5 #include "components/crash/content/app/crashpad.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 InitializeCrashpadImpl(initial_client, process_type, false); | 197 InitializeCrashpadImpl(initial_client, process_type, false); |
| 198 } | 198 } |
| 199 | 199 |
| 200 #if defined(OS_WIN) | 200 #if defined(OS_WIN) |
| 201 void InitializeCrashpadWithEmbeddedHandler(bool initial_client, | 201 void InitializeCrashpadWithEmbeddedHandler(bool initial_client, |
| 202 const std::string& process_type) { | 202 const std::string& process_type) { |
| 203 InitializeCrashpadImpl(initial_client, process_type, true); | 203 InitializeCrashpadImpl(initial_client, process_type, true); |
| 204 } | 204 } |
| 205 #endif // OS_WIN | 205 #endif // OS_WIN |
| 206 | 206 |
| 207 crashpad::CrashpadClient& GetCrashpadClient() { |
| 208 static crashpad::CrashpadClient* const client = |
| 209 new crashpad::CrashpadClient(); |
| 210 return *client; |
| 211 } |
| 212 |
| 207 void SetUploadConsent(bool consent) { | 213 void SetUploadConsent(bool consent) { |
| 208 if (!g_database) | 214 if (!g_database) |
| 209 return; | 215 return; |
| 210 | 216 |
| 211 bool enable_uploads = false; | 217 bool enable_uploads = false; |
| 212 CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); | 218 CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); |
| 213 if (!crash_reporter_client->ReportingIsEnforcedByPolicy(&enable_uploads)) { | 219 if (!crash_reporter_client->ReportingIsEnforcedByPolicy(&enable_uploads)) { |
| 214 // Breakpad provided a --disable-breakpad switch to disable crash dumping | 220 // Breakpad provided a --disable-breakpad switch to disable crash dumping |
| 215 // (not just uploading) here. Crashpad doesn't need it: dumping is enabled | 221 // (not just uploading) here. Crashpad doesn't need it: dumping is enabled |
| 216 // unconditionally and uploading is gated on consent, which tests/bots | 222 // unconditionally and uploading is gated on consent, which tests/bots |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 337 |
| 332 // This helper is invoked by code in chrome.dll to request a single crash report | 338 // This helper is invoked by code in chrome.dll to request a single crash report |
| 333 // upload. See CrashUploadListCrashpad. | 339 // upload. See CrashUploadListCrashpad. |
| 334 void __declspec(dllexport) | 340 void __declspec(dllexport) |
| 335 RequestSingleCrashUploadImpl(const std::string& local_id) { | 341 RequestSingleCrashUploadImpl(const std::string& local_id) { |
| 336 crash_reporter::RequestSingleCrashUpload(local_id); | 342 crash_reporter::RequestSingleCrashUpload(local_id); |
| 337 } | 343 } |
| 338 } // extern "C" | 344 } // extern "C" |
| 339 | 345 |
| 340 #endif // OS_WIN | 346 #endif // OS_WIN |
| OLD | NEW |