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

Unified Diff: snapshot/win/module_snapshot_win.cc

Issue 1355503005: win: Make reading CrashpadInfo work across bitness (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes Created 5 years, 3 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/win/module_snapshot_win.h ('k') | snapshot/win/pe_image_annotations_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « snapshot/win/module_snapshot_win.h ('k') | snapshot/win/pe_image_annotations_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698