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 #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 Loading... |
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 Loading... |
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 |
OLD | NEW |