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

Side by Side Diff: components/crash/content/app/crashpad.cc

Issue 2909623002: Change DumpProcessWithoutCrash to use load-time dynamic linking (Closed)
Patch Set: forgot to update def file Created 3 years, 5 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 | « components/crash/content/app/crashpad.h ('k') | components/crash/content/app/crashpad_win.cc » ('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 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 CHECK_LE(message_start, string.size()); 83 CHECK_LE(message_start, string.size());
84 std::string message = base::StringPrintf("%s:%d: %s", file, line, 84 std::string message = base::StringPrintf("%s:%d: %s", file, line,
85 string.c_str() + message_start); 85 string.c_str() + message_start);
86 SetCrashKeyValue("LOG_FATAL", message); 86 SetCrashKeyValue("LOG_FATAL", message);
87 87
88 // Rather than including the code to force the crash here, allow the caller to 88 // Rather than including the code to force the crash here, allow the caller to
89 // do it. 89 // do it.
90 return false; 90 return false;
91 } 91 }
92 92
93 void DumpWithoutCrashing() {
94 CRASHPAD_SIMULATE_CRASH();
95 }
96
97 void InitializeCrashpadImpl(bool initial_client, 93 void InitializeCrashpadImpl(bool initial_client,
98 const std::string& process_type, 94 const std::string& process_type,
99 const std::string& user_data_dir, 95 const std::string& user_data_dir,
100 bool embedded_handler) { 96 bool embedded_handler) {
101 static bool initialized = false; 97 static bool initialized = false;
102 DCHECK(!initialized); 98 DCHECK(!initialized);
103 initialized = true; 99 initialized = true;
104 100
105 const bool browser_process = process_type.empty(); 101 const bool browser_process = process_type.empty();
106 CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); 102 CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 295 }
300 296
301 void RequestSingleCrashUpload(const std::string& local_id) { 297 void RequestSingleCrashUpload(const std::string& local_id) {
302 if (!g_database) 298 if (!g_database)
303 return; 299 return;
304 crashpad::UUID uuid; 300 crashpad::UUID uuid;
305 uuid.InitializeFromString(local_id); 301 uuid.InitializeFromString(local_id);
306 g_database->RequestUpload(uuid); 302 g_database->RequestUpload(uuid);
307 } 303 }
308 304
305 void DumpWithoutCrashing() {
306 CRASHPAD_SIMULATE_CRASH();
307 }
308
309 } // namespace crash_reporter 309 } // namespace crash_reporter
310 310
311 #if defined(OS_WIN) 311 #if defined(OS_WIN)
312 312
313 extern "C" { 313 extern "C" {
314 314
315 // This function is used in chrome_metrics_services_manager_client.cc to trigger 315 // This function is used in chrome_metrics_services_manager_client.cc to trigger
316 // changes to the upload-enabled state. This is done when the metrics services 316 // changes to the upload-enabled state. This is done when the metrics services
317 // are initialized, and when the user changes their consent for uploads. See 317 // are initialized, and when the user changes their consent for uploads. See
318 // crash_reporter::SetUploadConsent for effects. The given consent value should 318 // crash_reporter::SetUploadConsent for effects. The given consent value should
(...skipping 20 matching lines...) Expand all
339 339
340 // This helper is invoked by code in chrome.dll to request a single crash report 340 // This helper is invoked by code in chrome.dll to request a single crash report
341 // upload. See CrashUploadListCrashpad. 341 // upload. See CrashUploadListCrashpad.
342 void __declspec(dllexport) 342 void __declspec(dllexport)
343 RequestSingleCrashUploadImpl(const std::string& local_id) { 343 RequestSingleCrashUploadImpl(const std::string& local_id) {
344 crash_reporter::RequestSingleCrashUpload(local_id); 344 crash_reporter::RequestSingleCrashUpload(local_id);
345 } 345 }
346 } // extern "C" 346 } // extern "C"
347 347
348 #endif // OS_WIN 348 #endif // OS_WIN
OLDNEW
« no previous file with comments | « components/crash/content/app/crashpad.h ('k') | components/crash/content/app/crashpad_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698