| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/crash/content/app/crashpad.h" | 5 #include "components/crash/content/app/crashpad.h" |
| 6 | 6 |
| 7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 std::vector<std::string> arguments; | 83 std::vector<std::string> arguments; |
| 84 if (!browser_process) { | 84 if (!browser_process) { |
| 85 // If this is an initial client that's not the browser process, it's | 85 // If this is an initial client that's not the browser process, it's |
| 86 // important that the new Crashpad handler also not be connected to any | 86 // important that the new Crashpad handler also not be connected to any |
| 87 // existing handler. This argument tells the new Crashpad handler to | 87 // existing handler. This argument tells the new Crashpad handler to |
| 88 // sever this connection. | 88 // sever this connection. |
| 89 arguments.push_back( | 89 arguments.push_back( |
| 90 "--reset-own-crash-exception-port-to-system-default"); | 90 "--reset-own-crash-exception-port-to-system-default"); |
| 91 } | 91 } |
| 92 | 92 |
| 93 crashpad::CrashpadClient crashpad_client; | 93 bool result = GetCrashpadClient().StartHandler( |
| 94 bool result = crashpad_client.StartHandler(handler_path, | 94 handler_path, database_path, metrics_path, url, process_annotations, |
| 95 database_path, | 95 arguments, true, false); |
| 96 metrics_path, | |
| 97 url, | |
| 98 process_annotations, | |
| 99 arguments, | |
| 100 true, | |
| 101 false); | |
| 102 | 96 |
| 103 // If this is an initial client that's not the browser process, it's | 97 // If this is an initial client that's not the browser process, it's |
| 104 // important to sever the connection to any existing handler. If | 98 // important to sever the connection to any existing handler. If |
| 105 // StartHandler() failed, call UseSystemDefaultHandler() to drop the link | 99 // StartHandler() failed, call UseSystemDefaultHandler() to drop the link |
| 106 // to the existing handler. | 100 // to the existing handler. |
| 107 if (!result && !browser_process) { | 101 if (!result && !browser_process) { |
| 108 crashpad::CrashpadClient::UseSystemDefaultHandler(); | 102 crashpad::CrashpadClient::UseSystemDefaultHandler(); |
| 109 } | 103 } |
| 110 } // @autoreleasepool | 104 } // @autoreleasepool |
| 111 } | 105 } |
| 112 | 106 |
| 113 return database_path; | 107 return database_path; |
| 114 } | 108 } |
| 115 | 109 |
| 116 } // namespace internal | 110 } // namespace internal |
| 117 } // namespace crash_reporter | 111 } // namespace crash_reporter |
| OLD | NEW |