Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: snapshot/mac/process_snapshot_mac.cc

Issue 972383002: snapshot: Add a minimal ModuleSnapshotMinidump and accessor from ProcessSnapshotMinidump (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Add NOTREACHED() comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 const ExceptionSnapshot* ProcessSnapshotMac::Exception() const { 137 const ExceptionSnapshot* ProcessSnapshotMac::Exception() const {
138 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 138 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
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 auto thread = make_scoped_ptr(new internal::ThreadSnapshotMac());
148 threads_.push_back(thread); 148 if (thread->Initialize(&process_reader_, process_reader_thread)) {
149 if (!thread->Initialize(&process_reader_, process_reader_thread)) { 149 threads_.push_back(thread.release());
150 threads_.pop_back();
151 } 150 }
152 } 151 }
153 } 152 }
154 153
155 void ProcessSnapshotMac::InitializeModules() { 154 void ProcessSnapshotMac::InitializeModules() {
156 const std::vector<ProcessReader::Module>& process_reader_modules = 155 const std::vector<ProcessReader::Module>& process_reader_modules =
157 process_reader_.Modules(); 156 process_reader_.Modules();
158 for (const ProcessReader::Module& process_reader_module : 157 for (const ProcessReader::Module& process_reader_module :
159 process_reader_modules) { 158 process_reader_modules) {
160 internal::ModuleSnapshotMac* module = new internal::ModuleSnapshotMac(); 159 auto module = make_scoped_ptr(new internal::ModuleSnapshotMac());
161 modules_.push_back(module); 160 if (module->Initialize(&process_reader_, process_reader_module)) {
162 if (!module->Initialize(&process_reader_, process_reader_module)) { 161 modules_.push_back(module.release());
163 modules_.pop_back();
164 } 162 }
165 } 163 }
166 } 164 }
167 165
168 } // namespace crashpad 166 } // namespace crashpad
OLDNEW
« no previous file with comments | « snapshot/mac/module_snapshot_mac.cc ('k') | snapshot/minidump/minidump_simple_string_dictionary_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698