Chromium Code Reviews| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 return exception_.get(); | 139 return exception_.get(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void ProcessSnapshotMac::InitializeThreads() { | 142 void ProcessSnapshotMac::InitializeThreads() { |
| 143 const std::vector<ProcessReader::Thread>& process_reader_threads = | 143 const std::vector<ProcessReader::Thread>& process_reader_threads = |
| 144 process_reader_.Threads(); | 144 process_reader_.Threads(); |
| 145 for (const ProcessReader::Thread& process_reader_thread : | 145 for (const ProcessReader::Thread& process_reader_thread : |
| 146 process_reader_threads) { | 146 process_reader_threads) { |
| 147 internal::ThreadSnapshotMac* thread = new internal::ThreadSnapshotMac(); | 147 internal::ThreadSnapshotMac* thread = new internal::ThreadSnapshotMac(); |
| 148 threads_.push_back(thread); | 148 threads_.push_back(thread); |
| 149 if (!thread->Initialize(&process_reader_, process_reader_thread)) { | 149 if (!thread->Initialize(&process_reader_, process_reader_thread)) { |
|
Robert Sesek
2015/03/04 01:52:25
Could you restructure this as:
auto thread = make
| |
| 150 delete thread; | |
| 150 threads_.pop_back(); | 151 threads_.pop_back(); |
| 151 } | 152 } |
| 152 } | 153 } |
| 153 } | 154 } |
| 154 | 155 |
| 155 void ProcessSnapshotMac::InitializeModules() { | 156 void ProcessSnapshotMac::InitializeModules() { |
| 156 const std::vector<ProcessReader::Module>& process_reader_modules = | 157 const std::vector<ProcessReader::Module>& process_reader_modules = |
| 157 process_reader_.Modules(); | 158 process_reader_.Modules(); |
| 158 for (const ProcessReader::Module& process_reader_module : | 159 for (const ProcessReader::Module& process_reader_module : |
| 159 process_reader_modules) { | 160 process_reader_modules) { |
| 160 internal::ModuleSnapshotMac* module = new internal::ModuleSnapshotMac(); | 161 internal::ModuleSnapshotMac* module = new internal::ModuleSnapshotMac(); |
| 161 modules_.push_back(module); | 162 modules_.push_back(module); |
| 162 if (!module->Initialize(&process_reader_, process_reader_module)) { | 163 if (!module->Initialize(&process_reader_, process_reader_module)) { |
| 164 delete module; | |
| 163 modules_.pop_back(); | 165 modules_.pop_back(); |
| 164 } | 166 } |
| 165 } | 167 } |
| 166 } | 168 } |
| 167 | 169 |
| 168 } // namespace crashpad | 170 } // namespace crashpad |
| OLD | NEW |