| 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 23 matching lines...) Expand all Loading... |
| 34 //! | 34 //! |
| 35 //! Currently, this class can decode information stored only in the CrashpadInfo | 35 //! Currently, this class can decode information stored only in the CrashpadInfo |
| 36 //! structure. This format is used by Crashpad clients. The "simple annotations" | 36 //! structure. This format is used by Crashpad clients. The "simple annotations" |
| 37 //! are recovered from any module with a compatible data section, and are | 37 //! are recovered from any module with a compatible data section, and are |
| 38 //! included in the annotations returned by SimpleMap(). | 38 //! included in the annotations returned by SimpleMap(). |
| 39 class PEImageAnnotationsReader { | 39 class PEImageAnnotationsReader { |
| 40 public: | 40 public: |
| 41 //! \brief Constructs the object. | 41 //! \brief Constructs the object. |
| 42 //! | 42 //! |
| 43 //! \param[in] process_reader The reader for the remote process. | 43 //! \param[in] process_reader The reader for the remote process. |
| 44 //! \param[in] image_reader The PEImageReader for the PE image file contained | 44 //! \param[in] pe_image_reader The PEImageReader for the PE image file |
| 45 //! within the remote process. | 45 //! contained within the remote process. |
| 46 //! \param[in] name The module's name, a string to be used in logged messages. | 46 //! \param[in] name The module's name, a string to be used in logged messages. |
| 47 //! This string is for diagnostic purposes only, and may be empty. | 47 //! This string is for diagnostic purposes only, and may be empty. |
| 48 PEImageAnnotationsReader(ProcessReaderWin* process_reader, | 48 PEImageAnnotationsReader(ProcessReaderWin* process_reader, |
| 49 const PEImageReader* pe_image_reader, | 49 const PEImageReader* pe_image_reader, |
| 50 const std::wstring& name); | 50 const std::wstring& name); |
| 51 ~PEImageAnnotationsReader() {} | 51 ~PEImageAnnotationsReader() {} |
| 52 | 52 |
| 53 //! \brief Returns the module's annotations that are organized as key-value | 53 //! \brief Returns the module's annotations that are organized as key-value |
| 54 //! pairs, where all keys and values are strings. | 54 //! pairs, where all keys and values are strings. |
| 55 std::map<std::string, std::string> SimpleMap() const; | 55 std::map<std::string, std::string> SimpleMap() const; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 // Reads CrashpadInfo::simple_annotations_ on behalf of SimpleMap(). | 58 // Reads CrashpadInfo::simple_annotations_ on behalf of SimpleMap(). |
| 59 template <class Traits> | 59 template <class Traits> |
| 60 void ReadCrashpadSimpleAnnotations( | 60 void ReadCrashpadSimpleAnnotations( |
| 61 std::map<std::string, std::string>* simple_map_annotations) const; | 61 std::map<std::string, std::string>* simple_map_annotations) const; |
| 62 | 62 |
| 63 std::wstring name_; | 63 std::wstring name_; |
| 64 ProcessReaderWin* process_reader_; // weak | 64 ProcessReaderWin* process_reader_; // weak |
| 65 const PEImageReader* pe_image_reader_; // weak | 65 const PEImageReader* pe_image_reader_; // weak |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(PEImageAnnotationsReader); | 67 DISALLOW_COPY_AND_ASSIGN(PEImageAnnotationsReader); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace crashpad | 70 } // namespace crashpad |
| 71 | 71 |
| 72 #endif // CRASHPAD_SNAPSHOT_WIN_PE_IMAGE_ANNOTATIONS_READER_H_ | 72 #endif // CRASHPAD_SNAPSHOT_WIN_PE_IMAGE_ANNOTATIONS_READER_H_ |
| OLD | NEW |