| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 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, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 #include "snapshot/win/module_snapshot_win.h" | 15 #include "snapshot/win/module_snapshot_win.h" |
| 16 | 16 |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "snapshot/win/pe_image_annotations_reader.h" | 18 #include "snapshot/win/pe_image_annotations_reader.h" |
| 19 #include "snapshot/win/pe_image_reader.h" | 19 #include "snapshot/win/pe_image_reader.h" |
| 20 #include "util/misc/tri_state.h" | 20 #include "util/misc/tri_state.h" |
| 21 #include "util/misc/uuid.h" | 21 #include "util/misc/uuid.h" |
| 22 #include "util/win/module_version.h" | |
| 23 | 22 |
| 24 namespace crashpad { | 23 namespace crashpad { |
| 25 namespace internal { | 24 namespace internal { |
| 26 | 25 |
| 27 ModuleSnapshotWin::ModuleSnapshotWin() | 26 ModuleSnapshotWin::ModuleSnapshotWin() |
| 28 : ModuleSnapshot(), | 27 : ModuleSnapshot(), |
| 29 name_(), | 28 name_(), |
| 30 pdb_name_(), | 29 pdb_name_(), |
| 31 uuid_(), | 30 uuid_(), |
| 32 pe_image_reader_(), | 31 pe_image_reader_(), |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 options->system_crash_reporter_forwarding = | 202 options->system_crash_reporter_forwarding = |
| 204 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( | 203 CrashpadInfoClientOptions::TriStateFromCrashpadInfo( |
| 205 crashpad_info.system_crash_reporter_forwarding); | 204 crashpad_info.system_crash_reporter_forwarding); |
| 206 } | 205 } |
| 207 | 206 |
| 208 const VS_FIXEDFILEINFO* ModuleSnapshotWin::VSFixedFileInfo() const { | 207 const VS_FIXEDFILEINFO* ModuleSnapshotWin::VSFixedFileInfo() const { |
| 209 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 208 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 210 | 209 |
| 211 if (initialized_vs_fixed_file_info_.is_uninitialized()) { | 210 if (initialized_vs_fixed_file_info_.is_uninitialized()) { |
| 212 initialized_vs_fixed_file_info_.set_invalid(); | 211 initialized_vs_fixed_file_info_.set_invalid(); |
| 213 if (GetModuleVersionAndType(base::FilePath(name_), &vs_fixed_file_info_)) { | 212 if (pe_image_reader_->VSFixedFileInfo(&vs_fixed_file_info_)) { |
| 214 initialized_vs_fixed_file_info_.set_valid(); | 213 initialized_vs_fixed_file_info_.set_valid(); |
| 215 } | 214 } |
| 216 } | 215 } |
| 217 | 216 |
| 218 return initialized_vs_fixed_file_info_.is_valid() ? &vs_fixed_file_info_ | 217 return initialized_vs_fixed_file_info_.is_valid() ? &vs_fixed_file_info_ |
| 219 : nullptr; | 218 : nullptr; |
| 220 } | 219 } |
| 221 | 220 |
| 222 } // namespace internal | 221 } // namespace internal |
| 223 } // namespace crashpad | 222 } // namespace crashpad |
| OLD | NEW |