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/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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 // when the application crashes, and provide the user with the option to | 211 // when the application crashes, and provide the user with the option to |
212 // restart it. | 212 // restart it. |
213 if (is_browser) | 213 if (is_browser) |
214 [breakpad_config setObject:@"NO" forKey:@BREAKPAD_SEND_AND_EXIT]; | 214 [breakpad_config setObject:@"NO" forKey:@BREAKPAD_SEND_AND_EXIT]; |
215 | 215 |
216 base::FilePath dir_crash_dumps; | 216 base::FilePath dir_crash_dumps; |
217 GetBreakpadClient()->GetCrashDumpLocation(&dir_crash_dumps); | 217 GetBreakpadClient()->GetCrashDumpLocation(&dir_crash_dumps); |
218 [breakpad_config setObject:base::SysUTF8ToNSString(dir_crash_dumps.value()) | 218 [breakpad_config setObject:base::SysUTF8ToNSString(dir_crash_dumps.value()) |
219 forKey:@BREAKPAD_DUMP_DIRECTORY]; | 219 forKey:@BREAKPAD_DUMP_DIRECTORY]; |
220 | 220 |
221 // Temporarily run Breakpad in-process on 10.10 and later because APIs that | |
222 // it depends on got broken (http://crbug.com/386208). | |
223 // This can catch crashes in the browser process only. | |
224 [breakpad_config setObject:@(base::mac::IsOSYosemiteOrLater()) | |
Mark Mentovai
2014/09/12 21:52:20
1. Can we avoid setting this key altogether if we’
Andre
2014/09/12 23:00:13
Done.
| |
225 forKey:@BREAKPAD_IN_PROCESS]; | |
226 | |
221 // Initialize Breakpad. | 227 // Initialize Breakpad. |
222 gBreakpadRef = BreakpadCreate(breakpad_config); | 228 gBreakpadRef = BreakpadCreate(breakpad_config); |
223 if (!gBreakpadRef) { | 229 if (!gBreakpadRef) { |
224 LOG_IF(ERROR, base::mac::AmIBundled()) << "Breakpad initializaiton failed"; | 230 LOG_IF(ERROR, base::mac::AmIBundled()) << "Breakpad initializaiton failed"; |
225 return; | 231 return; |
226 } | 232 } |
227 | 233 |
228 // Initialize the scoped crash key system. | 234 // Initialize the scoped crash key system. |
229 base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueImpl, | 235 base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueImpl, |
230 &ClearCrashKeyValueImpl); | 236 &ClearCrashKeyValueImpl); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 | 276 |
271 // Store process type in crash dump. | 277 // Store process type in crash dump. |
272 SetCrashKeyValue(@"ptype", process_type); | 278 SetCrashKeyValue(@"ptype", process_type); |
273 | 279 |
274 NSString* pid_value = | 280 NSString* pid_value = |
275 [NSString stringWithFormat:@"%d", static_cast<unsigned int>(getpid())]; | 281 [NSString stringWithFormat:@"%d", static_cast<unsigned int>(getpid())]; |
276 SetCrashKeyValue(@"pid", pid_value); | 282 SetCrashKeyValue(@"pid", pid_value); |
277 } | 283 } |
278 | 284 |
279 } // namespace breakpad | 285 } // namespace breakpad |
OLD | NEW |