Chromium Code Reviews| 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, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 INITIALIZATION_STATE_SET_VALID(initialized_); | 79 INITIALIZATION_STATE_SET_VALID(initialized_); |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 template <class Traits> | 83 template <class Traits> |
| 84 bool PEImageReader::GetCrashpadInfo( | 84 bool PEImageReader::GetCrashpadInfo( |
| 85 process_types::CrashpadInfo<Traits>* crashpad_info) const { | 85 process_types::CrashpadInfo<Traits>* crashpad_info) const { |
| 86 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 86 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 87 | 87 |
| 88 IMAGE_SECTION_HEADER section; | 88 IMAGE_SECTION_HEADER section; |
| 89 if (!GetSectionByName<NtHeadersForTraits<Traits>::type>("CPADinfo", §ion)) | 89 if (!GetSectionByName<typename NtHeadersForTraits<Traits>::type>("CPADinfo", |
| 90 §ion)) | |
| 90 return false; | 91 return false; |
|
Mark Mentovai
2015/11/26 02:06:37
{} this now
hans
2015/11/26 03:16:52
Done.
| |
| 91 | 92 |
| 92 if (section.Misc.VirtualSize < sizeof(process_types::CrashpadInfo<Traits>)) { | 93 if (section.Misc.VirtualSize < sizeof(process_types::CrashpadInfo<Traits>)) { |
| 93 LOG(WARNING) << "small crashpad info section size " | 94 LOG(WARNING) << "small crashpad info section size " |
| 94 << section.Misc.VirtualSize << ", " << module_name_; | 95 << section.Misc.VirtualSize << ", " << module_name_; |
| 95 return false; | 96 return false; |
| 96 } | 97 } |
| 97 | 98 |
| 98 WinVMAddress crashpad_info_address = Address() + section.VirtualAddress; | 99 WinVMAddress crashpad_info_address = Address() + section.VirtualAddress; |
| 99 CheckedWinAddressRange crashpad_info_range(process_reader_->Is64Bit(), | 100 CheckedWinAddressRange crashpad_info_range(process_reader_->Is64Bit(), |
| 100 crashpad_info_address, | 101 crashpad_info_address, |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 // Explicit instantiations with the only 2 valid template arguments to avoid | 302 // Explicit instantiations with the only 2 valid template arguments to avoid |
| 302 // putting the body of the function in the header. | 303 // putting the body of the function in the header. |
| 303 template bool PEImageReader::GetCrashpadInfo<process_types::internal::Traits32>( | 304 template bool PEImageReader::GetCrashpadInfo<process_types::internal::Traits32>( |
| 304 process_types::CrashpadInfo<process_types::internal::Traits32>* | 305 process_types::CrashpadInfo<process_types::internal::Traits32>* |
| 305 crashpad_info) const; | 306 crashpad_info) const; |
| 306 template bool PEImageReader::GetCrashpadInfo<process_types::internal::Traits64>( | 307 template bool PEImageReader::GetCrashpadInfo<process_types::internal::Traits64>( |
| 307 process_types::CrashpadInfo<process_types::internal::Traits64>* | 308 process_types::CrashpadInfo<process_types::internal::Traits64>* |
| 308 crashpad_info) const; | 309 crashpad_info) const; |
| 309 | 310 |
| 310 } // namespace crashpad | 311 } // namespace crashpad |
| OLD | NEW |