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

Side by Side Diff: components/crash/content/app/breakpad_mac.mm

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up, MockLog uses listener Created 4 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
OLDNEW
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 #import "components/crash/content/app/breakpad_mac.h" 5 #import "components/crash/content/app/breakpad_mac.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueImpl, 257 base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueImpl,
258 &ClearCrashKeyValueImpl); 258 &ClearCrashKeyValueImpl);
259 GetCrashReporterClient()->RegisterCrashKeys(); 259 GetCrashReporterClient()->RegisterCrashKeys();
260 260
261 // Set Breakpad metadata values. These values are added to Info.plist during 261 // Set Breakpad metadata values. These values are added to Info.plist during
262 // the branded Google Chrome.app build. 262 // the branded Google Chrome.app build.
263 SetCrashKeyValue(@"ver", [info_dictionary objectForKey:@BREAKPAD_VERSION]); 263 SetCrashKeyValue(@"ver", [info_dictionary objectForKey:@BREAKPAD_VERSION]);
264 SetCrashKeyValue(@"prod", [info_dictionary objectForKey:@BREAKPAD_PRODUCT]); 264 SetCrashKeyValue(@"prod", [info_dictionary objectForKey:@BREAKPAD_PRODUCT]);
265 SetCrashKeyValue(@"plat", @"OS X"); 265 SetCrashKeyValue(@"plat", @"OS X");
266 266
267 logging::SetLogMessageHandler(&FatalMessageHandler); 267 logging::PushLogMessageHandler(&FatalMessageHandler);
268 base::debug::SetDumpWithoutCrashingFunction(&DumpHelper::DumpWithoutCrashing); 268 base::debug::SetDumpWithoutCrashingFunction(&DumpHelper::DumpWithoutCrashing);
269 269
270 // abort() sends SIGABRT, which breakpad does not intercept. 270 // abort() sends SIGABRT, which breakpad does not intercept.
271 // Register a signal handler to crash in a way breakpad will 271 // Register a signal handler to crash in a way breakpad will
272 // intercept. 272 // intercept.
273 struct sigaction sigact; 273 struct sigaction sigact;
274 memset(&sigact, 0, sizeof(sigact)); 274 memset(&sigact, 0, sizeof(sigact));
275 sigact.sa_handler = SIGABRTHandler; 275 sigact.sa_handler = SIGABRTHandler;
276 CHECK(0 == sigaction(SIGABRT, &sigact, NULL)); 276 CHECK(0 == sigaction(SIGABRT, &sigact, NULL));
277 } 277 }
(...skipping 11 matching lines...) Expand all
289 289
290 // Store process type in crash dump. 290 // Store process type in crash dump.
291 SetCrashKeyValue(@"ptype", process_type); 291 SetCrashKeyValue(@"ptype", process_type);
292 292
293 NSString* pid_value = 293 NSString* pid_value =
294 [NSString stringWithFormat:@"%d", static_cast<unsigned int>(getpid())]; 294 [NSString stringWithFormat:@"%d", static_cast<unsigned int>(getpid())];
295 SetCrashKeyValue(@"pid", pid_value); 295 SetCrashKeyValue(@"pid", pid_value);
296 } 296 }
297 297
298 } // namespace breakpad 298 } // namespace breakpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698