OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 flavor, | 72 flavor, |
73 state, | 73 state, |
74 state_count)) { | 74 state_count)) { |
75 exception_.reset(); | 75 exception_.reset(); |
76 return false; | 76 return false; |
77 } | 77 } |
78 | 78 |
79 return true; | 79 return true; |
80 } | 80 } |
81 | 81 |
| 82 void ProcessSnapshotMac::GetCrashpadOptions( |
| 83 CrashpadInfoClientOptions* options) { |
| 84 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 85 |
| 86 CrashpadInfoClientOptions local_options; |
| 87 |
| 88 for (internal::ModuleSnapshotMac* module : modules_) { |
| 89 CrashpadInfoClientOptions module_options; |
| 90 module->GetCrashpadOptions(&module_options); |
| 91 |
| 92 if (local_options.crashpad_handler_behavior == |
| 93 CrashpadInfoClientOptions::TriState::kDefault) { |
| 94 local_options.crashpad_handler_behavior = |
| 95 module_options.crashpad_handler_behavior; |
| 96 } |
| 97 if (local_options.system_crash_reporter_forwarding == |
| 98 CrashpadInfoClientOptions::TriState::kDefault) { |
| 99 local_options.system_crash_reporter_forwarding = |
| 100 module_options.system_crash_reporter_forwarding; |
| 101 } |
| 102 |
| 103 // If non-default values have been found for all options, the loop can end |
| 104 // early. |
| 105 if (local_options.crashpad_handler_behavior != |
| 106 CrashpadInfoClientOptions::TriState::kDefault && |
| 107 local_options.system_crash_reporter_forwarding != |
| 108 CrashpadInfoClientOptions::TriState::kDefault) { |
| 109 break; |
| 110 } |
| 111 } |
| 112 |
| 113 *options = local_options; |
| 114 } |
| 115 |
82 pid_t ProcessSnapshotMac::ProcessID() const { | 116 pid_t ProcessSnapshotMac::ProcessID() const { |
83 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 117 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
84 return process_reader_.ProcessID(); | 118 return process_reader_.ProcessID(); |
85 } | 119 } |
86 | 120 |
87 pid_t ProcessSnapshotMac::ParentProcessID() const { | 121 pid_t ProcessSnapshotMac::ParentProcessID() const { |
88 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 122 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
89 return process_reader_.ProcessID(); | 123 return process_reader_.ProcessID(); |
90 } | 124 } |
91 | 125 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 for (const ProcessReader::Module& process_reader_module : | 191 for (const ProcessReader::Module& process_reader_module : |
158 process_reader_modules) { | 192 process_reader_modules) { |
159 auto module = make_scoped_ptr(new internal::ModuleSnapshotMac()); | 193 auto module = make_scoped_ptr(new internal::ModuleSnapshotMac()); |
160 if (module->Initialize(&process_reader_, process_reader_module)) { | 194 if (module->Initialize(&process_reader_, process_reader_module)) { |
161 modules_.push_back(module.release()); | 195 modules_.push_back(module.release()); |
162 } | 196 } |
163 } | 197 } |
164 } | 198 } |
165 | 199 |
166 } // namespace crashpad | 200 } // namespace crashpad |
OLD | NEW |