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

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

Issue 365133005: Refactor SetClientID such that metrics rather than crash backs up the client id in Google Update set (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits:grt Created 6 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 | Annotate | Revision Log
« no previous file with comments | « components/breakpad/app/breakpad_linux.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « components/breakpad/app/breakpad_linux.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698