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/breakpad/app/breakpad_mac.h" | 5 #import "components/breakpad/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 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 GetBreakpadClient()->RegisterCrashKeys(); | 231 GetBreakpadClient()->RegisterCrashKeys(); |
232 | 232 |
233 // Set Breakpad metadata values. These values are added to Info.plist during | 233 // Set Breakpad metadata values. These values are added to Info.plist during |
234 // the branded Google Chrome.app build. | 234 // the branded Google Chrome.app build. |
235 SetCrashKeyValue(@"ver", [info_dictionary objectForKey:@BREAKPAD_VERSION]); | 235 SetCrashKeyValue(@"ver", [info_dictionary objectForKey:@BREAKPAD_VERSION]); |
236 SetCrashKeyValue(@"prod", [info_dictionary objectForKey:@BREAKPAD_PRODUCT]); | 236 SetCrashKeyValue(@"prod", [info_dictionary objectForKey:@BREAKPAD_PRODUCT]); |
237 SetCrashKeyValue(@"plat", @"OS X"); | 237 SetCrashKeyValue(@"plat", @"OS X"); |
238 | 238 |
239 if (!is_browser) { | 239 if (!is_browser) { |
240 // Get the guid from the command line switch. | 240 // Get the guid from the command line switch. |
241 std::string guid = | 241 std::string client_guid = |
242 command_line->GetSwitchValueASCII(switches::kEnableCrashReporter); | 242 command_line->GetSwitchValueASCII(switches::kEnableCrashReporter); |
243 GetBreakpadClient()->SetClientID(guid); | 243 GetBreakpadClient()->SetBreakpadClientIdFromGUID(client_guid); |
244 } | 244 } |
245 | 245 |
246 logging::SetLogMessageHandler(&FatalMessageHandler); | 246 logging::SetLogMessageHandler(&FatalMessageHandler); |
247 base::debug::SetDumpWithoutCrashingFunction(&DumpHelper::DumpWithoutCrashing); | 247 base::debug::SetDumpWithoutCrashingFunction(&DumpHelper::DumpWithoutCrashing); |
248 | 248 |
249 // abort() sends SIGABRT, which breakpad does not intercept. | 249 // abort() sends SIGABRT, which breakpad does not intercept. |
250 // Register a signal handler to crash in a way breakpad will | 250 // Register a signal handler to crash in a way breakpad will |
251 // intercept. | 251 // intercept. |
252 struct sigaction sigact; | 252 struct sigaction sigact; |
253 memset(&sigact, 0, sizeof(sigact)); | 253 memset(&sigact, 0, sizeof(sigact)); |
(...skipping 16 matching lines...) Expand all Loading... |
270 | 270 |
271 // Store process type in crash dump. | 271 // Store process type in crash dump. |
272 SetCrashKeyValue(@"ptype", process_type); | 272 SetCrashKeyValue(@"ptype", process_type); |
273 | 273 |
274 NSString* pid_value = | 274 NSString* pid_value = |
275 [NSString stringWithFormat:@"%d", static_cast<unsigned int>(getpid())]; | 275 [NSString stringWithFormat:@"%d", static_cast<unsigned int>(getpid())]; |
276 SetCrashKeyValue(@"pid", pid_value); | 276 SetCrashKeyValue(@"pid", pid_value); |
277 } | 277 } |
278 | 278 |
279 } // namespace breakpad | 279 } // namespace breakpad |
OLD | NEW |