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

Unified 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, 10 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/mac/process_snapshot_mac.cc
diff --git a/snapshot/mac/process_snapshot_mac.cc b/snapshot/mac/process_snapshot_mac.cc
index 767c75a049fac3a7bd91bb9d0c1e2ff571fe88b6..bb11526706551b0fc7b41a670b5cd04899bd2cb2 100644
--- a/snapshot/mac/process_snapshot_mac.cc
+++ b/snapshot/mac/process_snapshot_mac.cc
@@ -144,10 +144,9 @@ void ProcessSnapshotMac::InitializeThreads() {
process_reader_.Threads();
for (const ProcessReader::Thread& process_reader_thread :
process_reader_threads) {
- internal::ThreadSnapshotMac* thread = new internal::ThreadSnapshotMac();
- threads_.push_back(thread);
- if (!thread->Initialize(&process_reader_, process_reader_thread)) {
- threads_.pop_back();
+ auto thread = make_scoped_ptr(new internal::ThreadSnapshotMac());
+ if (thread->Initialize(&process_reader_, process_reader_thread)) {
+ threads_.push_back(thread.release());
}
}
}
@@ -157,10 +156,9 @@ void ProcessSnapshotMac::InitializeModules() {
process_reader_.Modules();
for (const ProcessReader::Module& process_reader_module :
process_reader_modules) {
- internal::ModuleSnapshotMac* module = new internal::ModuleSnapshotMac();
- modules_.push_back(module);
- if (!module->Initialize(&process_reader_, process_reader_module)) {
- modules_.pop_back();
+ auto module = make_scoped_ptr(new internal::ModuleSnapshotMac());
+ if (module->Initialize(&process_reader_, process_reader_module)) {
+ modules_.push_back(module.release());
}
}
}
« 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