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

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

Issue 1000203007: Set a "metrics_client_id" crash key instead of "guid" on Mac OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove sentencelet Created 5 years, 9 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/app/breakpad_mac.h" 5 #import "components/crash/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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueImpl, 245 base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueImpl,
246 &ClearCrashKeyValueImpl); 246 &ClearCrashKeyValueImpl);
247 GetCrashReporterClient()->RegisterCrashKeys(); 247 GetCrashReporterClient()->RegisterCrashKeys();
248 248
249 // Set Breakpad metadata values. These values are added to Info.plist during 249 // Set Breakpad metadata values. These values are added to Info.plist during
250 // the branded Google Chrome.app build. 250 // the branded Google Chrome.app build.
251 SetCrashKeyValue(@"ver", [info_dictionary objectForKey:@BREAKPAD_VERSION]); 251 SetCrashKeyValue(@"ver", [info_dictionary objectForKey:@BREAKPAD_VERSION]);
252 SetCrashKeyValue(@"prod", [info_dictionary objectForKey:@BREAKPAD_PRODUCT]); 252 SetCrashKeyValue(@"prod", [info_dictionary objectForKey:@BREAKPAD_PRODUCT]);
253 SetCrashKeyValue(@"plat", @"OS X"); 253 SetCrashKeyValue(@"plat", @"OS X");
254 254
255 if (!is_browser) {
256 // Get the guid from the command line switch.
257 std::string client_guid =
258 command_line->GetSwitchValueASCII(switches::kEnableCrashReporter);
259 GetCrashReporterClient()->SetCrashReporterClientIdFromGUID(client_guid);
260 }
261
262 logging::SetLogMessageHandler(&FatalMessageHandler); 255 logging::SetLogMessageHandler(&FatalMessageHandler);
263 base::debug::SetDumpWithoutCrashingFunction(&DumpHelper::DumpWithoutCrashing); 256 base::debug::SetDumpWithoutCrashingFunction(&DumpHelper::DumpWithoutCrashing);
264 257
265 // abort() sends SIGABRT, which breakpad does not intercept. 258 // abort() sends SIGABRT, which breakpad does not intercept.
266 // Register a signal handler to crash in a way breakpad will 259 // Register a signal handler to crash in a way breakpad will
267 // intercept. 260 // intercept.
268 struct sigaction sigact; 261 struct sigaction sigact;
269 memset(&sigact, 0, sizeof(sigact)); 262 memset(&sigact, 0, sizeof(sigact));
270 sigact.sa_handler = SIGABRTHandler; 263 sigact.sa_handler = SIGABRTHandler;
271 CHECK(0 == sigaction(SIGABRT, &sigact, NULL)); 264 CHECK(0 == sigaction(SIGABRT, &sigact, NULL));
(...skipping 12 matching lines...) Expand all
284 277
285 // Store process type in crash dump. 278 // Store process type in crash dump.
286 SetCrashKeyValue(@"ptype", process_type); 279 SetCrashKeyValue(@"ptype", process_type);
287 280
288 NSString* pid_value = 281 NSString* pid_value =
289 [NSString stringWithFormat:@"%d", static_cast<unsigned int>(getpid())]; 282 [NSString stringWithFormat:@"%d", static_cast<unsigned int>(getpid())];
290 SetCrashKeyValue(@"pid", pid_value); 283 SetCrashKeyValue(@"pid", pid_value);
291 } 284 }
292 285
293 } // namespace breakpad 286 } // namespace breakpad
OLDNEW
« no previous file with comments | « chromecast/browser/metrics/cast_metrics_service_client.cc ('k') | components/crash/app/crash_reporter_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698