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

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

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix installation_validator_unittest Created 4 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 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 #if BUILDFLAG(ENABLE_KASKO) 10 #if BUILDFLAG(ENABLE_KASKO)
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 #endif 192 #endif
193 193
194 SetCrashKeyValue("ptype", browser_process ? base::StringPiece("browser") 194 SetCrashKeyValue("ptype", browser_process ? base::StringPiece("browser")
195 : base::StringPiece(process_type)); 195 : base::StringPiece(process_type));
196 #if defined(OS_POSIX) 196 #if defined(OS_POSIX)
197 SetCrashKeyValue("pid", base::IntToString(getpid())); 197 SetCrashKeyValue("pid", base::IntToString(getpid()));
198 #elif defined(OS_WIN) 198 #elif defined(OS_WIN)
199 SetCrashKeyValue("pid", base::IntToString(::GetCurrentProcessId())); 199 SetCrashKeyValue("pid", base::IntToString(::GetCurrentProcessId()));
200 #endif 200 #endif
201 201
202 logging::SetLogMessageHandler(LogMessageHandler); 202 logging::PushLogMessageHandler(LogMessageHandler);
203 203
204 // If clients called CRASHPAD_SIMULATE_CRASH() instead of 204 // If clients called CRASHPAD_SIMULATE_CRASH() instead of
205 // base::debug::DumpWithoutCrashing(), these dumps would appear as crashes in 205 // base::debug::DumpWithoutCrashing(), these dumps would appear as crashes in
206 // the correct function, at the correct file and line. This would be 206 // the correct function, at the correct file and line. This would be
207 // preferable to having all occurrences show up in DumpWithoutCrashing() at 207 // preferable to having all occurrences show up in DumpWithoutCrashing() at
208 // the same file and line. 208 // the same file and line.
209 base::debug::SetDumpWithoutCrashingFunction(DumpWithoutCrashing); 209 base::debug::SetDumpWithoutCrashingFunction(DumpWithoutCrashing);
210 210
211 #if defined(OS_MACOSX) 211 #if defined(OS_MACOSX)
212 // On Mac, we only want the browser to initialize the database, but not the 212 // On Mac, we only want the browser to initialize the database, but not the
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 base::UTF16ToUTF8(value)); 405 base::UTF16ToUTF8(value));
406 } 406 }
407 407
408 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) { 408 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) {
409 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key)); 409 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key));
410 } 410 }
411 411
412 } // extern "C" 412 } // extern "C"
413 413
414 #endif // OS_WIN 414 #endif // OS_WIN
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698