| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 [breakpad_config setObject:@"NO" forKey:@BREAKPAD_SEND_AND_EXIT]; | 234 [breakpad_config setObject:@"NO" forKey:@BREAKPAD_SEND_AND_EXIT]; |
| 235 | 235 |
| 236 base::FilePath dir_crash_dumps; | 236 base::FilePath dir_crash_dumps; |
| 237 GetCrashReporterClient()->GetCrashDumpLocation(&dir_crash_dumps); | 237 GetCrashReporterClient()->GetCrashDumpLocation(&dir_crash_dumps); |
| 238 [breakpad_config setObject:base::SysUTF8ToNSString(dir_crash_dumps.value()) | 238 [breakpad_config setObject:base::SysUTF8ToNSString(dir_crash_dumps.value()) |
| 239 forKey:@BREAKPAD_DUMP_DIRECTORY]; | 239 forKey:@BREAKPAD_DUMP_DIRECTORY]; |
| 240 | 240 |
| 241 // Temporarily run Breakpad in-process on 10.10 and later because APIs that | 241 // Temporarily run Breakpad in-process on 10.10 and later because APIs that |
| 242 // it depends on got broken (http://crbug.com/386208). | 242 // it depends on got broken (http://crbug.com/386208). |
| 243 // This can catch crashes in the browser process only. | 243 // This can catch crashes in the browser process only. |
| 244 if (is_browser && base::mac::IsOSYosemiteOrLater()) { | 244 if (is_browser && base::mac::IsAtLeastOS10_10()) { |
| 245 [breakpad_config setObject:[NSNumber numberWithBool:YES] | 245 [breakpad_config setObject:[NSNumber numberWithBool:YES] |
| 246 forKey:@BREAKPAD_IN_PROCESS]; | 246 forKey:@BREAKPAD_IN_PROCESS]; |
| 247 } | 247 } |
| 248 | 248 |
| 249 // Initialize Breakpad. | 249 // Initialize Breakpad. |
| 250 gBreakpadRef = BreakpadCreate(breakpad_config); | 250 gBreakpadRef = BreakpadCreate(breakpad_config); |
| 251 if (!gBreakpadRef) { | 251 if (!gBreakpadRef) { |
| 252 LOG_IF(ERROR, base::mac::AmIBundled()) << "Breakpad initialization failed"; | 252 LOG_IF(ERROR, base::mac::AmIBundled()) << "Breakpad initialization failed"; |
| 253 return; | 253 return; |
| 254 } | 254 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |