Index: snapshot/win/module_snapshot_win.cc |
diff --git a/snapshot/win/module_snapshot_win.cc b/snapshot/win/module_snapshot_win.cc |
index d375b5147df10e7132599e59c03fa134a8fc3e5a..6c583092a27a12875d967dc6fbe5892ba9d044a6 100644 |
--- a/snapshot/win/module_snapshot_win.cc |
+++ b/snapshot/win/module_snapshot_win.cc |
@@ -57,21 +57,10 @@ bool ModuleSnapshotWin::Initialize( |
void ModuleSnapshotWin::GetCrashpadOptions(CrashpadInfoClientOptions* options) { |
INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
- |
- process_types::CrashpadInfo crashpad_info; |
- if (!pe_image_reader_->GetCrashpadInfo(&crashpad_info)) { |
- options->crashpad_handler_behavior = TriState::kUnset; |
- options->system_crash_reporter_forwarding = TriState::kUnset; |
- return; |
- } |
- |
- options->crashpad_handler_behavior = |
- CrashpadInfoClientOptions::TriStateFromCrashpadInfo( |
- crashpad_info.crashpad_handler_behavior); |
- |
- options->system_crash_reporter_forwarding = |
- CrashpadInfoClientOptions::TriStateFromCrashpadInfo( |
- crashpad_info.system_crash_reporter_forwarding); |
+ if (process_reader_->Is64Bit()) |
+ GetCrashpadOptionsInternal<process_types::internal::Traits64>(options); |
+ else |
+ GetCrashpadOptionsInternal<process_types::internal::Traits32>(options); |
} |
std::string ModuleSnapshotWin::Name() const { |
@@ -171,5 +160,24 @@ std::map<std::string, std::string> ModuleSnapshotWin::AnnotationsSimpleMap() |
return annotations_reader.SimpleMap(); |
} |
+template <class Traits> |
+void ModuleSnapshotWin::GetCrashpadOptionsInternal( |
+ CrashpadInfoClientOptions* options) { |
+ process_types::CrashpadInfo<Traits> crashpad_info; |
+ if (!pe_image_reader_->GetCrashpadInfo(&crashpad_info)) { |
+ options->crashpad_handler_behavior = TriState::kUnset; |
+ options->system_crash_reporter_forwarding = TriState::kUnset; |
+ return; |
+ } |
+ |
+ options->crashpad_handler_behavior = |
+ CrashpadInfoClientOptions::TriStateFromCrashpadInfo( |
+ crashpad_info.crashpad_handler_behavior); |
+ |
+ options->system_crash_reporter_forwarding = |
+ CrashpadInfoClientOptions::TriStateFromCrashpadInfo( |
+ crashpad_info.system_crash_reporter_forwarding); |
+} |
+ |
} // namespace internal |
} // namespace crashpad |