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

Side by Side Diff: snapshot/win/module_snapshot_win.cc

Issue 1475023004: Get module versions and types from in-memory images (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback (2) Created 5 years 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
« no previous file with comments | « snapshot/snapshot.gyp ('k') | snapshot/win/pe_image_reader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « snapshot/snapshot.gyp ('k') | snapshot/win/pe_image_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698